diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-21 23:42:54 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2017-03-21 23:42:54 +0000 |
commit | 15b3e8a93a4040238f4f7655a7b23a2f50716af8 (patch) | |
tree | 82040291134652063d1f85b414ac62acb61e3f14 /llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | |
parent | e8e1fa3a7cf8a9500a39702cce71cde8aa2960f0 (diff) | |
download | bcm5719-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/InstructionSelect.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 69ad59ade08..26454c1ef00 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -123,7 +123,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { // If so, erase it. if (isTriviallyDead(MI, MRI)) { DEBUG(dbgs() << "Is dead; erasing.\n"); - MI.eraseFromParent(); + MI.eraseFromParentAndMarkDBGValuesForRemoval(); continue; } |