This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] AsmMatcher: Add AsmVariantName to Instruction class.
ClosedPublic

Authored by SamWot on Sep 6 2016, 4:31 AM.

Details

Summary

This allows specifying instructions that are available only in specific assembler variant. If AsmVariantName is specified then instruction will be presented only in MatchTable for this variant. If not specified then assembler variants will be determined based on AsmString.
Also this allows splitting assembler match tables in same way as it is done in dissasembler.

Diff Detail

Event Timeline

SamWot updated this revision to Diff 70381.Sep 6 2016, 4:31 AM
SamWot retitled this revision from to [TableGen] AsmMatcher: Add AsmVariantName to Instruction class..
SamWot updated this object.
tstellarAMD added inline comments.Sep 6 2016, 6:30 AM
utils/TableGen/AsmMatcherEmitter.cpp
1487

I think this should be a StringRef.

1519

Same Here.

SamWot added inline comments.Sep 6 2016, 8:32 AM
utils/TableGen/AsmMatcherEmitter.cpp
1487

It's unsafe here. getValueAsString() method return std::string by value. StringRef will point to free memory.

tstellarAMD accepted this revision.Sep 8 2016, 6:01 AM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Sep 8 2016, 6:01 AM
vpykhtin edited edge metadata.Sep 8 2016, 7:05 AM

LGTM, but add the test first.

SamWot updated this revision to Diff 70703.Sep 8 2016, 8:21 AM
SamWot edited edge metadata.

Added tests

vpykhtin accepted this revision.Sep 8 2016, 8:25 AM
vpykhtin edited edge metadata.

LGTM.

This revision was automatically updated to reflect the committed changes.