diff options
| author | Reid Kleckner <rnk@google.com> | 2017-11-15 18:51:12 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-11-15 18:51:12 +0000 |
| commit | 72b819b8ee0a0a5e0389028b4637a48c668798a9 (patch) | |
| tree | d06aad811883e555f7843c76d5983998af61a6c1 /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
| parent | 680c73f049f654ced67307935d7cf880e71f23d5 (diff) | |
| download | bcm5719-llvm-72b819b8ee0a0a5e0389028b4637a48c668798a9.tar.gz bcm5719-llvm-72b819b8ee0a0a5e0389028b4637a48c668798a9.zip | |
[InstCombine] Salvage debug info during initial DCE
InstCombine salvages debug info for every instruction it erases from its
worklist, but it wasn't doing it during its initial DCE when populating
its worklist. This fixes that.
This should help improve availability of 'this' in optimized debug info
when casts are necessary.
llvm-svn: 318320
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index dad066a6fb4..f272f8273d1 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3113,6 +3113,7 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB, const DataLayout &DL, if (isInstructionTriviallyDead(Inst, TLI)) { ++NumDeadInst; DEBUG(dbgs() << "IC: DCE: " << *Inst << '\n'); + salvageDebugInfo(*Inst); Inst->eraseFromParent(); MadeIRChange = true; continue; |

