diff options
author | Davide Italiano <davide@freebsd.org> | 2019-03-04 04:38:58 +0000 |
---|---|---|
committer | Davide Italiano <davide@freebsd.org> | 2019-03-04 04:38:58 +0000 |
commit | 672bec223d3c88f6cbc74fdb5e10d6990c37868f (patch) | |
tree | b9a736adbe7a4c5286c15a95b1bdc315a40f78d2 /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
parent | 69abb15b81d610139f5939cf998d63899b2ffdf2 (diff) | |
download | bcm5719-llvm-672bec223d3c88f6cbc74fdb5e10d6990c37868f.tar.gz bcm5719-llvm-672bec223d3c88f6cbc74fdb5e10d6990c37868f.zip |
[InstCombine] Mark debug values as unavailable after DCE.
Fixes PR40838.
llvm-svn: 355301
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 723bb4c0d68..d5cc7c5bf7e 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -3323,7 +3323,8 @@ static bool AddReachableCodeToWorklist(BasicBlock *BB, const DataLayout &DL, if (isInstructionTriviallyDead(Inst, TLI)) { ++NumDeadInst; LLVM_DEBUG(dbgs() << "IC: DCE: " << *Inst << '\n'); - salvageDebugInfo(*Inst); + if (!salvageDebugInfo(*Inst)) + replaceDbgUsesWithUndef(Inst); Inst->eraseFromParent(); MadeIRChange = true; continue; |