aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2025-05-09 15:24:47 +0100
committerGitHub <noreply@github.com>2025-05-09 15:24:47 +0100
commitfb7d114efb52ff78b7645490adb8f0c37fd12986 (patch)
treeaf9f0b1092c18d68b6ea9f3ad6b850af4f05260e /llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
parent4ae529b764390fb7b78bf1871bb90ff5c4c7bbbd (diff)
downloadllvm-fb7d114efb52ff78b7645490adb8f0c37fd12986.zip
llvm-fb7d114efb52ff78b7645490adb8f0c37fd12986.tar.gz
llvm-fb7d114efb52ff78b7645490adb8f0c37fd12986.tar.bz2
[KeyInstr][LoopUnswitch] Remap cloned instructions' atoms (#133491)
RFC: https://discourse.llvm.org/t/rfc-improving-is-stmt-placement-for-better-interactive-debugging/82668
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index c6962e5..0bf9003 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -297,6 +297,10 @@ static void buildPartialInvariantUnswitchConditionalBranch(
for (auto *Val : reverse(ToDuplicate)) {
Instruction *Inst = cast<Instruction>(Val);
Instruction *NewInst = Inst->clone();
+
+ if (const DebugLoc &DL = Inst->getDebugLoc())
+ mapAtomInstance(DL, VMap);
+
NewInst->insertInto(&BB, BB.end());
RemapInstruction(NewInst, VMap,
RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);