Skip to content

Commit 76fd69b

Browse files
committed
[VPlan] Simplify VPBuilder insert point when live outs for FORs.
Simplifies setting the insert point, addressing a TODO.
1 parent 6568062 commit 76fd69b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8747,16 +8747,7 @@ static void addLiveOutsForFirstOrderRecurrences(
87478747
}
87488748

87498749
VPBuilder ScalarPHBuilder(ScalarPHVPBB);
8750-
VPBuilder MiddleBuilder(MiddleVPBB);
8751-
// Reset insert point so new recipes are inserted before terminator and
8752-
// condition, if there is either the former or both.
8753-
// TODO: set MiddleBuilder to MiddleVPBB->getFirstNonPhi().
8754-
if (auto *Terminator = MiddleVPBB->getTerminator()) {
8755-
auto *Condition = dyn_cast<VPInstruction>(Terminator->getOperand(0));
8756-
assert((!Condition || Condition->getParent() == MiddleVPBB) &&
8757-
"Condition expected in MiddleVPBB");
8758-
MiddleBuilder.setInsertPoint(Condition ? Condition : Terminator);
8759-
}
8750+
VPBuilder MiddleBuilder(MiddleVPBB, MiddleVPBB->getFirstNonPhi());
87608751
VPValue *OneVPV = Plan.getOrAddLiveIn(
87618752
ConstantInt::get(Plan.getCanonicalIV()->getScalarType(), 1));
87628753
VPValue *TwoVPV = Plan.getOrAddLiveIn(

0 commit comments

Comments
 (0)