File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments