SuccessChanges

Summary

  1. [CodeGen][SVE] Calculate correct type legalization for scalable vectors. (details)
  2. [mlir][gpu] Introduce mlir-rocm-runner. (details)
  3. [VE] Support logical operation instructions in MC layer (details)
  4. [AST] Record SourceLocation for TypoExpr. (details)
  5. Revert "[CodeGen][SVE] Calculate correct type legalization for scalable vectors." (details)
  6. [lit] Improve naming of test result categories (details)
  7. [mlir][SCF] Add single iteration scf.for promotion to the FuncOp level helper. (details)
  8. [dsymutil] Don't emit N_AST symbol entries in the Mach-O companion file (details)
  9. Fix crash on misc-redundant-expression (details)
  10. [ELF] Handle -u before input files (details)
  11. [flang] Fix crash on erroneous expressions (details)
  12. Fix the roundtrip test under llvm-profdata (details)
  13. [X86][SSE] Simplify MOVMSK patterns based on comparison (details)
  14. Mark lambda in use-after-scope-capture.cpp as noinline (details)
  15. Add ASan metadata globals to @llvm.compiler.used under COFF (details)
Commit 164f4b9d26fdf3cd640a09b63b5ec44d033cbe8a by sander.desmalen
[CodeGen][SVE] Calculate correct type legalization for scalable vectors.

This patch updates TargetLoweringBase::computeRegisterProperties and
TargetLoweringBase::getTypeConversion to support scalable vectors,
and make the right calls on how to legalise them. These changes are required
to legalise both MVTs and EVTs.

Reviewers: efriedma, david-arm, ctetreau

Reviewed By: efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80640
The file was modifiedllvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringBase.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetLowering.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
The file was modifiedllvm/include/llvm/Support/TypeSize.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Commit 2fd6403a6d7a81c3c9d2676643bfeda042359d3c by whchung
[mlir][gpu] Introduce mlir-rocm-runner.

Summary:
`mlir-rocm-runner` is introduced in this commit to execute GPU modules on ROCm
platform. A small wrapper to encapsulate ROCm's HIP runtime API is also inside
the commit.

Due to behavior of ROCm, raw pointers inside memrefs passed to `gpu.launch`
must be modified on the host side to properly capture the pointer values
addressable on the GPU.

LLVM MC is used to assemble AMD GCN ISA coming out from
`ConvertGPUKernelToBlobPass` to binary form, and LLD is used to produce a shared
ELF object which could be loaded by ROCm HIP runtime.

gfx900 is the default target be used right now, although it could be altered via
an option in `mlir-rocm-runner`. Future revisions may consider using ROCm Agent
Enumerator to detect the right target on the system.

Notice AMDGPU Code Object V2 is used in this revision. Future enhancements may
upgrade to AMDGPU Code Object V3.

Bitcode libraries in ROCm-Device-Libs, which implements math routines exposed in
`rocdl` dialect are not yet linked, and is left as a TODO in the logic.

Reviewers: herhut

Subscribers: mgorny, tpr, dexonsmith, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits

Tags: #mlir, #llvm

Differential Revision: https://reviews.llvm.org/D80676
The file was addedmlir/test/mlir-rocm-runner/gpu-to-hsaco.mlir
The file was addedmlir/tools/mlir-rocm-runner/mlir-rocm-runner.cpp
The file was modifiedmlir/test/lit.site.cfg.py.in
The file was addedmlir/tools/mlir-rocm-runner/rocm-runtime-wrappers.cpp
The file was addedmlir/tools/mlir-rocm-runner/CMakeLists.txt
The file was modifiedmlir/test/lit.cfg.py
The file was addedmlir/test/mlir-rocm-runner/vecadd.mlir
The file was modifiedmlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
The file was modifiedmlir/tools/CMakeLists.txt
The file was modifiedmlir/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/GPUCommon/ConvertLaunchFuncToRuntimeCalls.cpp
The file was modifiedmlir/test/CMakeLists.txt
The file was addedmlir/test/mlir-rocm-runner/two-modules.mlir
The file was addedmlir/test/mlir-rocm-runner/lit.local.cfg
Commit 8948eab28a47fd0978a300270b61aa21bd4c9fb0 by simon.moll
[VE] Support logical operation instructions in MC layer

Summary:
Add regression tests of asmparser, mccodeemitter, and disassembler for
logical operation instructions. Also change asmparser to support CMOV
instruction. And, add new EQV/MRG/NND isntructions also.

