[llvm] [LV] Use wide lane masks as the canonical form when tail-folding & interleaving (PR #209484)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 03:18:14 PDT 2026


================
@@ -785,20 +788,21 @@ Value *VPInstruction::generate(VPTransformState &State) {
     return Builder.CreateSelectFMF(Cond, Op1, Op2, getFastMathFlagsOrNone(),
                                    Name);
   }
-  case VPInstruction::ActiveLaneMask: {
+  case VPInstruction::ActiveLaneMask:
+  case VPInstruction::ActiveLaneMaskForControlFlow: {
     // Get first lane of vector induction variable.
     Value *VIVElem0 = State.get(getOperand(0), VPLane(0));
     // Get the original loop tripcount.
     Value *ScalarTC = State.get(getOperand(1), VPLane(0));
 
     // If this part of the active lane mask is scalar, generate the CMP directly
     // to avoid unnecessary extracts.
-    if (State.VF.isScalar())
+    unsigned Multiplier = cast<VPConstantInt>(getOperand(2))->getZExtValue();
----------------
david-arm wrote:

It might be better to simply remove `Multiplier` from `ActiveLaneMask` as part of this PR just in case it highlights any problems?

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


More information about the llvm-commits mailing list