]> granicus.if.org Git - llvm/commit
[SimplifyCFG] Discard speculated dbg intrinsics
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Thu, 2 Nov 2017 11:55:14 +0000 (11:55 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Thu, 2 Nov 2017 11:55:14 +0000 (11:55 +0000)
commit1e702fd9054b0c7b66e16c5e3d67ed75f44b3a22
tree12cd49c68cd515ae06bc950910011e926c704335
parentb7c0518566b793f611bdb40d1cb7d72a0926eaec
[SimplifyCFG] Discard speculated dbg intrinsics

Summary:
SpeculativelyExecuteBB can flatten the CFG by doing
speculative execution followed by a select instruction.
When the speculatively executed BB contained dbg intrinsics
the result could be a little bit weird, since those dbg
intrinsics were inserted before the select in the flattened
CFG. So when single stepping in the debugger, printing the
value of the variable referenced in the dbg intrinsic, it
could happen that it looked like the variable had values
that never actually were assigned to the variable.

This patch simply discards all dbg intrinsics that were found
in the speculatively executed BB.

Reviewers: aprantl, chandlerc, craig.topper

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D39494

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317198 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/speculate-dbgvalue.ll [new file with mode: 0644]