[llvm] [SLP]Improve masked loads vectorization, attempting gathered loads (PR #110151)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 09:23:41 PDT 2024


================
@@ -5118,10 +5125,10 @@ BoUpSLP::canVectorizeLoads(ArrayRef<Value *> VL, const Value *VL0,
       L && Sz > 2 && static_cast<unsigned>(count_if(PointerOps, [L](Value *V) {
                        return L->isLoopInvariant(V);
                      })) <= Sz / 2;
-  if (ProfitableGatherPointers || all_of(PointerOps, [IsSorted](Value *P) {
+  if (ProfitableGatherPointers || all_of(PointerOps, [](Value *P) {
         auto *GEP = dyn_cast<GetElementPtrInst>(P);
-        return (IsSorted && !GEP && doesNotNeedToBeScheduled(P)) ||
-               (GEP && GEP->getNumOperands() == 2 &&
+        return (!GEP && doesNotNeedToBeScheduled(P)) ||
+               (GEP->getNumOperands() == 2 &&
----------------
alexey-bataev wrote:

Added a check

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


More information about the llvm-commits mailing list