Skip to content

Commit e251b1b

Browse files
committed
[LV] Small cleanup (NFC)
1 parent 7b96f8d commit e251b1b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,12 +2099,7 @@ class GeneratedRTChecks {
20992099
if (!SCEVCheckCond || match(SCEVCheckCond, m_ZeroInt()))
21002100
return nullptr;
21012101

2102-
Value *Cond = SCEVCheckCond;
2103-
// Mark the check as used, to prevent it from being removed during cleanup.
2104-
SCEVCheckCond = nullptr;
2105-
21062102
auto *Pred = LoopVectorPreHeader->getSinglePredecessor();
2107-
21082103
BranchInst::Create(LoopVectorPreHeader, SCEVCheckBlock);
21092104
// Create new preheader for vector loop.
21102105
if (OuterLoop)
@@ -2118,10 +2113,14 @@ class GeneratedRTChecks {
21182113
DT->addNewBlock(SCEVCheckBlock, Pred);
21192114
DT->changeImmediateDominator(LoopVectorPreHeader, SCEVCheckBlock);
21202115

2121-
BranchInst &BI = *BranchInst::Create(Bypass, LoopVectorPreHeader, Cond);
2116+
BranchInst &BI =
2117+
*BranchInst::Create(Bypass, LoopVectorPreHeader, SCEVCheckCond);
21222118
if (AddBranchWeights)
21232119
setBranchWeights(BI, SCEVCheckBypassWeights, /*IsExpected=*/false);
21242120
ReplaceInstWithInst(SCEVCheckBlock->getTerminator(), &BI);
2121+
2122+
// Mark the check as used, to prevent it from being removed during cleanup.
2123+
SCEVCheckCond = nullptr;
21252124
return SCEVCheckBlock;
21262125
}
21272126

0 commit comments

Comments
 (0)