[llvm] [LV] Add initial support for partial alias masking (PR #177599)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 9 03:47:11 PST 2026
================
@@ -3079,8 +3120,15 @@ bool LoopVectorizationCostModel::memoryInstructionCanBeWidened(
auto *Ptr = getLoadStorePointerOperand(I);
auto *ScalarTy = getLoadStoreType(I);
+ int Stride = Legal->isConsecutivePtr(ScalarTy, Ptr);
// In order to be widened, the pointer should be consecutive, first of all.
- if (!Legal->isConsecutivePtr(ScalarTy, Ptr))
+ if (!Stride)
+ return false;
+
+ // Currently, we can't handle alias masking in reverse. Reversing the alias
+ // mask is not correct (or necessary). When combined with tail-folding the ALM
+ // should only be reversed where the alias-mask is true.
+ if (Stride < 0 && maskPartialAliasing())
----------------
fhahn wrote:
this looks like it should be the other way around, i.e. not using `maskPartialAliasing` if there are negative strides?
https://github.com/llvm/llvm-project/pull/177599
More information about the llvm-commits
mailing list