Differential Revision: https://reviews.llvm.org/D81219
The file was addedllvm/test/MC/VE/BRV.s
The file was addedllvm/test/MC/VE/NND.s
The file was modifiedllvm/lib/Target/VE/AsmParser/VEAsmParser.cpp
The file was addedllvm/test/MC/VE/CMOV.s
The file was addedllvm/test/MC/VE/EQV.s
The file was addedllvm/test/MC/VE/PCNT.s
The file was addedllvm/test/MC/VE/BSWP.s
The file was modifiedllvm/lib/Target/VE/VEInstrInfo.td
The file was addedllvm/test/MC/VE/LDZ.s
The file was addedllvm/test/MC/VE/OR.s
The file was addedllvm/test/MC/VE/MRG.s
The file was addedllvm/test/MC/VE/XOR.s
The file was addedllvm/test/MC/VE/AND.s
Commit 28c2bdf18f508460401ba1d6958de87b27d52618 by hokein.wu
[AST] Record SourceLocation for TypoExpr.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D81008
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/include/clang/AST/Expr.h
The file was modifiedclang/lib/Sema/SemaLookup.cpp
The file was modifiedclang/test/AST/ast-dump-recovery.cpp
Commit 9bcef270d7a319c6c0fdffc6c80984a8f0a30ecb by sander.desmalen
Revert "[CodeGen][SVE] Calculate correct type legalization for scalable vectors."

Seems to break some buildbots, reverting the patch for now.

This reverts commit 164f4b9d26fdf3cd640a09b63b5ec44d033cbe8a.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetLowering.h
The file was modifiedllvm/include/llvm/Support/TypeSize.h
The file was modifiedllvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringBase.cpp
Commit 99d6e05e7144a2638c4e85ea75099e9dc6432cde by julian.lettner
[lit] Improve naming of test result categories

Improve consistency when printing test results:
Previously we were using different labels for group names (the header
for the list of, e.g., failing tests) and summary count lines.  For
example, "Failing Tests"/"Unexpected Failures".  This commit changes lit
to label things consistently.

Improve wording of labels:
When talking about individual test results, the first word in
"Unexpected Failures", "Expected Passes", and "Individual Timeouts" is
superfluous.  Some labels contain the word "Tests" and some don't.
Let's simplify the names.

Before:
```
Failing Tests (1):
  ...

Expected Passes    : 3
Unexpected Failures: 1
```

After:
```
Failed Tests (1):
  ...

Passed: 3
Failed: 1
```

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D77708
The file was modifiedllvm/utils/lit/tests/custom-result-category.py
The file was modifiedllvm/utils/lit/tests/parallelism-groups.py
The file was modifiedllvm/utils/lit/tests/lit-opts.py
The file was modifiedllvm/utils/lit/tests/googletest-timeout.py
The file was modifiedllvm/utils/lit/tests/googletest-upstream-format.py
The file was modifiedllvm/utils/lit/tests/shtest-not.py
The file was modifiedllvm/utils/lit/tests/shtest-inject.py
The file was modifiedllvm/utils/lit/tests/googletest-discovery-failed.py
The file was modifiedllvm/utils/lit/tests/googletest-format.py
The file was modifiedllvm/utils/lit/tests/max-time.py
The file was modifiedllvm/utils/lit/tests/max-failures.py
The file was modifiedllvm/utils/lit/tests/shtest-shell.py
The file was modifiedllvm/utils/lit/tests/shtest-timeout.py
The file was modifiedmlir/test/Examples/standalone/test.toy
The file was modifiedllvm/utils/lit/tests/shtest-format.py
The file was modifiedllvm/utils/lit/tests/allow-retries.py
The file was modifiedllvm/utils/lit/tests/shtest-env.py
The file was modifiedllvm/utils/lit/tests/selecting.py
The file was modifiedclang/www/hacking.html
The file was modifiedllvm/utils/lit/lit/main.py
Commit 38c407bf00b5a9867f512e4beb3955b0cb387d94 by ntv
[mlir][SCF] Add single iteration scf.for promotion to the FuncOp level helper.

Previously only the Affine version would be folded.

Differential Revision: https://reviews.llvm.org/D81261
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
Commit fe82d3a3ae32843069349eace204593520403964 by Jonas Devlieghere
[dsymutil] Don't emit N_AST symbol entries in the Mach-O companion file

Treat N_AST symbol table entries like other debug entries and don't emit
them in the linked binary.

Differential revision: https://reviews.llvm.org/D81205
The file was modifiedllvm/test/tools/dsymutil/X86/swift-ast-x86_64.test
The file was modifiedllvm/tools/dsymutil/MachOUtils.cpp
Commit c063b4a72bb39d9ae4bd13851873ddcbc16f6804 by Zinovy Nis
Fix crash on misc-redundant-expression

Differential Revision: https://reviews.llvm.org/D80896
The file was modifiedclang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp
Commit 7bee6e30fe634624a99b43615261f4b5311e7dd1 by maskray
[ELF] Handle -u before input files

