[AArch64][GlobalISel] Select immediate modes for ADD when selecting G_GEP
authorJessica Paquette <jpaquette@apple.com>
Wed, 24 Jul 2019 23:11:01 +0000 (23:11 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 24 Jul 2019 23:11:01 +0000 (23:11 +0000)
commit728b18f29f970af753750a0d8d11b94ad4966286
treea383e901857e2523594199dc2df5bbddd859575a
parent75c64a66c15900068ad31502c5eebb1ff4081b30
[AArch64][GlobalISel] Select immediate modes for ADD when selecting G_GEP

Before, we weren't able to select things like this for G_GEP:

add x0, x8, #8

And instead we'd materialize the 8.

This teaches GISel to do that. It gives some considerable code size savings
on 252.eon-- about 4%!

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

llvm-svn: 366959
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/select.mir
llvm/test/CodeGen/AArch64/GlobalISel/swifterror.ll