diff options
| author | Vedant Kumar <vsk@apple.com> | 2018-02-13 18:15:26 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2018-02-13 18:15:26 +0000 |
| commit | 35fc103e1e8d1f069d7a5ada7131466c3402c265 (patch) | |
| tree | 7d15c876ef5dad47bf5273ff35cab8a28086f834 /llvm/lib | |
| parent | f381e94ac845755ef302d3629385eaa86ee6096d (diff) | |
| download | bcm5719-llvm-35fc103e1e8d1f069d7a5ada7131466c3402c265.tar.gz bcm5719-llvm-35fc103e1e8d1f069d7a5ada7131466c3402c265.zip | |
[DeadStoreElimination] Salvage debug info from dead insts
According to `llvm-dwarfdump --statistics` this salvages 43 additional
unique source variables in a stage2 build of clang. It increases the
size of the .debug_loc section by 0.002% (or 2864 bytes).
Differential Revision: https://reviews.llvm.org/D43220
llvm-svn: 325035
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 53ceb89d4d0..e6f0bb21dd5 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -115,6 +115,9 @@ deleteDeadInstruction(Instruction *I, BasicBlock::iterator *BBI, Instruction *DeadInst = NowDeadInsts.pop_back_val(); ++NumFastOther; + // Try to preserve debug information attached to the dead instruction. + salvageDebugInfo(*DeadInst); + // This instruction is dead, zap it, in stages. Start by removing it from // MemDep, which needs to know the operands and needs it to be in the // function. |

