diff options
author | Vedant Kumar <vsk@apple.com> | 2018-02-13 01:09:52 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-02-13 01:09:52 +0000 |
commit | 4011c26cc7cc3762a20d3927fc8cd80ad7b4d893 (patch) | |
tree | 208c0512ccc332adb21472aa66f747d2c2a38699 /llvm/lib/Transforms | |
parent | 31ec356a488a364c55782e82691afd1b8f449bc5 (diff) | |
download | bcm5719-llvm-4011c26cc7cc3762a20d3927fc8cd80ad7b4d893.tar.gz bcm5719-llvm-4011c26cc7cc3762a20d3927fc8cd80ad7b4d893.zip |
[Utils] Salvage debug info of DCE'ed mul/sdiv/srem instructions
Here are the number of additional debug values salvaged in a stage2
build of clang:
63 SALVAGE: MUL
1250 SALVAGE: SDIV
(No values were salvaged from `srem` instructions in this experiment,
but it's a simple case to handle so we might as well.)
llvm-svn: 324976
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 1340e12c5c6..45962ca9615 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1549,6 +1549,15 @@ void llvm::salvageDebugInfo(Instruction &I) { case Instruction::Sub: applyOffset(DII, -int64_t(Val)); break; + case Instruction::Mul: + applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_mul}); + break; + case Instruction::SDiv: + applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_div}); + break; + case Instruction::SRem: + applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_mod}); + break; case Instruction::Or: applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_or}); break; |