[llvm] [LV] Factor costInterleaveGatherScatter (NFC) (PR #215857)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 03:25:10 PDT 2026


================
@@ -2369,6 +2433,13 @@ bool LoopVectorizationCostModel::isLegalMaskedLoadOrStore(
                                          getLoadStoreAddressSpace(I));
 }
 
+bool LoopVectorizationCostModel::isLegalGatherOrScatter(Instruction *I,
+                                                        ElementCount VF) const {
+  assert((isa<LoadInst, StoreInst>(I)));
+  return Config.isLegalGatherOrScatter(isa<LoadInst>(I), getLoadStoreType(I),
+                                       getLoadStoreAlignment(I), VF);
+}
+
----------------
lukel97 wrote:

This plus the `VFSelectionContext::isLegalGatherOrScatter` change could probably be split off and landed on their own, seeing as it brings the gather/scatter interface in line with isLegalMaskedLoadOrStore

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


More information about the llvm-commits mailing list