SuccessChanges

Summary

  1. [clang-tidy] Fix a crash for raw-string-literal check. (details)
  2. [mlir][Python][linalg] Fix to limit size of SmallVector. (details)
  3. [AArch64] Combine vector shift instructions in SelectionDAG (details)
  4. Force visibility of llvm::Any to external (details)
  5. [CostModel][AArch64] Add missing costs for getShuffleCost with scalable vectors (details)
  6. [WebAssembly] Ignore filters in Emscripten EH landingpads (details)
  7. [mlir] Add Python bindings for vector dialect (details)
  8. [mlir][Linalg] Drop spurious usage of OperationFolder (details)
  9. [CodeGen] Add support for widening INSERT_SUBVECTOR operands (details)
  10. [RISCV] Add legality check for vectorizing reduction (details)
  11. [X86][AVX] Don't scrub pointer math in avx-vperm2x128.ll (details)
  12. libsanitizer: Guard cyclades inclusion in sanitizer (details)
  13. [NFC][SimplifyCFG] Autogenerate checklines in a few tests for ease of updates (details)
  14. [NFC][PruneEH] Autogenerate checklines in a few tests for ease of updates (details)
  15. [NFC][CHR] Autogenerate checklines in a few tests for ease of updates (details)
  16. [llvm-objcopy] Refactor CopyConfig structure. (details)
  17. [gn build] Port 081c62501e4f (details)
  18. [AArch64] Add extra codegen tests. NFC (details)
  19. [llvm-strip] Add support for '--' for delimiting options from input files (details)
  20. [NFC][Coroutines] Autogenerate a few tests for ease of further updates (details)
  21. Reapply "[clang][deps] Support inferred modules" (details)
Commit 775ca3a89cba104d7c0dc762a0c5c5624c1d397c by hokein.wu
[clang-tidy] Fix a crash for raw-string-literal check.

getSourceText could return an empty string for error cases (e.g. invalid
source locaiton), this patch makes the code more robust.

The crash did happen in our internal codebase, but unfortunately I
didn't manage to get a reproduce case. One thing I can confirm from
the core dump is that the crash is caused by calling isRawStringLiteral
on an empty Text.

Differential Revision: https://reviews.llvm.org/D102770
The file was modifiedclang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
Commit 99a198641cbb196a1bdfd444ae64c0ab8d4d4c55 by gysit
[mlir][Python][linalg] Fix to limit size of SmallVector.

Stack allocate at most two ScalarAssign elements. Using the default number of inlined elements triggered a static assert in some setups (https://reviews.llvm.org/D102075).

Differential Revision: https://reviews.llvm.org/D102827
The file was modifiedmlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
Commit a647100b4320923b0e9d156cc3872b3be470ad98 by andrew.savonichev
[AArch64] Combine vector shift instructions in SelectionDAG

bswap.v2i16 + sitofp in LLVM IR generate a sequence of:

  - REV32 + USHR for bswap.v2i16
  - SHL + SSHR + SCVTF for sext to v2i32 and scvt

The shift instructions are excessive as noted in PR24820, and they can
be optimized to just SSHR.

Differential Revision: https://reviews.llvm.org/D102333
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.h
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was addedllvm/test/CodeGen/AArch64/aarch64-bswap-ext.ll
Commit 3d3abc22b3ef189813a3b9061c2a90ba86a32f44 by sguelton
Force visibility of llvm::Any to external

llvm::Any::TypeId::Id relies on the uniqueness of the address of a static
variable defined in a template function. hidden visibility implies vague linkage
for that variable, which does not guarantee the uniqueness of the address across
a binary and a shared library. This totally breaks the implementation of
llvm::Any.

Ideally, setting visibility to llvm::Any::TypeId::Id should be enough,
unfortunately this doesn't work as expected and we lack time (before 12.0.1
release) to understand why setting the visibility to llvm::Any does work.

See https://gcc.gnu.org/wiki/Visibility and
https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html
for more information on that topic.

Differential Revision: https://reviews.llvm.org/D101972
The file was modifiedllvm/include/llvm/ADT/Any.h
Commit 9199b6535df17c719c980beb3883c956f9d5f809 by caroline.concatto
[CostModel][AArch64] Add missing costs for getShuffleCost with scalable vectors

Differential Revision: https://reviews.llvm.org/D102490
The file was modifiedllvm/test/Analysis/CostModel/AArch64/sve-shuffle-broadcast.ll
The file was modifiedllvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
Commit 412a3381f721452fb6cd33bc30e7700102639e3f by aheejin
[WebAssembly] Ignore filters in Emscripten EH landingpads

We have been handling filters and landingpads incorrectly all along. We
pass clauses' (catches') types to `__cxa_find_matching_catch` in JS glue
code, which returns the thrown pointer and sets the selector using
`setTempRet0()`.

We apparently have been doing the same for filters' (exception specs')
types; we pass them to `__cxa_find_matching_catch` just the same way as
clauses. And `__cxa_find_matching_catch` treats all given types as
clauses. So it is a little surprising; maybe we intended to do something
from the JS side and didn't end up doing?

