This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Continue cleaning up .td files
ClosedPublic

Authored by Paul-C-Anagnostopoulos on Dec 28 2020, 9:40 AM.

Details

Summary

This revision includes more cleanup of .td files. In this step, I worked on some LLVM and MLIR files. The cleanup involves:

Using the '...' punctuation instead of '-'.
Using true and false for booleans.
Using the new !filter and !interleave operators.
Comparing records directly with !eq rather than !eq(!cast<string>...
Using if rather than foreach when possible.

Diff Detail

Event Timeline

Paul-C-Anagnostopoulos requested review of this revision.Dec 28 2020, 9:40 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 28 2020, 9:40 AM

(I don't have the relevant domain knowledge to say much about this change - but might not hurt to have more specific details in the patch description and/or split it into independent cleanups (perhaps by category/type of cleanup, or by file, etc) - if the general type of cleanups can be agreed upon it's probably the sort of stuff that can be committed with post-commit review after that general agreement is found)

lattner accepted this revision.Dec 28 2020, 6:17 PM

This all looks reasonable to me Paul. One thing you can check to gain confidence is that the output of tblgen should be bitwise identical on all the generated .inc files.

This revision is now accepted and ready to land.Dec 28 2020, 6:17 PM
Paul-C-Anagnostopoulos edited the summary of this revision. (Show Details)Dec 29 2020, 6:01 AM

I improved the summary.

I test these changes by building the targets and checking that the .inc files are identical. I also run all the groups of TableGen tests, many of which include these common files.

jpienaar accepted this revision.Dec 29 2020, 6:26 AM
jpienaar added a subscriber: jpienaar.

LG for MLIR strjoin to interleave change.

This revision was automatically updated to reflect the committed changes.