[globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.
authorDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 23 May 2017 19:33:16 +0000 (19:33 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 23 May 2017 19:33:16 +0000 (19:33 +0000)
commit452c8aec61cf855e1c01f1fa334d6e77e9a48ac6
treeca87a1dc52bdef02224781e2ba60def629e132b4
parente3bb52bb2ef02f6aa8fc44cdde11e8fd260cc701
[globalisel][tablegen] Add support for (set $dst, 1) and test X86's OptForSize predicate.

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

Reviewers: qcolombet, ab, t.p.northover, rovka, kristof.beyls, aditya_nandakumar

Reviewed By: qcolombet

Subscribers: igorb, llvm-commits

Differential Revision: https://reviews.llvm.org/D32791

llvm-svn: 303678
llvm/test/CodeGen/X86/GlobalISel/select-leaf-constant.mir [new file with mode: 0644]
llvm/test/TableGen/GlobalISelEmitter.td
llvm/utils/TableGen/GlobalISelEmitter.cpp