summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/Utils.cpp
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2017-03-21 23:42:54 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2017-03-21 23:42:54 +0000
commit15b3e8a93a4040238f4f7655a7b23a2f50716af8 (patch)
tree82040291134652063d1f85b414ac62acb61e3f14 /llvm/lib/CodeGen/GlobalISel/Utils.cpp
parente8e1fa3a7cf8a9500a39702cce71cde8aa2960f0 (diff)
downloadbcm5719-llvm-15b3e8a93a4040238f4f7655a7b23a2f50716af8.tar.gz
bcm5719-llvm-15b3e8a93a4040238f4f7655a7b23a2f50716af8.zip
[GlobalISel] Update DBG_VALUEs referencing DCE'd instructions.
Quentin points out that r298358 would cause us to emit different code with debug info. That's a big no-no; also erase the instructions that only live thanks to DBG_VALUE users. Adrian explained how this is an existing problem and an OK thing to do: clang has allocas for all variables so shouldn't be affected at -O0, but swift uses a bit of inlineasm to explicitly keep values live for the purpose of debug info quality. I'm not sure there is a better scheme. llvm-svn: 298460
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/Utils.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Utils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
index 2e2f519ab2b..606a59680a3 100644
--- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -61,8 +61,8 @@ bool llvm::isTriviallyDead(const MachineInstr &MI,
continue;
unsigned Reg = MO.getReg();
- // Keep Debug uses live: we don't want to have an effect on debug info.
- if (TargetRegisterInfo::isPhysicalRegister(Reg) || !MRI.use_empty(Reg))
+ if (TargetRegisterInfo::isPhysicalRegister(Reg) ||
+ !MRI.use_nodbg_empty(Reg))
return false;
}
return true;
OpenPOWER on IntegriCloud