diff options
author | Sam Tebbs <samuel.tebbs@arm.com> | 2025-09-02 15:35:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-02 15:35:15 +0100 |
commit | 569d738d4e58dea13bac9864b16eb6b6ac0afa30 (patch) | |
tree | 71acbafb0c1d5b1e0239ecba53856ef80a34eb86 /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | 0196d7ec6988c39fa08ba296d28ffb00494f2834 (diff) | |
download | llvm-569d738d4e58dea13bac9864b16eb6b6ac0afa30.zip llvm-569d738d4e58dea13bac9864b16eb6b6ac0afa30.tar.gz llvm-569d738d4e58dea13bac9864b16eb6b6ac0afa30.tar.bz2 |
[Intrinsics][AArch64] Add intrinsics for masking off aliasing vector lanes (#117007)
It can be unsafe to load a vector from an address and write a vector to
an address if those two addresses have overlapping lanes within a
vectorised loop iteration.
This PR adds intrinsics designed to create a mask with lanes disabled if
they overlap between the two pointer arguments, so that only safe lanes
are loaded, operated on and stored. The `loop.dependence.war.mask`
intrinsic represents cases where the store occurs after the load, and
the opposite for `loop.dependence.raw.mask`. The distinction between
write-after-read and read-after-write is important, since the ordering
of the read and write operations affects if the chain of those
instructions can be done safely.
Along with the two pointer parameters, the intrinsics also take an
immediate that represents the size in bytes of the vector element types.
This will be used by #100579.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 0549a94..d52d5ec 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -900,6 +900,9 @@ void TargetLoweringBase::initActions() { // Masked vector extracts default to expand. setOperationAction(ISD::VECTOR_FIND_LAST_ACTIVE, VT, Expand); + setOperationAction(ISD::LOOP_DEPENDENCE_RAW_MASK, VT, Expand); + setOperationAction(ISD::LOOP_DEPENDENCE_WAR_MASK, VT, Expand); + // FP environment operations default to expand. setOperationAction(ISD::GET_FPENV, VT, Expand); setOperationAction(ISD::SET_FPENV, VT, Expand); |