So anyway, I don't think supporting exception specs in Emscripten EH is
a priority, but this can actually cause incorrect results for normal
catches when functions are inlined and the inlined spec type has a
parent-child relationship with the catch's type.

---

The below is an example of a bug that can happen when inlining and class
hierarchy is mixed. If you are busy you can skip this part:
```
struct A {};
struct B : A {};

void bar() throw (B) { throw B(); }

void foo() {
  try {
    bar();
  } catch (A &) {
    fputs ("Expected result\n", stdout);
  }
}
```

In the unoptimized code, `bar`'s landingpad will have a filter for `B`
and `foo`'s landingpad will have a clause for `A`. But when `bar` is
inlined into `foo`, `foo`'s landingpad has both a filter for `B` and a
clause for `A`, and it passes the both types to
`__cxa_find_matching_catch`:
```
__cxa_find_matching_catch(typeinfo for B, typeinfo for A)
```
`__cxa_find_matching_catch` thinks both are clauses, and looks at the
first type `B`, which belongs to a filter. And the thrown type is `B`,
so it thinks the first type `B` is caught. But this makes it return an
incorrect selector, because it is supposed to catch the exception using
the second type `A`, which is a parent of `B`. As a result, the `foo` in
the example program above does not print "Expected result" but just
throws the exception to the caller. (This wouldn't have happened if `A`
and `B` are completely disjoint types, such as `float` and `int`)

Fixes https://bugs.llvm.org/show_bug.cgi?id=50357.

Reviewed By: dschuff, kripken

Differential Revision: https://reviews.llvm.org/D102795
The file was modifiedllvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
Commit 4cd1b66dffb06695b4eaf725df8c402347e39bf0 by springerm
[mlir] Add Python bindings for vector dialect

Also add a minimal test case for vector.print.

Differential Revision: https://reviews.llvm.org/D102826
The file was modifiedmlir/python/mlir/dialects/CMakeLists.txt
The file was addedmlir/python/mlir/dialects/vector.py
The file was addedmlir/test/python/dialects/vector.py
The file was addedmlir/python/mlir/dialects/VectorOps.td
Commit ef33c6e3ceb01ee573b70f63bf12c2dcdf84f26a by nicolas.vasilache
[mlir][Linalg] Drop spurious usage of OperationFolder

Instead, use createOrFold builders which result in more static information available.

Differential Revision: https://reviews.llvm.org/D102832
The file was modifiedmlir/include/mlir/Dialect/Linalg/Utils/Utils.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h
The file was modifiedmlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
The file was modifiedmlir/test/Dialect/Linalg/transform-patterns.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
Commit d07d5c1b061bf7139e32b954d64259b7fe829953 by david.sherwood
[CodeGen] Add support for widening INSERT_SUBVECTOR operands

When attempting to return something like a <vscale x 1 x i32>
type from a function we end up trying to widen the vector by
inserting a <vscale x 1 x i32> subvector into an undefined
<vscale x 4 x i32> vector. However, during legalisation we
then attempt to widen the INSERT_SUBVECTOR operands and hit
an error in WidenVectorOperand.

This patch adds a new WidenVecOp_INSERT_SUBVECTOR function
that currently only supports inserting subvectors into undefined
vectors.

Differential Revision: https://reviews.llvm.org/D102501
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-insert-vector.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-vector-splat.ll
Commit 1595994b2825a396f650dd8dab8c72a3d71cbc8e by luke957
[RISCV] Add legality check for vectorizing reduction

Check if it is legal to vectorize reduction.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D99509
The file was addedllvm/test/Transforms/LoopVectorize/RISCV/scalable-reductions.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
Commit 10e88972ee2be2cbb6967ec6dadebd38dcf3f022 by llvm-dev
[X86][AVX] Don't scrub pointer math in avx-vperm2x128.ll

This will make it easier to track address offsets in folded loads/broadcasts of subvectors
The file was modifiedllvm/test/CodeGen/X86/avx-vperm2x128.ll
Commit f7c5351552387bd43f6ca3631016d7f0dfe0f135 by tamar.christina
libsanitizer: Guard cyclades inclusion in sanitizer

The Linux kernel has removed the interface to cyclades from
the latest kernel headers[1] due to them being orphaned for the
past 13 years.

libsanitizer uses this header when compiling against glibc, but
glibcs itself doesn't seem to have any references to cyclades.

Further more it seems that the driver is broken in the kernel and
the firmware doesn't seem to be available anymore.

As such since this is breaking the build of libsanitizer (and so the
GCC bootstrap[2]) I propose to remove this.

