This is an archive of the discontinued LLVM Phabricator instance.

[DbgHistoryCalculator] Improve debug messages
ClosedPublic

Authored by fdeazeve on Apr 6 2023, 9:21 AM.

Details

Summary

I've found that a frequent source of debug information loss in optimized
code is due to DEBUG_VALUE intrinsics in a position of the instruction
stream that is outside the scope of the variable it describes.

Tracking these is pretty difficult with the existing debug messages of
the history calculator; this patch addresses the issue by making it
obvious when this event happens.

Diff Detail

Event Timeline

fdeazeve created this revision.Apr 6 2023, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 9:21 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fdeazeve requested review of this revision.Apr 6 2023, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 9:21 AM
Orlando accepted this revision.Apr 6 2023, 9:47 AM
Orlando added a subscriber: Orlando.

It looks like we get a print for each dropped range, and one additional print for each variable with any dropped ranges. It might be a bit spammy if there are many ranges getting trimmed, but this is all useful information which probably can't be compressed much further, so LGTM (it might be worth waiting a little to see if anyone disagrees?).

Thanks for improving this!

This revision is now accepted and ready to land.Apr 6 2023, 9:47 AM
aprantl accepted this revision.Apr 10 2023, 3:03 PM
This revision was automatically updated to reflect the committed changes.