diff options
author | Orlando Cazalet-Hyams <orlando.hyams@sony.com> | 2025-05-09 13:47:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 13:47:16 +0100 |
commit | c453da7b7c2d964352941484b9f06047d2cc919e (patch) | |
tree | 5cf0946f002ab312787f605103f378b2b75718f1 /llvm/lib/Transforms/Utils/LoopUnroll.cpp | |
parent | 41aa67488c3ca33334ec79fb5216145c3644277c (diff) | |
download | llvm-c453da7b7c2d964352941484b9f06047d2cc919e.zip llvm-c453da7b7c2d964352941484b9f06047d2cc919e.tar.gz llvm-c453da7b7c2d964352941484b9f06047d2cc919e.tar.bz2 |
[KeyInstr][LoopUnroll] Remap atoms while unrolling (#133489)
RFC: https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index ac7d18f..307908a 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp @@ -752,6 +752,14 @@ llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI, } } + // Remap source location atom instance. Do this now, rather than + // when we remap instructions, because remap is called once we've + // cloned all blocks (all the clones would get the same atom + // number). + if (!VMap.AtomMap.empty()) + for (Instruction &I : *New) + RemapSourceAtom(&I, VMap); + // Update our running map of newest clones LastValueMap[*BB] = New; for (ValueToValueMapTy::iterator VI = VMap.begin(), VE = VMap.end(); @@ -802,7 +810,8 @@ llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI, } } - // Remap all instructions in the most recent iteration + // Remap all instructions in the most recent iteration. + // Key Instructions: Nothing to do - we've already remapped the atoms. remapInstructionsInBlocks(NewBlocks, LastValueMap); for (BasicBlock *NewBlock : NewBlocks) for (Instruction &I : *NewBlock) |