summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-12-02 00:37:57 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-12-02 00:37:57 +0000
commit42f92a7225b538752895710bac0904dd1263d68c (patch)
tree27285d54eeee3c3a6e6710ffc86da62565163c04 /llvm/lib
parent35c5e58f8ce802e49dbadf52942779ec9078f0f2 (diff)
downloadbcm5719-llvm-42f92a7225b538752895710bac0904dd1263d68c.tar.gz
bcm5719-llvm-42f92a7225b538752895710bac0904dd1263d68c.zip
When instructions are hoisted out of loops by MachineLICM, remove their debug loc.
This prevents erratic stepping behavior as well as incorrect source attribution for sample profiling. Reviewers: dblakie Subscribers: llvm-commit Differential Revision: https://reviews.llvm.org/D27290 llvm-svn: 288442
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineLICM.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index e2d00d0e6f5..b3d18435985 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -1336,6 +1336,11 @@ bool MachineLICM::Hoist(MachineInstr *MI, MachineBasicBlock *Preheader) {
// Otherwise, splice the instruction to the preheader.
Preheader->splice(Preheader->getFirstTerminator(),MI->getParent(),MI);
+ // Since we are moving the instruction out of its basic block, we do not
+ // retain its debug location. Doing so would degrade the debugging
+ // experience and adversely affect the accuracy of profiling information.
+ MI->setDebugLoc(DebugLoc());
+
// Update register pressure for BBs from header to this block.
UpdateBackTraceRegPressure(MI);
OpenPOWER on IntegriCloud