diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2024-02-29 16:49:40 +0000 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2024-02-29 16:50:22 +0000 |
commit | 6c7805d5d186a6d1263f90b8033ad85e2d2633d7 (patch) | |
tree | b92631db6d02079abecde78b3d1adab85f1bfed9 /llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | |
parent | c4c35d9522d19a0a511ee2cc011a21661e69f3c0 (diff) | |
download | llvm-6c7805d5d186a6d1263f90b8033ad85e2d2633d7.zip llvm-6c7805d5d186a6d1263f90b8033ad85e2d2633d7.tar.gz llvm-6c7805d5d186a6d1263f90b8033ad85e2d2633d7.tar.bz2 |
Revert "[NFC][RemoveDIs] Bulk update utilities to insert with iterators"
This reverts commit 3fda50d3915b2163a54a37b602be7783a89dd808.
Apparently I've missed a hunk while staging this; will back out for now.
Picked up here: https://lab.llvm.org/buildbot/#/builders/139/builds/60429/steps/6/logs/stdio
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyIndVar.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp index b8fa985..297cfe5 100644 --- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp @@ -301,7 +301,7 @@ bool SimplifyIndvar::eliminateSDiv(BinaryOperator *SDiv) { if (SE->isKnownNonNegative(N) && SE->isKnownNonNegative(D)) { auto *UDiv = BinaryOperator::Create( BinaryOperator::UDiv, SDiv->getOperand(0), SDiv->getOperand(1), - SDiv->getName() + ".udiv", SDiv->getIterator()); + SDiv->getName() + ".udiv", SDiv); UDiv->setIsExact(SDiv->isExact()); SDiv->replaceAllUsesWith(UDiv); LLVM_DEBUG(dbgs() << "INDVARS: Simplified sdiv: " << *SDiv << '\n'); @@ -318,7 +318,7 @@ bool SimplifyIndvar::eliminateSDiv(BinaryOperator *SDiv) { void SimplifyIndvar::replaceSRemWithURem(BinaryOperator *Rem) { auto *N = Rem->getOperand(0), *D = Rem->getOperand(1); auto *URem = BinaryOperator::Create(BinaryOperator::URem, N, D, - Rem->getName() + ".urem", Rem->getIterator()); + Rem->getName() + ".urem", Rem); Rem->replaceAllUsesWith(URem); LLVM_DEBUG(dbgs() << "INDVARS: Simplified srem: " << *Rem << '\n'); ++NumSimplifiedSRem; @@ -339,9 +339,9 @@ void SimplifyIndvar::replaceRemWithNumerator(BinaryOperator *Rem) { void SimplifyIndvar::replaceRemWithNumeratorOrZero(BinaryOperator *Rem) { auto *T = Rem->getType(); auto *N = Rem->getOperand(0), *D = Rem->getOperand(1); - ICmpInst *ICmp = new ICmpInst(Rem->getIterator(), ICmpInst::ICMP_EQ, N, D); + ICmpInst *ICmp = new ICmpInst(Rem, ICmpInst::ICMP_EQ, N, D); SelectInst *Sel = - SelectInst::Create(ICmp, ConstantInt::get(T, 0), N, "iv.rem", Rem->getIterator()); + SelectInst::Create(ICmp, ConstantInt::get(T, 0), N, "iv.rem", Rem); Rem->replaceAllUsesWith(Sel); LLVM_DEBUG(dbgs() << "INDVARS: Simplified rem: " << *Rem << '\n'); ++NumElimRem; @@ -411,7 +411,7 @@ bool SimplifyIndvar::eliminateOverflowIntrinsic(WithOverflowInst *WO) { // intrinsic as well. BinaryOperator *NewResult = BinaryOperator::Create( - WO->getBinaryOp(), WO->getLHS(), WO->getRHS(), "", WO->getIterator()); + WO->getBinaryOp(), WO->getLHS(), WO->getRHS(), "", WO); if (WO->isSigned()) NewResult->setHasNoSignedWrap(true); @@ -449,7 +449,7 @@ bool SimplifyIndvar::eliminateSaturatingIntrinsic(SaturatingInst *SI) { return false; BinaryOperator *BO = BinaryOperator::Create( - SI->getBinaryOp(), SI->getLHS(), SI->getRHS(), SI->getName(), SI->getIterator()); + SI->getBinaryOp(), SI->getLHS(), SI->getRHS(), SI->getName(), SI); if (SI->isSigned()) BO->setHasNoSignedWrap(); else @@ -1767,7 +1767,7 @@ Instruction *WidenIV::widenIVUse(WidenIV::NarrowIVDefUse DU, PHINode *WidePhi = PHINode::Create(DU.WideDef->getType(), 1, UsePhi->getName() + ".wide", - UsePhi->getIterator()); + UsePhi); WidePhi->addIncoming(DU.WideDef, UsePhi->getIncomingBlock(0)); BasicBlock *WidePhiBB = WidePhi->getParent(); IRBuilder<> Builder(WidePhiBB, WidePhiBB->getFirstInsertionPt()); |