diff options
author | Vedant Kumar <vsk@apple.com> | 2019-11-21 13:53:10 -0800 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2019-11-21 13:53:10 -0800 |
commit | 844d97f650a2d716e63e3be903c32a82f2f817b1 (patch) | |
tree | 2a8b0b1ead57bae06d87a8b996e493c50927fef4 /llvm/lib/Transforms/Scalar/BDCE.cpp | |
parent | f8ff3d7ebd8499cad896b2e934fbc9d7412ba823 (diff) | |
download | bcm5719-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/BDCE.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/BDCE.cpp | 2 |
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; |