[1] https://lkml.org/lkml/2021/3/2/153
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D102059
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Commit 8294e94ad3e0d580f4aafc2534b53feb50da066e by lebedev.ri
[NFC][SimplifyCFG] Autogenerate checklines in a few tests for ease of updates
The file was modifiedllvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest-two-preds-cost.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/unprofitable-pr.ll
Commit 7e3d0a5d0f375307e681a79606baa1008b40f6a4 by lebedev.ri
[NFC][PruneEH] Autogenerate checklines in a few tests for ease of updates
The file was modifiedllvm/test/Transforms/PruneEH/ipo-nounwind.ll
Commit eeeeff0d7bbb0b881213be24c0e33de6b755fe64 by lebedev.ri
[NFC][CHR] Autogenerate checklines in a few tests for ease of updates
The file was modifiedllvm/test/Transforms/PGOProfile/chr.ll
Commit 081c62501e4f0aad4ab31de52f871f98403073ad by a.v.lapshin
[llvm-objcopy] Refactor CopyConfig structure.

This patch prepares llvm-objcopy to move its implementation
into a separate library. To make it possible it is necessary
to minimize internal dependencies.

Differential Revision: https://reviews.llvm.org/D99055
The file was modifiedllvm/tools/llvm-objcopy/llvm-objcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/CMakeLists.txt
The file was modifiedllvm/tools/llvm-objcopy/ELF/ELFObjcopy.h
The file was addedllvm/tools/llvm-objcopy/ConfigManager.cpp
The file was modifiedllvm/tools/llvm-objcopy/llvm-objcopy.h
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/wasm/WasmObjcopy.cpp
The file was removedllvm/tools/llvm-objcopy/CopyConfig.cpp
The file was removedllvm/tools/llvm-objcopy/CopyConfig.h
The file was removedllvm/tools/llvm-objcopy/ELF/ELFConfig.cpp
The file was addedllvm/tools/llvm-objcopy/MachO/MachOConfig.h
The file was modifiedllvm/tools/llvm-objcopy/ELF/ELFConfig.h
The file was modifiedllvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.h
The file was addedllvm/tools/llvm-objcopy/MultiFormatConfig.h
The file was modifiedllvm/tools/llvm-objcopy/wasm/WasmObjcopy.h
The file was modifiedllvm/tools/llvm-objcopy/COFF/COFFObjcopy.h
The file was addedllvm/tools/llvm-objcopy/COFF/COFFConfig.h
The file was addedllvm/tools/llvm-objcopy/wasm/WasmConfig.h
The file was addedllvm/tools/llvm-objcopy/CommonConfig.h
The file was addedllvm/tools/llvm-objcopy/ConfigManager.h
The file was modifiedllvm/tools/llvm-objcopy/MachO/MachOObjcopy.h
Commit 2d8cb8205ab77dd5f1396ed46c62d4799f5a46b9 by llvmgnsyncbot
[gn build] Port 081c62501e4f
The file was modifiedllvm/utils/gn/secondary/llvm/tools/llvm-objcopy/BUILD.gn
Commit 0f88328867f4a309a558d1064e2cbb936e240629 by david.green
[AArch64] Add extra codegen tests. NFC

This adds some extra codegen tests for abs and hadd, regenerating some
of the existing tests with updated check lines.
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vabs.ll
The file was modifiedllvm/test/CodeGen/AArch64/neg-abs.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vhadd.ll
Commit 1fb5278882e4abf7172b9f6d66404c8febe38ea6 by serguei.n.dmitriev
[llvm-strip] Add support for '--' for delimiting options from input files

This will allow to use llvm-strip with file names that begin with dashes.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D102825
The file was modifiedllvm/test/tools/llvm-objcopy/dash-dash.test
The file was modifiedllvm/test/tools/llvm-objcopy/tool-help-message.test
The file was modifiedllvm/tools/llvm-objcopy/ConfigManager.cpp
Commit 4a35c51c655852d03de6da6ccf743d40a935b293 by lebedev.ri
[NFC][Coroutines] Autogenerate a few tests for ease of further updates
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon-once-value.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-swifterror.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon-alloca.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon-value.ll
The file was modifiedllvm/test/Transforms/Coroutines/coro-retcon-resume-values.ll
Commit 7defab082070adf3d04b326ba160b029394edc7c by Jan Svoboda
Reapply "[clang][deps] Support inferred modules"

This reverts commit 76b8754d and ensures the PCM files are created in the correct directory (not in the current working directory).
The file was addedclang/test/ClangScanDeps/Inputs/frameworks/Inferred.framework/Frameworks/Sub.framework/Headers/Sub.h
The file was addedclang/test/ClangScanDeps/Inputs/frameworks/Inferred.framework/Headers/Inferred.h
The file was modifiedclang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
The file was modifiedclang/test/ClangScanDeps/modules-full.cpp
The file was addedclang/utils/module-deps-to-rsp.py
The file was addedclang/test/ClangScanDeps/Inputs/frameworks/System.framework/Headers/System.h
The file was addedclang/test/ClangScanDeps/modules-inferred-explicit-build.m
The file was addedclang/test/ClangScanDeps/modules-inferred.m
The file was addedclang/test/ClangScanDeps/Inputs/frameworks/System.framework/Modules/module.modulemap
The file was addedclang/test/ClangScanDeps/Inputs/modules_inferred_cdb.json
The file was addedclang/test/ClangScanDeps/Inputs/frameworks/module.modulemap