This is an archive of the discontinued LLVM Phabricator instance.

TableGen: use PrintMethod to print more aliases
ClosedPublic

Authored by t.p.northover on May 9 2014, 10:08 AM.

Details

Reviewers
t.p.northover
Summary

Hi,

Currently, TableGen is very conservative about the aliases it is capable of printing: any kind of Operand Record in the InstAlias, except for some explicitly understood Registers, means that TableGen will simply skip the alias for printing purposes.

This completely relaxes that restriction: a complicated Operand is assumed to *always* be printed and any available PrintMethod is used. For out of tree targets, the previous behaviour can be restored by setting "Emit" to 0 in any InstAlias. In the future a more flexible predication mechanism might be useful.

This seems to have affected 3.5 targets:
+ ARM64/AArch64: I made some fairly minimal changes here to reduce the number of tests that need rewriting. The rest are deferred for later.
+ Mips: it looked like both aliases for "break" should have been printed, but .td file order was significant so I swapped them.
+ x86: I couldn't find any documentation on whether "imull $3, %eax, %eax" (for example) should print as "imull $3, %eax". Given the prevalence of 2-operand instructions I decided it probably should and updated the test.

Does the change look OK?

Cheers.

Tim.

Diff Detail

Event Timeline

t.p.northover retitled this revision from to TableGen: use PrintMethod to print more aliases.
t.p.northover updated this object.
t.p.northover edited the test plan for this revision. (Show Details)
t.p.northover added a subscriber: Unknown Object (MLST).
t.p.northover accepted this revision.May 12 2014, 11:11 AM
t.p.northover added a reviewer: t.p.northover.

James took a look and OKed this on IRC, so I've committed it as r208607.

Tim.

This revision is now accepted and ready to land.May 12 2014, 11:11 AM