Skip to content

Commit ada2a45

Browse files
committed
[VPlan] Use VPBasicBlock to get incoming block for exit phi fixup (NFC)
Retrieve block via VPlan infrastructure as suggested as independent cleanup in D150398.
1 parent 6cdaf7e commit ada2a45

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,13 @@ void VPLiveOut::fixPhi(VPlan &Plan, VPTransformState &State) {
156156
VPValue *ExitValue = getOperand(0);
157157
if (vputils::isUniformAfterVectorization(ExitValue))
158158
Lane = VPLane::getFirstLane();
159+
VPBasicBlock *MiddleVPBB =
160+
cast<VPBasicBlock>(Plan.getVectorLoopRegion()->getSingleSuccessor());
161+
assert(MiddleVPBB->getNumSuccessors() == 0 &&
162+
"the middle block must not have any successors");
163+
BasicBlock *MiddleBB = State.CFG.VPBB2IRBB[MiddleVPBB];
159164
Phi->addIncoming(State.get(ExitValue, VPIteration(State.UF - 1, Lane)),
160-
State.Builder.GetInsertBlock());
165+
MiddleBB);
161166
}
162167

163168
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

0 commit comments

Comments
 (0)