[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
Tue Jul 28 03:33:42 PDT 2026
================
@@ -147,29 +150,33 @@ addVPLaneMaskPhiAndUpdateExitBranch(VPlan &Plan) {
// TODO: Check if dropping the flags is needed.
TopRegion->clearCanonicalIVNUW(CanonicalIVIncrement);
DebugLoc DL = CanonicalIVIncrement->getDebugLoc();
- // We can't use StartV directly in the ActiveLaneMask VPInstruction, since
- // we have to take unrolling into account. Each part needs to start at
- // Part * VF
+ // We can't use StartV directly in the WideActiveLaneMask
+ // VPInstruction, since we have to take unrolling into account.
+ // Each part needs to start at Part * VF
auto *VecPreheader = Plan.getVectorPreheader();
VPBuilder Builder(VecPreheader);
- // Create the ActiveLaneMask instruction using the correct start values.
+ // Create the WideActiveLaneMask instruction using the correct
+ // start values.
VPValue *TC = Plan.getTripCount();
VPValue *VF = &Plan.getVF();
auto *EntryIncrement =
Builder.createOverflowingOp(VPInstruction::CanonicalIVIncrementForPart,
{StartV, VF}, {}, DL, "index.part.next");
- // Create the active lane mask instruction in the VPlan preheader.
+ // Create the wide active lane mask instruction in the VPlan preheader.
VPValue *ALMMultiplier =
Plan.getConstantInt(TopRegion->getCanonicalIVType(), 1);
- auto *EntryALM = Builder.createNaryOp(VPInstruction::ActiveLaneMask,
+ auto *EntryALM = Builder.createNaryOp(VPInstruction::WideActiveLaneMask,
{EntryIncrement, TC, ALMMultiplier}, DL,
"active.lane.mask.entry");
+ EntryALM = Builder.createNaryOp(VPInstruction::ExtractVectorForPart,
----------------
kmclaughlin-arm wrote:
I've added a test for this in `wide-alm-const.ll`
https://github.com/llvm/llvm-project/pull/209484
More information about the llvm-commits
mailing list