diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp index c7d758a..be5ff67 100644 --- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp @@ -1069,7 +1069,7 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized, // Create the PHI. BasicBlock *Header = L->getHeader(); - Builder.SetInsertPoint(Header, Header->begin()); + Builder.SetInsertPoint(Header->begin()); PHINode *PN = Builder.CreatePHI(ExpandTy, pred_size(Header), Twine(IVName) + ".iv"); @@ -1521,7 +1521,7 @@ Value *SCEVExpander::expand(const SCEV *S) { return I->second; SCEVInsertPointGuard Guard(Builder, this); - Builder.SetInsertPoint(InsertPt->getParent(), InsertPt); + Builder.SetInsertPoint(InsertPt); // Expand the expression into instructions. SmallVector<Instruction *> DropPoisonGeneratingInsts; @@ -1656,7 +1656,7 @@ void SCEVExpander::replaceCongruentIVInc( else IP = OrigInc->getNextNonDebugInstruction()->getIterator(); - IRBuilder<> Builder(IP->getParent(), IP); + IRBuilder<> Builder(IP); Builder.SetCurrentDebugLocation(IsomorphicInc->getDebugLoc()); NewInc = Builder.CreateTruncOrBitCast(OrigInc, IsomorphicInc->getType(), IVName); @@ -1759,8 +1759,7 @@ SCEVExpander::replaceCongruentIVs(Loop *L, const DominatorTree *DT, ++NumElim; Value *NewIV = OrigPhiRef; if (OrigPhiRef->getType() != Phi->getType()) { - IRBuilder<> Builder(L->getHeader(), - L->getHeader()->getFirstInsertionPt()); + IRBuilder<> Builder(L->getHeader()->getFirstInsertionPt()); Builder.SetCurrentDebugLocation(Phi->getDebugLoc()); NewIV = Builder.CreateTruncOrBitCast(OrigPhiRef, Phi->getType(), IVName); } |