[llvm] [LoopVectorize] Generate wide active lane masks (PR #147535)

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 06:22:00 PDT 2025


================
@@ -4288,7 +4292,13 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor() {
           if (!VPI)
             continue;
           switch (VPI->getOpcode()) {
-          case VPInstruction::ActiveLaneMask:
+          case VPInstruction::ActiveLaneMask: {
+            unsigned Multiplier =
+                cast<ConstantInt>(VPI->getOperand(2)->getLiveInIRValue())
+                    ->getZExtValue();
+            C += VPI->cost(VF * Multiplier, CostCtx);
----------------
kmclaughlin-arm wrote:

It is also multiplied in `computeCost`; I have removed these changes.

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


More information about the llvm-commits mailing list