From f69baf64ebc546681b296d8f339a11de2c411642 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Fri, 2 Mar 2018 22:46:48 +0000 Subject: [Utils] Salvage debug info in block simplification In stage2 -O3 builds of llc, this results in small but measurable increases in the number of variables with locations, and in the number of unique source variables overall. (According to llvm-dwarfdump --statistics, there are 123 additional variables with locations, which is just a 0.006% improvement). The size of the .debug_loc section of the llc dsym increases by 0.004%. llvm-svn: 326629 --- llvm/lib/Transforms/Utils/Local.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Transforms/Utils/Local.cpp') diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 1fd85a83e0a..1bfa1be50e9 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -504,6 +504,8 @@ simplifyAndDCEInstruction(Instruction *I, const DataLayout &DL, const TargetLibraryInfo *TLI) { if (isInstructionTriviallyDead(I, TLI)) { + salvageDebugInfo(*I); + // Null out all of the instruction's operands to see if any operand becomes // dead as we go. for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) { -- cgit v1.2.3