Skip to content

Commit 8a4077f

Browse files
committed
[LV] Pass LoopHeaderBB directly to updateDominatorTree. (NFC)
At the call site, we already know what the vector header block is. Pass it directly.
1 parent 7617445 commit 8a4077f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ void VPlan::execute(VPTransformState *State) {
10311031

10321032
// We do not attempt to preserve DT for outer loop vectorization currently.
10331033
if (!EnableVPlanNativePath)
1034-
updateDominatorTree(State->DT, VectorPreHeaderBB, VectorLatchBB,
1034+
updateDominatorTree(State->DT, VectorHeaderBB, VectorLatchBB,
10351035
L->getExitBlock());
10361036
}
10371037

@@ -1071,11 +1071,9 @@ LLVM_DUMP_METHOD
10711071
void VPlan::dump() const { print(dbgs()); }
10721072
#endif
10731073

1074-
void VPlan::updateDominatorTree(DominatorTree *DT, BasicBlock *LoopPreHeaderBB,
1074+
void VPlan::updateDominatorTree(DominatorTree *DT, BasicBlock *LoopHeaderBB,
10751075
BasicBlock *LoopLatchBB,
10761076
BasicBlock *LoopExitBB) {
1077-
BasicBlock *LoopHeaderBB = LoopPreHeaderBB->getSingleSuccessor();
1078-
assert(LoopHeaderBB && "Loop preheader does not have a single successor.");
10791077
// The vector body may be more than a single basic-block by this point.
10801078
// Update the dominator tree information inside the vector body by propagating
10811079
// it from header to latch, expecting only triangular control-flow, if any.

0 commit comments

Comments
 (0)