If both a.a and b.so define foo

```
ld.bfd -u foo a.a b.so  # foo is defined
ld.bfd a.a b.so -u foo  # foo is defined
ld.bfd -u foo b.so a.a  # foo is undefined (provided at runtime by b.so)
ld.bfd b.so a.a -u foo  # foo is undefined (provided at runtime by b.so)
```

In all cases we make foo undefined in the output.  I tend to think the
GNU ld behavior makes more sense.

* In their model, they have to treat -u as a fake object file with an
  undefined symbol before all input files, otherwise the first archive would not be fetched.
* Following their behavior allows us to drop a --warn-backrefs special case.

Reviewed By: psmith

Differential Revision: https://reviews.llvm.org/D81052
The file was modifiedlld/test/ELF/undefined-opt.s
The file was modifiedlld/ELF/Driver.cpp
Commit 4d8c00c0595b6998e41373afadaaca3f51ae2cf8 by psteinfeld
[flang] Fix crash on erroneous expressions

Summary:
If you create an expression with parse errors, the `parser::Expr.typedExpr`
will be empty, which causes a compiler crash.  The crash is caused by the
check in check-do-forall.cpp that scans all expresssions to see if `DO`
variables are being modified.

It turned out that the problem was that I was fetching subexpressions of type
`parser::Expr`, which are not guaranteed to have a non-null `typedExpr`.  I
fixed this by only grabbing the top-level expression from which to gather
arguments as part of the DO loop analysis.  This, in turn, exposed a problem
where I wasn't collecting all of the actual arguments in an expression.  This
was caused by the fact that I wasn't recursing through the rest of the
expression after finding an argument.  I fixed this by recursing through the
argument in the member function in `CollectActualArgumentsHelper`.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81101
The file was modifiedflang/lib/Semantics/check-do-forall.h
The file was modifiedflang/lib/Semantics/check-do-forall.cpp
The file was modifiedflang/test/Semantics/resolve91.f90
Commit 45f58bf469a77244d064ce13f9a81ecd16dc462a by aktoon
Fix the roundtrip test under llvm-profdata

Summary:
According to the comments, we want to convert the profile into two binary formats, and then into the md5text format.
We seems to have ignored the intermediate files.
This patch uses them to complete the full roundtrips.

Reviewers: wmi, wenlei

Reviewed By: wmi

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81202
The file was modifiedllvm/test/tools/llvm-profdata/roundtrip.test
Commit d194ff31cf76e888116bc25781825edc26855a1c by llvm-dev
[X86][SSE] Simplify MOVMSK patterns based on comparison

An initial patch adding combineSetCCMOVMSK to simplify MOVMSK and its vector input based on the comparison of the MOVMSK result.

This first stage just adds support for some simple MOVMSK(PACKSSBW()) cases where we remove the PACKSS if we're comparing ne/eq zero (any_of patterns), allowing us to directly compare against the v8i16 source vector(s) bitcasted to v16i8, with suitable masking to take into account of which signbits are valid.

Future combines could peek through further PACKSS, target shuffles, handle all_of patterns (ne/eq -1), optimize to a PTEST op, etc.

Differential Revision: https://reviews.llvm.org/D81171
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-or-bool.ll
The file was modifiedllvm/test/CodeGen/X86/vector-compare-any_of.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/movmsk-cmp.ll
Commit f59311e31dec9d439819d38353ac9fb098f9547b by aeubanks
Mark lambda in use-after-scope-capture.cpp as noinline

Summary:
As explained in https://bugs.llvm.org/show_bug.cgi?id=46208,
symbolization on Windows after inlining and around
lambdas/std::functions doesn't work very well. Under the new pass
manager, there is inlining at -O1.
use-after-scope-capture.cpp checks that the symbolization points to the
line containing "return x;", but the combination of
Windows/inlining/lambdas makes the symbolization point to the line
"f = [&x]() {".

Mark the lambda as noinline since this test is not a test for
symbolization.

Reviewers: hans, dblaikie, vitalybuka

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D81193
The file was modifiedcompiler-rt/test/asan/TestCases/use-after-scope-capture.cpp
Commit 8133e289b6f697cb5d102d7f78223b64098808b5 by aeubanks
Add ASan metadata globals to @llvm.compiler.used under COFF

Summary:
This matches ELF.

This makes the number of ASan failures under the new pass manager on
Windows go from 18 to 1.

Under the old pass manager, the ASan module pass was one of the very
last things run, so these globals didn't get removed due to GlobalOpt.
But with the NPM the ASan module pass that adds these globals are run
much earlier in the pipeline and GlobalOpt ends up removing them.

Reviewers: vitalybuka, hans

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81175
The file was modifiedllvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll