Changes

Summary

  1. [AArch64][SVE] Optimize bitcasts between unpacked half/i16 vectors. (details)
  2. [ARM] Extend more reductions during lowering (details)
  3. [AArch64][SME] Add SVE2 instructions added in SME (details)
  4. [LoopFlatten] Use Loop to identify loop induction phi. NFC (details)
  5. [clang-tidy] Add 'readability-suspicious-call-argument' check (details)
  6. [mlir][linalg] Set explicit insertion point in pad_tensor patterns. (details)
  7. [Polly][Isl] Stop generating isl::union_{set,map} from isl::space. NFC (details)
  8. [X86][SSE] Add codegen tests dot2/3 dot product of 128-bit dereferenceable float data (details)
  9. [ORC-RT] Fix signedness warning in unit test. (details)
  10. [ORC][ORC-RT] Introduce ORC-runtime based MachO-Platform. (details)
  11. [NFC] [MTE] helper for stack tagging lifetimes. (details)
  12. [Polly][Isl] Use isl::union_map::unite() instead of isl::union_map::add_map(). NFC (details)
  13. [ORC-RT] Handle missing __has_builtin operator. (details)
  14. [VE] Disable relative lookup table converter pass for VE (details)
  15. [ORC] Add missing std::move. (details)
  16. [Polly] Use isl::set::tuple_dim instead of isl::set::dim. NFC (details)
  17. [compiler-rt][GWP-ASAN] Disable 2 tests on Armv7 Linux (details)
  18. [ORC] Explicitly convert to ArrayRefs to silence errors. (details)
  19. [X86][SSE] Fix copy+paste typo in dot3_float4_as_float3 partial load test (details)
Commit 0ed0573527404ee37d9ac700c9beab642e38657b by sander.desmalen
[AArch64][SVE] Optimize bitcasts between unpacked half/i16 vectors.

The case for nxv2f32/nxv2i32 was already covered by D104573.
This patch builds on top of that by making the mechanism work for
nxv2[b]f16/nxv2i16, nxv4[b]f16/nxv4i16 as well.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D106138
The file was modifiedllvm/test/CodeGen/AArch64/sve-bitcast.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit eb1e95dbdf2b4ffe94259199d0970d072fe24959 by david.green
[ARM] Extend more reductions during lowering

This relaxes the VMLAV and VADDV reduction recognition code to handle
smaller than legal types, extending them as needed. That was already
handled for some reductions, this extends it to more types in a more
generic way. If a smaller than legal value is found it is extended to
the legal type as needed.

Differential Revision: https://reviews.llvm.org/D106051
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-add.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-addpred.ll
The file was modifiedllvm/lib/Target/ARM/ARMISelLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-mlapred.ll
Commit f91eaa7007877063b683f83c305fca750d746d83 by cullen.rhodes
[AArch64][SME] Add SVE2 instructions added in SME

This patch adds support for the following instructions:

    SCLAMP, UCLAMP, REV, DUP (predicate)

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-06

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D105577
The file was addedllvm/test/MC/AArch64/SME/revd-diagnostics.s
The file was modifiedllvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
The file was modifiedllvm/lib/Target/AArch64/SMEInstrFormats.td
The file was addedllvm/test/MC/AArch64/SME/revd.s
The file was modifiedllvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
The file was addedllvm/test/MC/AArch64/SME/uclamp.s
The file was addedllvm/test/MC/AArch64/SME/sclamp.s
The file was addedllvm/test/MC/AArch64/SME/uclamp-diagnostics.s
The file was addedllvm/test/MC/AArch64/SME/dup-diagnostics.s
The file was addedllvm/test/MC/AArch64/SME/dup.s
The file was addedllvm/test/MC/AArch64/SME/sclamp-diagnostics.s
Commit 34d6820551c6ee7e76199407b3c1ba6fecf4398f by rosie.sumpter
[LoopFlatten] Use Loop to identify loop induction phi. NFC

Replace code which identifies induction phi with helper function
getInductionVariable to improve robustness.

Differential Revision: https://reviews.llvm.org/D106045
The file was modifiedllvm/lib/Transforms/Scalar/LoopFlatten.cpp
Commit 73e4b5cfa8ea6dda3624e03beb60827db12bb3a3 by whisperity
[clang-tidy] Add 'readability-suspicious-call-argument' check

Finds function calls where the call arguments might be provided in an
incorrect order, based on the comparison (via string metrics) of the
parameter names and the argument names against each other.

A diagnostic is emitted if an argument name is similar to a *different*
parameter than the one currently passed to, and it is sufficiently
dissimilar to the one it **is** passed to currently.

False-positive warnings from this check are useful to indicate bad
naming convention issues, even if a swap isn't necessary.
This check does not generate FixIts.

Originally implemented by @varjujan as his Master's Thesis work.
The check was subsequently taken over by @barancsuk who added type
conformity checks to silence false positive matches.
The work by @whisperity involved driving the check's review and fixing
some more bugs in the process.

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D20689

Co-authored-by: János Varjú <varjujanos2@gmail.com>
Co-authored-by: Lilla Barancsuk <barancsuklilla@gmail.com>
The file was modifiedclang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
The file was addedclang-tools-extra/test/clang-tidy/checkers/readability-suspicious-call-argument.cpp
The file was modifiedclang-tools-extra/docs/ReleaseNotes.rst
The file was modifiedclang-tools-extra/docs/clang-tidy/checks/list.rst
The file was addedclang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst
The file was addedclang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.h
The file was addedclang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn
The file was modifiedclang-tools-extra/clang-tidy/readability/CMakeLists.txt
Commit 3f8f29233067faef6b2c22a6b654abf7e638f2be by gysit
[mlir][linalg] Set explicit insertion point in pad_tensor patterns.

Insert ops replacing pad_tensor in front of the associated tansfer_write / insert_slice op. Otherwise we may end up with invalid ir if one of the remaining tansfer_write / insert_slice operands is defined after the pad_tensor op.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D106162
The file was modifiedmlir/test/Dialect/Linalg/vectorization.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
Commit bad3ebbaae3d5a99c1608f38b1ca597433b89e7c by patacca
[Polly][Isl] Stop generating isl::union_{set,map} from isl::space. NFC

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
- Stop generating `isl::union_set` and isl::union_map` from `isl::space` and instead generate them from `isl::ctx`
- Disable clang-format on `isl-noexceptions.h`
- Removed `isl::union_{set,map}` generator from `isl::space` from `isl-noexceptions.h`
- `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/87c3413b6f1d62ca3dddf716352f90a0b8533353

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D106059
The file was modifiedpolly/lib/Analysis/DependenceInfo.cpp
The file was modifiedpolly/lib/Support/ISLTools.cpp
The file was modifiedpolly/lib/External/isl/include/isl/isl-noexceptions.h
The file was modifiedpolly/unittests/DeLICM/DeLICMTest.cpp
The file was modifiedpolly/lib/CodeGen/PPCGCodeGeneration.cpp
The file was modifiedpolly/lib/Transform/Simplify.cpp
The file was modifiedpolly/lib/Analysis/ScopInfo.cpp
The file was modifiedpolly/lib/Transform/ScheduleTreeTransform.cpp
The file was modifiedpolly/lib/Transform/MaximalStaticExpansion.cpp
The file was modifiedpolly/lib/Transform/DeLICM.cpp
The file was modifiedpolly/lib/Transform/ZoneAlgo.cpp
The file was modifiedpolly/lib/Exchange/JSONExporter.cpp
The file was modifiedpolly/lib/Transform/FlattenAlgo.cpp
The file was modifiedpolly/lib/Analysis/ScopBuilder.cpp
Commit fe494fafa9025ac6e9671be300035a27d70ae469 by llvm-dev
[X86][SSE] Add codegen tests dot2/3 dot product of 128-bit dereferenceable float data

Based off the codegen reports on PR51075 - hopefully we can handle some of this in SLP or VectorCombine, but we usually have to leave load combining until the backend so at least some of these patterns will still appear even then.
The file was addedllvm/test/CodeGen/X86/load-partial-dot-product.ll
Commit ac5ce40fa80d1ca0c25db23375b60cfbc39f5c7f by Lang Hames
[ORC-RT] Fix signedness warning in unit test.
The file was modifiedcompiler-rt/lib/orc/unittests/adt_test.cpp
Commit bb5f97e3ad10a0f8a62560890e5a87b4bc2c00bd by Lang Hames
[ORC][ORC-RT] Introduce ORC-runtime based MachO-Platform.

Adds support for MachO static initializers/deinitializers and eh-frame
registration via the ORC runtime.

This commit introduces cooperative support code into the ORC runtime and ORC
LLVM libraries (especially the MachOPlatform class) to support macho runtime
features for JIT'd code. This commit introduces support for static
initializers, static destructors (via cxa_atexit interposition), and eh-frame
registration. Near-future commits will add support for MachO native
thread-local variables, and language runtime registration (e.g. for Objective-C
and Swift).

The llvm-jitlink tool is updated to use the ORC runtime where available, and
regression tests for the new MachOPlatform support are added to compiler-rt.

Notable changes on the ORC runtime side:

1. The new macho_platform.h / macho_platform.cpp files contain the bulk of the
runtime-side support. This includes eh-frame registration; jit versions of
dlopen, dlsym, and dlclose; a cxa_atexit interpose to record static destructors,
and an '__orc_rt_macho_run_program' function that defines running a JIT'd MachO
program in terms of the jit- dlopen/dlsym/dlclose functions.

2. Replaces JITTargetAddress (and casting operations) with ExecutorAddress
(copied from LLVM) to improve type-safety of address management.

3. Adds serialization support for ExecutorAddress and unordered_map types to
the runtime-side Simple Packed Serialization code.

4. Adds orc-runtime regression tests to ensure that static initializers and
cxa-atexit interposes work as expected.

Notable changes on the LLVM side:

1. The MachOPlatform class is updated to:

  1.1. Load the ORC runtime into the ExecutionSession.
  1.2. Set up standard aliases for macho-specific runtime functions. E.g.
       ___cxa_atexit -> ___orc_rt_macho_cxa_atexit.
  1.3. Install the MachOPlatformPlugin to scrape LinkGraphs for information
       needed to support MachO features (e.g. eh-frames, mod-inits), and
       communicate this information to the runtime.
  1.4. Provide entry-points that the runtime can call to request initializers,
       perform symbol lookup, and request deinitialiers (the latter is
       implemented as an empty placeholder as macho object deinits are rarely
       used).
  1.5. Create a MachO header object for each JITDylib (defining the __mh_header
       and __dso_handle symbols).

2. The llvm-jitlink tool (and llvm-jitlink-executor) are updated to use the
runtime when available.

3. A `lookupInitSymbolsAsync` method is added to the Platform base class. This
can be used to issue an async lookup for initializer symbols. The existing
`lookupInitSymbols` method is retained (the GenericIRPlatform code is still
using it), but is deprecated and will be removed soon.

4. JIT-dispatch support code is added to ExecutorProcessControl.

The JIT-dispatch system allows handlers in the JIT process to be associated with
'tag' symbols in the executor, and allows the executor to make remote procedure
calls back to the JIT process (via __orc_rt_jit_dispatch) using those tags.

The primary use case is ORC runtime code that needs to call bakc to handlers in
orc::Platform subclasses. E.g. __orc_rt_macho_jit_dlopen calling back to
MachOPlatform::rt_getInitializers using __orc_rt_macho_get_initializers_tag.
(The system is generic however, and could be used by non-runtime code).

The new ExecutorProcessControl::JITDispatchInfo struct provides the address
(in the executor) of the jit-dispatch function and a jit-dispatch context
object, and implementations of the dispatch function are added to
SelfExecutorProcessControl and OrcRPCExecutorProcessControl.

5. OrcRPCTPCServer is updated to support JIT-dispatch calls over ORC-RPC.

6. Serialization support for StringMap is added to the LLVM-side Simple Packed
Serialization code.

7. A JITLink::allocateBuffer operation is introduced to allocate writable memory
attached to the graph. This is used by the MachO header synthesis code, and will
be generically useful for other clients who want to create new graph content
from scratch.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/TargetProcess/OrcRPCTPCServer.h
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.h
The file was addedcompiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-cxa-atexit.S
The file was addedcompiler-rt/lib/orc/executor_address.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Core.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ExecutorProcessControl.h
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
The file was modifiedllvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
The file was addedcompiler-rt/lib/orc/log_error_to_stderr.cpp
The file was removedcompiler-rt/test/orc/TestCases/Darwin/x86-64/placeholder_test.S
The file was modifiedllvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp
The file was modifiedcompiler-rt/lib/orc/simple_packed_serialization.h
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink-executor/llvm-jitlink-executor.cpp
The file was addedcompiler-rt/lib/orc/macho_platform.cpp
The file was modifiedcompiler-rt/lib/orc/wrapper_function_utils.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/WrapperFunctionUtils.h
The file was modifiedcompiler-rt/lib/orc/CMakeLists.txt
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h
The file was modifiedllvm/unittests/ExecutionEngine/Orc/SimplePackedSerializationTest.cpp
The file was addedcompiler-rt/lib/orc/run_program_wrapper.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/OrcRPCExecutorProcessControl.h
The file was modifiedcompiler-rt/lib/orc/common.h
The file was modifiedllvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
The file was addedcompiler-rt/test/orc/TestCases/Darwin/x86-64/trivial-static-initializer.S
The file was addedllvm/include/llvm/ExecutionEngine/Orc/LLVMSPSSerializers.h
The file was addedcompiler-rt/lib/orc/macho_platform.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/Core.cpp
Commit d23f26f0af5a184185fe39ed8d5f89ba7cac54e6 by fmayer
[NFC] [MTE] helper for stack tagging lifetimes.

Reviewed By: eugenis, vitalybuka

Differential Revision: https://reviews.llvm.org/D106135
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/AddressSanitizerCommon.h
The file was modifiedllvm/lib/Target/AArch64/AArch64StackTagging.cpp
Commit d5ee355f89605f0475a18b60fd27837d73dd7852 by patacca
[Polly][Isl] Use isl::union_map::unite() instead of isl::union_map::add_map(). NFC

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
- Use `isl::union_map::unite()` instead of `isl::union_map::add_map()`
- `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/3f43ae29fa2a22936a583b85b2fe8d439f805d8d

Depends on D106059

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D106061
The file was modifiedpolly/lib/Support/ISLTools.cpp
The file was modifiedpolly/lib/Transform/Simplify.cpp
The file was modifiedpolly/unittests/DeLICM/DeLICMTest.cpp
The file was modifiedpolly/lib/Transform/FlattenAlgo.cpp
The file was modifiedpolly/lib/Transform/ScheduleTreeTransform.cpp
The file was modifiedpolly/lib/Analysis/DependenceInfo.cpp
The file was modifiedpolly/lib/Analysis/ScopInfo.cpp
The file was modifiedpolly/lib/Transform/ForwardOpTree.cpp
The file was modifiedpolly/lib/Analysis/ScopBuilder.cpp
The file was modifiedpolly/lib/Exchange/JSONExporter.cpp
The file was modifiedpolly/lib/Transform/MaximalStaticExpansion.cpp
The file was modifiedpolly/lib/Transform/ZoneAlgo.cpp
The file was modifiedpolly/lib/External/isl/include/isl/isl-noexceptions.h
Commit eaa329e76e72da518a1b185a804f6bb5d41b7ff4 by Lang Hames
[ORC-RT] Handle missing __has_builtin operator.

For compilers that do not support __has_builtin just return '0'. This should fix
the bot failure at https://lab.llvm.org/buildbot/#/builders/165/builds/3761.
The file was modifiedcompiler-rt/lib/orc/compiler.h
Commit b28e5b791064dac5e222817c06aeec032b4af878 by marukawa
[VE] Disable relative lookup table converter pass for VE

VE's linker, /opt/nec/ve/bin/nld, doesn't implement relative lookup table.
The relative lookup table is introduced by https://reviews.llvm.org/D94355,
but we need to disable it at the moment.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D106224
The file was modifiedllvm/lib/Target/VE/VETargetTransformInfo.h
Commit 249510a004c84f3af7c084ef4bfbed6f6a584127 by Lang Hames
[ORC] Add missing std::move.

This should fix the build failure at
https://lab.llvm.org/buildbot/#/builders/58/builds/11428.
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
Commit 159e072f812317c26d480d79408b6606b010d800 by patacca
[Polly] Use isl::set::tuple_dim instead of isl::set::dim. NFC

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Note that not all the usages of `isl::set::dim` were replaced
The file was modifiedpolly/lib/Analysis/DependenceInfo.cpp
Commit 3d5c1a81738147104a2146e2457dc2f4cc8f3e05 by david.spickett
[compiler-rt][GWP-ASAN] Disable 2 tests on Armv7 Linux

These have been failing on our bots for a while due to
incomplete backtraces. (you don't get the names of the
functions that did the access, just the reporter frames)

See:
https://lab.llvm.org/buildbot/#/builders/170/builds/180
The file was modifiedcompiler-rt/test/gwp_asan/backtrace.c
The file was modifiedcompiler-rt/lib/gwp_asan/tests/backtrace.cpp
Commit df4777060010ead66bd626fbc6ddbadbb2ce4b18 by Lang Hames
[ORC] Explicitly convert to ArrayRefs to silence errors.

This aims to fix build failures like
https://lab.llvm.org/buildbot#builders/165/builds/3761.
The file was modifiedllvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
Commit 754b1cd71347b2c7f95ce189b7ad52bb233b2ee8 by llvm-dev
[X86][SSE] Fix copy+paste typo in dot3_float4_as_float3 partial load test
The file was modifiedllvm/test/CodeGen/X86/load-partial-dot-product.ll