summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-11-21 13:53:10 -0800
committerVedant Kumar <vsk@apple.com>2019-11-21 13:53:10 -0800
commit844d97f650a2d716e63e3be903c32a82f2f817b1 (patch)
tree2a8b0b1ead57bae06d87a8b996e493c50927fef4 /llvm/lib/Transforms/Scalar
parentf8ff3d7ebd8499cad896b2e934fbc9d7412ba823 (diff)
downloadbcm5719-llvm-844d97f650a2d716e63e3be903c32a82f2f817b1.tar.gz
bcm5719-llvm-844d97f650a2d716e63e3be903c32a82f2f817b1.zip
Clang-trunk Generates Wrong Debug values with -O1
Bit-Tracking Dead Code Elimination (bdce) do not mark dbg.value as undef after deleting instruction. which shows invalid state of variable in debugger. This patches fixes this by marking the dbg.value as undef which depends on dead instruction. This fixes https://bugs.llvm.org/show_bug.cgi?id=41925 Patch by kamlesh kumar! Differential Revision: https://reviews.llvm.org/D70040
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/BDCE.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/BDCE.cpp b/llvm/lib/Transforms/Scalar/BDCE.cpp
index c22ea0b8271..0fa38fa80b1 100644
--- a/llvm/lib/Transforms/Scalar/BDCE.cpp
+++ b/llvm/lib/Transforms/Scalar/BDCE.cpp
@@ -102,7 +102,7 @@ static bool bitTrackingDCE(Function &F, DemandedBits &DB) {
(I.getType()->isIntOrIntVectorTy() &&
DB.getDemandedBits(&I).isNullValue() &&
wouldInstructionBeTriviallyDead(&I))) {
- salvageDebugInfo(I);
+ salvageDebugInfoOrMarkUndef(I);
Worklist.push_back(&I);
I.dropAllReferences();
Changed = true;
OpenPOWER on IntegriCloud