This is an archive of the discontinued LLVM Phabricator instance.

[ARM,MVE] Use the new Tablegen `defvar` and `if` statements.
ClosedPublic

Authored by simon_tatham on Jan 14 2020, 2:41 AM.

Details

Summary

This cleans up a lot of ugly foreach bodges that I've been using to
work around the lack of those two language features. Now they both
exist, I can make then all into something more legible!

In particular, in the common pattern in ARMInstrMVE.td where a
multiclass defines an Instruction instance plus one or more Pat that
select it, I've used a defvar to wrap !cast<Instruction>(NAME) so
that the patterns themselves become a little more legible.

Replacing a foreach with a defvar removes a level of block
structure, so several pieces of code have their indentation changed by
this patch. Best viewed with whitespace ignored.

NFC: the output of llvm-tblgen -print-records on the two affected
Tablegen sources is exactly identical before and after this change, so
there should be no effect at all on any of the other generated files.

Diff Detail

Event Timeline

simon_tatham created this revision.Jan 14 2020, 2:41 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 14 2020, 2:41 AM
MarkMurrayARM accepted this revision.Jan 14 2020, 3:50 AM
MarkMurrayARM added inline comments.
llvm/lib/Target/ARM/ARMInstrMVE.td
2464

MUCH better!

This revision is now accepted and ready to land.Jan 14 2020, 3:50 AM
This revision was automatically updated to reflect the committed changes.