aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUnroll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp11
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)