aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-01-27 16:44:14 +0000
committerGitHub <noreply@github.com>2025-01-27 16:44:14 +0000
commit34b139594aa20fe712bc2ad68544632b3e4d8512 (patch)
tree18cbd3bb7b614d704f4b1552ebffd9a3b2a619c0 /llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
parent038b42ba5b47b1aa2d47ef5706a713f6bfbbc37c (diff)
downloadllvm-34b139594aa20fe712bc2ad68544632b3e4d8512.zip
llvm-34b139594aa20fe712bc2ad68544632b3e4d8512.tar.gz
llvm-34b139594aa20fe712bc2ad68544632b3e4d8512.tar.bz2
[NFC][DebugInfo] Switch more call-sites to using iterator-insertion (#124283)
To finalise the "RemoveDIs" work removing debug intrinsics, we're updating call sites that insert instructions to use iterators instead. This set of changes are those where it's not immediately obvious that just calling getIterator to fetch an iterator is correct, and one or two places where more than one line needs to change. Overall the same rule holds though: iterators generated for the start of a block such as getFirstNonPHIIt need to be passed into insert/move methods without being unwrapped/rewrapped, everything else can use getIterator.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
index 49209e3..0b532b6 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
@@ -165,7 +165,7 @@ static bool processHeaderPhiOperands(BasicBlock *Header, BasicBlock *Latch,
// Move the phi operands of Header from Latch out of AftBlocks to InsertLoc.
static void moveHeaderPhiOperandsToForeBlocks(BasicBlock *Header,
BasicBlock *Latch,
- Instruction *InsertLoc,
+ BasicBlock::iterator InsertLoc,
BasicBlockSet &AftBlocks) {
// We need to ensure we move the instructions in the correct order,
// starting with the earliest required instruction and moving forward.
@@ -329,7 +329,8 @@ llvm::UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
// Move any instructions from fore phi operands from AftBlocks into Fore.
moveHeaderPhiOperandsToForeBlocks(
- Header, LatchBlock, ForeBlocksLast[0]->getTerminator(), AftBlocks);
+ Header, LatchBlock, ForeBlocksLast[0]->getTerminator()->getIterator(),
+ AftBlocks);
// The current on-the-fly SSA update requires blocks to be processed in
// reverse postorder so that LastValueMap contains the correct value at each