This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Retain debug info when threading jumps with critical edges
ClosedPublic

Authored by StephenTozer on Mar 11 2019, 3:59 AM.

Details

Summary

Fixes bug 38023: https://bugs.llvm.org/show_bug.cgi?id=38023

The SimplifyCFG pass will perform jump threading in some cases where
doing so is trivial and would simplify the CFG. When folding a series
of blocks with redundant conditional branches into an unconditional "critical
edge" block, it does not keep the debug location associated with the previous
conditional branch.

This patch fixes the bug described by copying the debug info from the
old conditional branch to the new unconditional branch instruction, and
adds a regression test for the SimplifyCFG pass that covers this case.

Diff Detail

Repository
rL LLVM

Event Timeline

StephenTozer created this revision.Mar 11 2019, 3:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2019, 3:59 AM
vsk accepted this revision.Mar 11 2019, 8:55 AM

Thanks, looks great (and thanks to @gbedwell for finding this)!

This revision is now accepted and ready to land.Mar 11 2019, 8:55 AM
This revision was automatically updated to reflect the committed changes.