summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64InstrFormats.td
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2019-08-02 18:12:53 +0000
committerJessica Paquette <jpaquette@apple.com>2019-08-02 18:12:53 +0000
commite4c46c34cec6944bc059cb582ea9f80428ccf066 (patch)
tree9fefc9d4e5692826ae405cef45beebc0b5b496e9 /llvm/lib/Target/AArch64/AArch64InstrFormats.td
parent5545e6963f24ce1ac654d0e66ed64086c975c2f5 (diff)
downloadbcm5719-llvm-e4c46c34cec6944bc059cb582ea9f80428ccf066.tar.gz
bcm5719-llvm-e4c46c34cec6944bc059cb582ea9f80428ccf066.zip
[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
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64InstrFormats.td')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrFormats.td8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
index 72668c5a626..778b4d2cf55 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
@@ -885,6 +885,14 @@ class neg_addsub_shifted_imm<ValueType Ty>
def neg_addsub_shifted_imm32 : neg_addsub_shifted_imm<i32>;
def neg_addsub_shifted_imm64 : neg_addsub_shifted_imm<i64>;
+def gi_neg_addsub_shifted_imm32 :
+ GIComplexOperandMatcher<s32, "selectNegArithImmed">,
+ GIComplexPatternEquiv<neg_addsub_shifted_imm32>;
+
+def gi_neg_addsub_shifted_imm64 :
+ GIComplexOperandMatcher<s64, "selectNegArithImmed">,
+ GIComplexPatternEquiv<neg_addsub_shifted_imm64>;
+
// An extend operand:
// {5-3} - extend type
// {2-0} - imm3
OpenPOWER on IntegriCloud