Page MenuHomePhabricator

TableGen: Add --gen-register-info-debug-dump
ClosedPublic

Authored by MatzeB on Aug 18 2017, 6:26 PM.

Details

Summary

Adds a new --gen-register-info-debug-dump mode to tablegen that dumps various register related information:

  • List of register classes with super and subclasses
  • List of subregister indexes with lanemasks
  • List of registers with subregisters

I will use this in an upcoming commit to create a test.
It may also be useful for target developers wanting to get an overview of all the register related information, esp. the things inferred by tablegen and not directly visible in the .td file.

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Aug 18 2017, 6:26 PM
kparzysz edited edge metadata.Aug 21 2017, 12:26 PM

Looks good to me. One thing I'm wondering about is if this needs to be a separate TableGen "target". Could it be under a debug flag used with -gen-register-info?

qcolombet accepted this revision.Aug 25 2017, 10:19 AM

LGTM too.
Same comment as Krzysztof, would be nice if the debug printing was more intuitively discoverable (e.g., -debug alongside with -gen-register-info).

This revision is now accepted and ready to land.Aug 25 2017, 10:19 AM

LGTM too.
Same comment as Krzysztof, would be nice if the debug printing was more intuitively discoverable (e.g., -debug alongside with -gen-register-info).

The problem with -gen-register-info -debug is that I would still expect the C++ to be generated. So we would end up with the C++ register info on stdout and the debug information on stderr? That feels cumbersome.

How about if I rename to -debug-register-info to make it more discoverable; i'll also try to show it as a different category on the --help output.

LGTM too.
Same comment as Krzysztof, would be nice if the debug printing was more intuitively discoverable (e.g., -debug alongside with -gen-register-info).

The problem with -gen-register-info -debug is that I would still expect the C++ to be generated. So we would end up with the C++ register info on stdout and the debug information on stderr? That feels cumbersome.

Thinking about it some more -gen-register-info -o /dev/null -debug may be fine, I'll got with that.

This revision was automatically updated to reflect the committed changes.