@@ -1264,15 +1264,17 @@ LoopConstrainer::RewrittenRangeInfo LoopConstrainer::changeIterationSpaceEnd(
1264
1264
Increasing
1265
1265
? (IsSignedPredicate ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT)
1266
1266
: (IsSignedPredicate ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT);
1267
- EnterLoopCond = B.CreateICmp (Pred, LS.IndVarStart , ExitSubloopAt);
1267
+ Value *IndVarStart = LS.IndVarStart ;
1268
+ Value *IndVarBase = LS.IndVarBase ;
1269
+ Value *LoopExitAt = LS.LoopExitAt ;
1270
+ EnterLoopCond = B.CreateICmp (Pred, IndVarStart, ExitSubloopAt);
1268
1271
1269
1272
B.CreateCondBr (EnterLoopCond, LS.Header , RRI.PseudoExit );
1270
1273
PreheaderJump->eraseFromParent ();
1271
1274
1272
1275
LS.LatchBr ->setSuccessor (LS.LatchBrExitIdx , RRI.ExitSelector );
1273
1276
B.SetInsertPoint (LS.LatchBr );
1274
- Value *TakeBackedgeLoopCond = B.CreateICmp (Pred, LS.IndVarBase ,
1275
- ExitSubloopAt);
1277
+ Value *TakeBackedgeLoopCond = B.CreateICmp (Pred, IndVarBase, ExitSubloopAt);
1276
1278
1277
1279
Value *CondForBranch = LS.LatchBrExitIdx == 1
1278
1280
? TakeBackedgeLoopCond
@@ -1285,7 +1287,7 @@ LoopConstrainer::RewrittenRangeInfo LoopConstrainer::changeIterationSpaceEnd(
1285
1287
// IterationsLeft - are there any more iterations left, given the original
1286
1288
// upper bound on the induction variable? If not, we branch to the "real"
1287
1289
// exit.
1288
- Value *IterationsLeft = B.CreateICmp (Pred, LS. IndVarBase , LS. LoopExitAt );
1290
+ Value *IterationsLeft = B.CreateICmp (Pred, IndVarBase, LoopExitAt);
1289
1291
B.CreateCondBr (IterationsLeft, RRI.PseudoExit , LS.LatchExit );
1290
1292
1291
1293
BranchInst *BranchToContinuation =
@@ -1304,10 +1306,10 @@ LoopConstrainer::RewrittenRangeInfo LoopConstrainer::changeIterationSpaceEnd(
1304
1306
RRI.PHIValuesAtPseudoExit .push_back (NewPHI);
1305
1307
}
1306
1308
1307
- RRI.IndVarEnd = PHINode::Create (LS. IndVarBase ->getType (), 2 , " indvar.end" ,
1309
+ RRI.IndVarEnd = PHINode::Create (IndVarBase->getType (), 2 , " indvar.end" ,
1308
1310
BranchToContinuation);
1309
- RRI.IndVarEnd ->addIncoming (LS. IndVarStart , Preheader);
1310
- RRI.IndVarEnd ->addIncoming (LS. IndVarBase , RRI.ExitSelector );
1311
+ RRI.IndVarEnd ->addIncoming (IndVarStart, Preheader);
1312
+ RRI.IndVarEnd ->addIncoming (IndVarBase, RRI.ExitSelector );
1311
1313
1312
1314
// The latch exit now has a branch from `RRI.ExitSelector' instead of
1313
1315
// `LS.Latch'. The PHI nodes need to be updated to reflect that.
0 commit comments