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

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 06:35:29 PDT 2025


================
@@ -614,7 +615,9 @@ Value *VPInstruction::generate(VPTransformState &State) {
                                Name);
 
     auto *Int1Ty = Type::getInt1Ty(Builder.getContext());
-    auto *PredTy = VectorType::get(Int1Ty, State.VF);
+    auto PredTy = VectorType::get(
+        Int1Ty, State.VF * cast<ConstantInt>(getOperand(2)->getLiveInIRValue())
+                               ->getZExtValue());
----------------
kmclaughlin-arm wrote:

I've included the extra operand where we calculate the cost of ActiveLaneMask, both in VPInstruction::computeCost and also in LoopVectorizationPlanner::selectVectorizationFactor. As you mentioned, at this point the multiplier is always 1 and so there were no changes to the existing cost model tests for ActiveLaneMask.

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


More information about the llvm-commits mailing list