This is an archive of the discontinued LLVM Phabricator instance.

[LiveDebugValues] Do not insert DBG_VALUEs after a MBB terminator
ClosedPublic

Authored by vsk on Mar 3 2020, 11:13 AM.

Details

Summary

This fixes a miscompile that happened because a DBG_VALUE interfered
with the MachineOutliner's liveness analysis.

Inserting a DBG_VALUE after a terminator breaks predicates on MBB such
as isReturnBlock(). And the resulting DBG_VALUE cannot be "live", afaict.

I plan to introduce a MachineVerifier check for this situation in a
follow up.

rdar://59859175

Diff Detail

Event Timeline

vsk created this revision.Mar 3 2020, 11:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2020, 11:13 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
This revision is now accepted and ready to land.Mar 3 2020, 11:32 AM
djtodoro accepted this revision.Mar 3 2020, 12:34 PM

Makes sense to me! Thanks!

This revision was automatically updated to reflect the committed changes.