[llvm] r273586 - [IRCE] Use getTerminator instead of rbegin; NFC
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 11:03:26 PDT 2016
Author: sanjoy
Date: Thu Jun 23 13:03:26 2016
New Revision: 273586
URL: http://llvm.org/viewvc/llvm-project?rev=273586&view=rev
Log:
[IRCE] Use getTerminator instead of rbegin; NFC
Modified:
llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp?rev=273586&r1=273585&r2=273586&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp Thu Jun 23 13:03:26 2016
@@ -637,7 +637,7 @@ LoopStructure::parseLoopStructure(Scalar
return None;
}
- BranchInst *LatchBr = dyn_cast<BranchInst>(&*Latch->rbegin());
+ BranchInst *LatchBr = dyn_cast<BranchInst>(Latch->getTerminator());
if (!LatchBr || LatchBr->isUnconditional()) {
FailureReason = "latch terminator not conditional branch";
return None;
@@ -763,7 +763,7 @@ LoopStructure::parseLoopStructure(Scalar
return None;
}
- IRBuilder<> B(&*Preheader->rbegin());
+ IRBuilder<> B(Preheader->getTerminator());
RightValue = B.CreateAdd(RightValue, One);
}
@@ -785,7 +785,7 @@ LoopStructure::parseLoopStructure(Scalar
return None;
}
- IRBuilder<> B(&*Preheader->rbegin());
+ IRBuilder<> B(Preheader->getTerminator());
RightValue = B.CreateSub(RightValue, One);
}
}
@@ -804,7 +804,7 @@ LoopStructure::parseLoopStructure(Scalar
const DataLayout &DL = Preheader->getModule()->getDataLayout();
Value *IndVarStartV =
SCEVExpander(SE, DL, "irce")
- .expandCodeFor(IndVarStart, IndVarTy, &*Preheader->rbegin());
+ .expandCodeFor(IndVarStart, IndVarTy, Preheader->getTerminator());
IndVarStartV->setName("indvar.start");
LoopStructure Result;
@@ -1026,7 +1026,7 @@ LoopConstrainer::RewrittenRangeInfo Loop
RRI.PseudoExit = BasicBlock::Create(Ctx, Twine(LS.Tag) + ".pseudo.exit", &F,
&*BBInsertLocation);
- BranchInst *PreheaderJump = cast<BranchInst>(&*Preheader->rbegin());
+ BranchInst *PreheaderJump = cast<BranchInst>(Preheader->getTerminator());
bool Increasing = LS.IndVarIncreasing;
IRBuilder<> B(PreheaderJump);
More information about the llvm-commits
mailing list