This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Discard speculated dbg intrinsics
ClosedPublic

Authored by bjope on Nov 1 2017, 8:52 AM.

Details

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.

Event Timeline

bjope created this revision.Nov 1 2017, 8:52 AM
aprantl accepted this revision.Nov 1 2017, 9:01 AM

This is an obviously safe/correct thing to do. Thanks!

This revision is now accepted and ready to land.Nov 1 2017, 9:01 AM
This revision was automatically updated to reflect the committed changes.