summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-02-13 01:09:49 +0000
committerVedant Kumar <vsk@apple.com>2018-02-13 01:09:49 +0000
commit31ec356a488a364c55782e82691afd1b8f449bc5 (patch)
treea32bae600764f8af2d9edbd8108e647395db7816 /llvm/lib/Transforms/Utils
parent47b16c45d7acef402729e67d66aebafe5295af75 (diff)
downloadbcm5719-llvm-31ec356a488a364c55782e82691afd1b8f449bc5.tar.gz
bcm5719-llvm-31ec356a488a364c55782e82691afd1b8f449bc5.zip
[Utils] Salvage debug info of DCE'ed shl/lhsr/ashr instructions
Here are the number of additional debug values salvaged in a stage2 build of clang: 1912 SALVAGE: ASHR 405 SALVAGE: LSHR 249 SALVAGE: SHL llvm-svn: 324975
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 379b6bf1311..1340e12c5c6 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1555,6 +1555,15 @@ void llvm::salvageDebugInfo(Instruction &I) {
case Instruction::Xor:
applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_xor});
break;
+ case Instruction::Shl:
+ applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shl});
+ break;
+ case Instruction::LShr:
+ applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shr});
+ break;
+ case Instruction::AShr:
+ applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_shra});
+ break;
default:
// TODO: Salvage constants from each kind of binop we know about.
continue;
OpenPOWER on IntegriCloud