This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][RegisterInfoEmitter] Make entries of base register class tables human-readable.
ClosedPublic

Authored by kosarev on Jul 24 2023, 3:48 AM.

Details

Summary

Helps tracking changes in the tables on adding new register classes and
updating BaseClassOrder values.

Also eliminates tables translating base register class indexes into
TargetRegisterClass pointers.

Diff Detail

Event Timeline

kosarev created this revision.Jul 24 2023, 3:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 3:48 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
kosarev requested review of this revision.Jul 24 2023, 3:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 3:48 AM

Does this improve compile time at all?

Does this improve compile time at all?

Removing a level of indirection shouldn't it make slower and switching from uint8_t to uint16_t shouldn't cause any noticeable difference in compile time I think. Generating the tables should take same amount of time or less with the new code as it now stops traversing the base classes as soon as we found one that contains the register.

The table indirection is about trying to keep memory usage/binary size down.
Since we have ~9000 registers, this increases the size of the tables ~18kb.

The code looks fine and I will accept it, but can you clarify the objective/context of the change (here or offline)?
e.g. are you trying to edit these tables by hand / have LIT tests that contains the table gen output?

are you trying to edit these tables by hand / have LIT tests that contains the table gen output?

No, I needed to see how D156099 affects the choice of base classes, which is virtually impossible to do when they are represented as a long line of raw numbers.

The table indirection is about trying to keep memory usage/binary size down.
Since we have ~9000 registers, this increases the size of the tables ~18kb.

Yeah, I think considering the size of other tables it's not worth the extra complexity.

critson accepted this revision.Jul 26 2023, 9:52 PM

LGTM

This revision is now accepted and ready to land.Jul 26 2023, 9:52 PM
This revision was landed with ongoing or failed builds.Jul 27 2023, 2:42 AM
This revision was automatically updated to reflect the committed changes.