]> granicus.if.org Git - llvm/commit
[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)
commit50acddba236ca32bc57d4dd26d8c112b0d8119c0
treeceb80b12933c527256b38624808c9fa69c568416
parent87fb2325ec3baa99c32da4b88294c38564cea017
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303678 91177308-0d34-0410-b5e6-96231b3b80d8
test/CodeGen/X86/GlobalISel/select-leaf-constant.mir [new file with mode: 0644]
test/TableGen/GlobalISelEmitter.td
utils/TableGen/GlobalISelEmitter.cpp