[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:13 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,
----------------
david-arm wrote:
If we're always doing this for all targets regardless of the interleave count do we still need VPInstruction::ActiveLaneMask? Also, I think there is currently work being done by @artagnon to enable simplification of active lane masks with constant operands in the InstSimplifyFolder when detecting these recipes. That's probably fine, but any simplifications will need to now look at both recipes.
https://github.com/llvm/llvm-project/pull/209484
More information about the llvm-commits
mailing list