Skip to content

Commit 449e2f5

Browse files
committed
[LV] Remove more DT updates from legacy code path (NFCI).
Remove some legacy DT updates. Those should already be handled when updating the DT during VPlan execution.
1 parent 0defd83 commit 449e2f5

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

+5-21
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,6 @@ class GeneratedRTChecks {
20882088
Pred->getTerminator()->replaceSuccessorWith(LoopVectorPreHeader,
20892089
SCEVCheckBlock);
20902090

2091-
DT->addNewBlock(SCEVCheckBlock, Pred);
2092-
DT->changeImmediateDominator(LoopVectorPreHeader, SCEVCheckBlock);
2093-
20942091
BranchInst &BI =
20952092
*BranchInst::Create(Bypass, LoopVectorPreHeader, SCEVCheckCond);
20962093
if (AddBranchWeights)
@@ -2115,8 +2112,6 @@ class GeneratedRTChecks {
21152112
Pred->getTerminator()->replaceSuccessorWith(LoopVectorPreHeader,
21162113
MemCheckBlock);
21172114

2118-
DT->addNewBlock(MemCheckBlock, Pred);
2119-
DT->changeImmediateDominator(LoopVectorPreHeader, MemCheckBlock);
21202115
MemCheckBlock->moveBefore(LoopVectorPreHeader);
21212116

21222117
BranchInst &BI =
@@ -2556,13 +2551,9 @@ void InnerLoopVectorizer::emitIterationCountCheck(BasicBlock *Bypass) {
25562551
}
25572552

25582553
// Create new preheader for vector loop.
2559-
LoopVectorPreHeader =
2560-
SplitBlock(TCCheckBlock, TCCheckBlock->getTerminator(), DT, LI, nullptr,
2561-
"vector.ph");
2562-
2563-
assert(DT->properlyDominates(DT->getNode(TCCheckBlock),
2564-
DT->getNode(Bypass)->getIDom()) &&
2565-
"TC check is expected to dominate Bypass");
2554+
LoopVectorPreHeader = SplitBlock(TCCheckBlock, TCCheckBlock->getTerminator(),
2555+
static_cast<DominatorTree *>(nullptr), LI,
2556+
nullptr, "vector.ph");
25662557

25672558
BranchInst &BI =
25682559
*BranchInst::Create(Bypass, LoopVectorPreHeader, CheckMinIters);
@@ -7957,13 +7948,10 @@ EpilogueVectorizerMainLoop::emitIterationCountCheck(BasicBlock *Bypass,
79577948

79587949
// Create new preheader for vector loop.
79597950
LoopVectorPreHeader = SplitBlock(TCCheckBlock, TCCheckBlock->getTerminator(),
7960-
DT, LI, nullptr, "vector.ph");
7951+
static_cast<DominatorTree *>(nullptr), LI,
7952+
nullptr, "vector.ph");
79617953

79627954
if (ForEpilogue) {
7963-
assert(DT->properlyDominates(DT->getNode(TCCheckBlock),
7964-
DT->getNode(Bypass)->getIDom()) &&
7965-
"TC check is expected to dominate Bypass");
7966-
79677955
LoopBypassBlocks.push_back(TCCheckBlock);
79687956

79697957
// Save the trip count so we don't have to regenerate it in the
@@ -8067,10 +8055,6 @@ EpilogueVectorizerEpilogueLoop::emitMinimumVectorEpilogueIterCountCheck(
80678055

80688056
assert(EPI.TripCount &&
80698057
"Expected trip count to have been saved in the first pass.");
8070-
assert(
8071-
(!isa<Instruction>(EPI.TripCount) ||
8072-
DT->dominates(cast<Instruction>(EPI.TripCount)->getParent(), Insert)) &&
8073-
"saved trip count does not dominate insertion point.");
80748058
Value *TC = EPI.TripCount;
80758059
IRBuilder<> Builder(Insert->getTerminator());
80768060
Value *Count = Builder.CreateSub(TC, EPI.VectorTripCount, "n.vec.remaining");

0 commit comments

Comments
 (0)