aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-09 23:48:35 +0000
committerOwen Anderson <resistor@mac.com>2009-07-09 23:48:35 +0000
commit6601fcdc38a21a39ac124f2bd8794846519b6455 (patch)
treebc6f5f739c43dec91104275aec30e16f30a7610e /lib/Transforms/Scalar/IndVarSimplify.cpp
parent1e3fe6c538ba7beac73bb4e1a6337da203a6f0f7 (diff)
downloadexternal_llvm-6601fcdc38a21a39ac124f2bd8794846519b6455.zip
external_llvm-6601fcdc38a21a39ac124f2bd8794846519b6455.tar.gz
external_llvm-6601fcdc38a21a39ac124f2bd8794846519b6455.tar.bz2
This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 03a17d6..365589d 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -188,7 +188,7 @@ ICmpInst *IndVarSimplify::LinearFunctionTestReplace(Loop *L,
<< (Opcode == ICmpInst::ICMP_NE ? "!=" : "==") << "\n"
<< " RHS:\t" << *RHS << "\n";
- ICmpInst *Cond = new ICmpInst(Opcode, CmpIndVar, ExitCnt, "exitcond", BI);
+ ICmpInst *Cond = new ICmpInst(BI, Opcode, CmpIndVar, ExitCnt, "exitcond");
Instruction *OrigCond = cast<Instruction>(BI->getCondition());
// It's tempting to use replaceAllUsesWith here to fully replace the old
@@ -294,7 +294,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L,
if (ExitBlocks.size() != 1) {
// Clone the PHI and delete the original one. This lets IVUsers and
// any other maps purge the original user from their records.
- PHINode *NewPN = PN->clone();
+ PHINode *NewPN = PN->clone(*Context);
NewPN->takeName(PN);
NewPN->insertBefore(PN);
PN->replaceAllUsesWith(NewPN);
@@ -726,8 +726,8 @@ void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PH) {
ConstantInt *NewEV = Context->getConstantInt(Type::Int32Ty, intEV);
Value *LHS = (EVIndex == 1 ? NewPHI->getIncomingValue(1) : NewEV);
Value *RHS = (EVIndex == 1 ? NewEV : NewPHI->getIncomingValue(1));
- ICmpInst *NewEC = new ICmpInst(NewPred, LHS, RHS, EC->getNameStart(),
- EC->getParent()->getTerminator());
+ ICmpInst *NewEC = new ICmpInst(EC->getParent()->getTerminator(),
+ NewPred, LHS, RHS, EC->getNameStart());
// In the following deltions, PH may become dead and may be deleted.
// Use a WeakVH to observe whether this happens.