[Utils] Salvage the debug info of DCE'ed 'sub' instructions
This salvages 14 debug values in a stage2 build of clang.
llvm-svn: 324974
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 13668e7..379b6bf 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1546,6 +1546,9 @@
case Instruction::Add:
applyOffset(DII, Val);
break;
+ case Instruction::Sub:
+ applyOffset(DII, -int64_t(Val));
+ break;
case Instruction::Or:
applyOps(DII, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_or});
break;