This is an archive of the discontinued LLVM Phabricator instance.

[globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.
ClosedPublic

Authored by dsanders on May 3 2017, 3:51 AM.

Details

Summary

It's rare but a small number of patterns use IntInit's at the root of the match.
On X86, one such rule is enabled by the OptForSize predicate and causes the
compiler to use the smaller:
%0 = MOV32r1
instead of the usual:
%0 = MOV32ri 1

This patch adds support for matching IntInit's at the root and uses this as a
test case for the optsize attribute that was implemented in r301750

Event Timeline

dsanders created this revision.May 3 2017, 3:51 AM
qcolombet accepted this revision.May 12 2017, 2:12 PM

LGTM, nitpick below

utils/TableGen/GlobalISelEmitter.cpp
1651

No {} needed

This revision is now accepted and ready to land.May 12 2017, 2:12 PM
dsanders closed this revision.May 23 2017, 12:33 PM