[llvm] [LV] Use isLegalMaskedLoadOrStore for interleaved accesses too (NFC) (PR #195243)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 02:26:53 PDT 2026


================
@@ -62,14 +62,10 @@ static cl::opt<bool> ForceTargetSupportsMaskedMemoryOps(
 bool VFSelectionContext::isLegalMaskedLoadOrStore(Instruction *I,
                                                   ElementCount VF) const {
   assert(isa<LoadInst>(I) || isa<StoreInst>(I));
-  auto *Ptr = getLoadStorePointerOperand(I);
   auto *Ty = getLoadStoreType(I);
   const unsigned AS = getLoadStoreAddressSpace(I);
   const Align Alignment = getLoadStoreAlignment(I);
 
-  if (!Legal->isConsecutivePtr(Ty, Ptr))
----------------
david-arm wrote:

It seems to me the only two places this function (`VFSelectionContext::isLegalMaskedLoadOrStore`) is being called are `isScalarWithPredication` and `interleavedAccessCanBeWidened`. With this PR `isScalarWithPredication` enforces consecutive pointers before calling `Config.isLegalMaskedLoadOrStore`. In `interleavedAccessCanBeWidened` the new code is no worse than the old code, i.e. it also previously called the TTI hook without checking for consecutive memory accesses. So if it's broken now, then it was also broken before I think?

https://github.com/llvm/llvm-project/pull/195243


More information about the llvm-commits mailing list