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

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 03:01:15 PDT 2026


================
@@ -182,9 +189,12 @@ addVPLaneMaskPhiAndUpdateExitBranch(VPlan &Plan) {
   auto *InLoopIncrement = Builder.createOverflowingOp(
       VPInstruction::CanonicalIVIncrementForPart,
       {CanonicalIVIncrement, &Plan.getVF()}, {}, DL);
-  auto *ALM = Builder.createNaryOp(VPInstruction::ActiveLaneMask,
+  auto *ALM = Builder.createNaryOp(VPInstruction::WideActiveLaneMask,
                                    {InLoopIncrement, TC, ALMMultiplier}, DL,
                                    "active.lane.mask.next");
+  ALM = Builder.createNaryOp(VPInstruction::ExtractVectorForPart,
----------------
kmclaughlin-arm wrote:

There's no requirement for this to persist in vplan, although later optimisations which are looking for the pattern of a single wide lane mask plus extracts would be affected. I don't think replacing an extract in this way would be valid however, when the wide lane mask has multiple uses because we are interleaving?
I can add a comment if you think it's worth making this clear though.

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


More information about the llvm-commits mailing list