aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-01-24 10:53:11 +0000
committerGitHub <noreply@github.com>2025-01-24 10:53:11 +0000
commit8e702735090388a3231a863e343f880d0f96fecb (patch)
tree0de8577ecae863327fe271a2e56f3705af105e5e /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
parente6030d389571b3f1b0f0c5a35b7fa45937ed0f6c (diff)
downloadllvm-8e702735090388a3231a863e343f880d0f96fecb.zip
llvm-8e702735090388a3231a863e343f880d0f96fecb.tar.gz
llvm-8e702735090388a3231a863e343f880d0f96fecb.tar.bz2
[NFC][DebugInfo] Use iterator moveBefore at many call-sites (#123583)
As part of the "RemoveDIs" project, BasicBlock::iterator now carries a debug-info bit that's needed when getFirstNonPHI and similar feed into instruction insertion positions. Call-sites where that's necessary were updated a year ago; but to ensure some type safety however, we'd like to have all calls to moveBefore use iterators. This patch adds a (guaranteed dereferenceable) iterator-taking moveBefore, and changes a bunch of call-sites where it's obviously safe to change to use it by just calling getIterator() on an instruction pointer. A follow-up patch will contain less-obviously-safe changes. We'll eventually deprecate and remove the instruction-pointer insertBefore, but not before adding concise documentation of what considerations are needed (very few).
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
index 0bc752a..3a761bc 100644
--- a/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
@@ -845,7 +845,7 @@ bool SCEVExpander::hoistIVInc(Instruction *IncV, Instruction *InsertPos,
}
for (Instruction *I : llvm::reverse(IVIncs)) {
fixupInsertPoints(I);
- I->moveBefore(InsertPos);
+ I->moveBefore(InsertPos->getIterator());
if (RecomputePoisonFlags)
FixupPoisonFlags(I);
}