Skip to content

Commit

Permalink
[LV] Rename Preheader -> VecPreheader (NFC).
Browse files Browse the repository at this point in the history
Clarify variable name as suggested in D147964 to reduce diff.
  • Loading branch information
fhahn committed Apr 28, 2023
1 parent dd5a75b commit 4583d7e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8750,7 +8750,8 @@ static void addCanonicalIVRecipes(VPlan &Plan, Type *IdxTy, DebugLoc DL,
VPBasicBlock *EB = TopRegion->getExitingBasicBlock();
if (useActiveLaneMaskForControlFlow(Style)) {
// Create the active lane mask instruction in the vplan preheader.
VPBasicBlock *Preheader = Plan.getEntry()->getEntryBasicBlock();
VPBasicBlock *VecPreheader =
cast<VPBasicBlock>(Plan.getVectorLoopRegion()->getSinglePredecessor());

// We can't use StartV directly in the ActiveLaneMask VPInstruction, since
// we have to take unrolling into account. Each part needs to start at
Expand All @@ -8759,7 +8760,7 @@ static void addCanonicalIVRecipes(VPlan &Plan, Type *IdxTy, DebugLoc DL,
new VPInstruction(HasNUW ? VPInstruction::CanonicalIVIncrementForPartNUW
: VPInstruction::CanonicalIVIncrementForPart,
{StartV}, DL, "index.part.next");
Preheader->appendRecipe(CanonicalIVIncrementParts);
VecPreheader->appendRecipe(CanonicalIVIncrementParts);

// Create the ActiveLaneMask instruction using the correct start values.
VPValue *TC = Plan.getOrCreateTripCount();
Expand All @@ -8771,7 +8772,7 @@ static void addCanonicalIVRecipes(VPlan &Plan, Type *IdxTy, DebugLoc DL,
// done after the active.lane.mask intrinsic is called.
auto *TCMinusVF =
new VPInstruction(VPInstruction::CalculateTripCountMinusVF, {TC}, DL);
Preheader->appendRecipe(TCMinusVF);
VecPreheader->appendRecipe(TCMinusVF);
IncrementValue = CanonicalIVPHI;
TripCount = TCMinusVF;
} else {
Expand All @@ -8786,7 +8787,7 @@ static void addCanonicalIVRecipes(VPlan &Plan, Type *IdxTy, DebugLoc DL,
auto *EntryALM = new VPInstruction(VPInstruction::ActiveLaneMask,
{CanonicalIVIncrementParts, TC}, DL,
"active.lane.mask.entry");
Preheader->appendRecipe(EntryALM);
VecPreheader->appendRecipe(EntryALM);

// Now create the ActiveLaneMaskPhi recipe in the main loop using the
// preheader ActiveLaneMask instruction.
Expand Down

0 comments on commit 4583d7e

Please sign in to comment.