summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-03-02 22:46:48 +0000
committerVedant Kumar <vsk@apple.com>2018-03-02 22:46:48 +0000
commitf69baf64ebc546681b296d8f339a11de2c411642 (patch)
treee694109b088b601d84f2b81d13e7068dc5dcc27b /llvm/lib/Transforms/Utils/Local.cpp
parent235354be57e3b9933f9454e964b8fbe12663dfbb (diff)
downloadbcm5719-llvm-f69baf64ebc546681b296d8f339a11de2c411642.tar.gz
bcm5719-llvm-f69baf64ebc546681b296d8f339a11de2c411642.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp2
1 files changed, 2 insertions, 0 deletions
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) {
OpenPOWER on IntegriCloud