Skip to content

Commit 84f486c

Browse files
[NFC][SVE] Simplify SUBR_ZI isel patterns.
Differential Revision: https://reviews.llvm.org/D128199
1 parent 7b285ae commit 84f486c

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ def AArch64bic : PatFrags<(ops node:$op1, node:$op2),
315315
(and node:$op1, (xor node:$op2, (SVEAllActive))),
316316
(AArch64bic_node node:$op1, node:$op2)]>;
317317

318+
def AArch64subr : PatFrag<(ops node:$op1, node:$op2),
319+
(sub node:$op2, node:$op1)>;
320+
318321
let Predicates = [HasSVE] in {
319322
defm RDFFR_PPz : sve_int_rdffr_pred<0b0, "rdffr", int_aarch64_sve_rdffr_z>;
320323
def RDFFRS_PPz : sve_int_rdffr_pred<0b1, "rdffrs">;
@@ -360,7 +363,7 @@ let Predicates = [HasSVEorSME, UseExperimentalZeroingPseudos] in {
360363
let Predicates = [HasSVEorSME] in {
361364
defm ADD_ZI : sve_int_arith_imm0<0b000, "add", add>;
362365
defm SUB_ZI : sve_int_arith_imm0<0b001, "sub", sub>;
363-
defm SUBR_ZI : sve_int_arith_imm0_subr<0b011, "subr", sub>;
366+
defm SUBR_ZI : sve_int_arith_imm0<0b011, "subr", AArch64subr>;
364367
defm SQADD_ZI : sve_int_arith_imm0<0b100, "sqadd", saddsat>;
365368
defm UQADD_ZI : sve_int_arith_imm0<0b101, "uqadd", uaddsat>;
366369
defm SQSUB_ZI : sve_int_arith_imm0<0b110, "sqsub", ssubsat>;

llvm/lib/Target/AArch64/SVEInstrFormats.td

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,6 @@ multiclass SVE_1_Op_PassthruUndef_Round_Pat<ValueType vtd, SDPatternOperator op,
380380
(inst $Op3, $Op1, $Op2)>;
381381
}
382382

383-
class SVE_1_Op_Imm_OptLsl_Reverse_Pat<ValueType vt, SDPatternOperator op, ZPRRegOp zprty,
384-
ValueType it, ComplexPattern cpx, Instruction inst>
385-
: Pat<(vt (op (vt (AArch64dup (it (cpx i32:$imm, i32:$shift)))), (vt zprty:$Op1))),
386-
(inst $Op1, i32:$imm, i32:$shift)>;
387-
388383
class SVE_1_Op_Imm_OptLsl_Pat<ValueType vt, SDPatternOperator op, ZPRRegOp zprty,
389384
ValueType it, ComplexPattern cpx, Instruction inst>
390385
: Pat<(vt (op (vt zprty:$Op1), (vt (AArch64dup (it (cpx i32:$imm, i32:$shift)))))),
@@ -4380,18 +4375,6 @@ multiclass sve_int_arith_imm0<bits<3> opc, string asm, SDPatternOperator op> {
43804375
def : SVE_1_Op_Imm_OptLsl_Pat<nxv2i64, op, ZPR64, i64, SVEAddSubImm64Pat, !cast<Instruction>(NAME # _D)>;
43814376
}
43824377

4383-
multiclass sve_int_arith_imm0_subr<bits<3> opc, string asm, SDPatternOperator op> {
4384-
def _B : sve_int_arith_imm0<0b00, opc, asm, ZPR8, addsub_imm8_opt_lsl_i8>;
4385-
def _H : sve_int_arith_imm0<0b01, opc, asm, ZPR16, addsub_imm8_opt_lsl_i16>;
4386-
def _S : sve_int_arith_imm0<0b10, opc, asm, ZPR32, addsub_imm8_opt_lsl_i32>;
4387-
def _D : sve_int_arith_imm0<0b11, opc, asm, ZPR64, addsub_imm8_opt_lsl_i64>;
4388-
4389-
def : SVE_1_Op_Imm_OptLsl_Reverse_Pat<nxv16i8, op, ZPR8, i32, SVEAddSubImm8Pat, !cast<Instruction>(NAME # _B)>;
4390-
def : SVE_1_Op_Imm_OptLsl_Reverse_Pat<nxv8i16, op, ZPR16, i32, SVEAddSubImm16Pat, !cast<Instruction>(NAME # _H)>;
4391-
def : SVE_1_Op_Imm_OptLsl_Reverse_Pat<nxv4i32, op, ZPR32, i32, SVEAddSubImm32Pat, !cast<Instruction>(NAME # _S)>;
4392-
def : SVE_1_Op_Imm_OptLsl_Reverse_Pat<nxv2i64, op, ZPR64, i64, SVEAddSubImm64Pat, !cast<Instruction>(NAME # _D)>;
4393-
}
4394-
43954378
class sve_int_arith_imm<bits<2> sz8_64, bits<6> opc, string asm,
43964379
ZPRRegOp zprty, Operand immtype>
43974380
: I<(outs zprty:$Zdn), (ins zprty:$_Zdn, immtype:$imm),

0 commit comments

Comments
 (0)