[llvm] [SLP]Fix/improve potential masked gather loads analysis. (PR #83472)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 04:13:07 PST 2024


================
@@ -4100,14 +4100,15 @@ static LoadsState canVectorizeLoads(ArrayRef<Value *> VL, const Value *VL0,
     // increases the cost.
     Loop *L = LI.getLoopFor(cast<LoadInst>(VL0)->getParent());
     bool ProfitableGatherPointers =
-        static_cast<unsigned>(count_if(
-            PointerOps,
-            [L](Value *V) { return L && L->isLoopInvariant(V); })) <= Sz / 2 &&
+        L &&
+        count_if(PointerOps, [L](Value *V) { return L->isLoopInvariant(V); }) <=
+            Sz / 2 &&
         Sz > 2;
----------------
alexey-bataev wrote:

Yes, will do

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


More information about the llvm-commits mailing list