[AArch64][GlobalISel] Support the neg_addsub_shifted_imm32 pattern
authorJessica Paquette <jpaquette@apple.com>
Fri, 2 Aug 2019 18:12:53 +0000 (18:12 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 2 Aug 2019 18:12:53 +0000 (18:12 +0000)
commite4c46c34cec6944bc059cb582ea9f80428ccf066
tree9fefc9d4e5692826ae405cef45beebc0b5b496e9
parent5545e6963f24ce1ac654d0e66ed64086c975c2f5
[AArch64][GlobalISel] Support the neg_addsub_shifted_imm32 pattern

Add an equivalent ComplexRendererFns function for SelectNegArithImmed. This
allows us to select immediate adds of -1 by turning them into subtracts.

Update select-binop.mir to show that the pattern works.

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

llvm-svn: 367700
llvm/lib/Target/AArch64/AArch64InstrFormats.td
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/select-binop.mir