This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't omit any redundant information in -debug output
ClosedPublic

Authored by thegameg on Feb 15 2018, 8:41 AM.

Details

Summary

In r322867, we introduced IsStandalone when printing MIR in -debug output. The default behaviour for that was:

  1. If any of MBB, MI, or MO are -debug-printed separately, don't omit any redundant information.
  2. When -debug-printing a MF entirely, don't print any redundant information.
  3. When printing MIR, don't print any redundant information.

I'd like to change 2) to: 2) When -debug-printing a MF entirely, don't omit any redundant information.

Diff Detail

Repository
rL LLVM

Event Timeline

thegameg created this revision.Feb 15 2018, 8:41 AM

Printing different things depending on whether asserts are enabled feels strange. Can you explain the motivation here?

Printing different things depending on whether asserts are enabled feels strange. Can you explain the motivation here?

I think we should be showing all the information we have (redundant reg classes, redundant successors, predecessors (always redundant)) in things like -print-after-all, or when calling MF.dump() from the debugger (basically, when we're actually debugging llvm). Also, this can be too verbose to have when calling MF.print() for testing or other purposes.
I'm basically trying to come up with an implicit -simplify-mir for MF.print().

I guess if we don't really care about having MF.print() being too verbose, we could always assume IsStandalone is true except for MIR printing.

Printing different things depending on whether asserts are enabled feels strange. Can you explain the motivation here?

I think we should be showing all the information we have (redundant reg classes, redundant successors, predecessors (always redundant)) in things like -print-after-all, or when calling MF.dump() from the debugger (basically, when we're actually debugging llvm). Also, this can be too verbose to have when calling MF.print() for testing or other purposes.
I'm basically trying to come up with an implicit -simplify-mir for MF.print().

I guess if we don't really care about having MF.print() being too verbose, we could always assume IsStandalone is true except for MIR printing.

Apparently you care about print() being more verbose (I didn't print too much from a debugger/print-after-all lately, so maybe I am just unaware that reducing information is annoying there).
I'd say go for that independently of the asserts then (but keep it reduced for MIR printing).

thegameg updated this revision to Diff 134473.Feb 15 2018, 11:32 AM
thegameg retitled this revision from [CodeGen] Don't omit any redundant information in -debug output when asserts are enabled to [CodeGen] Don't omit any redundant information in -debug output.
thegameg edited the summary of this revision. (Show Details)

Forget the asserts part.

MatzeB accepted this revision.Feb 22 2018, 4:51 PM

LGTM

This revision is now accepted and ready to land.Feb 22 2018, 4:51 PM
This revision was automatically updated to reflect the committed changes.