diff --git a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td --- a/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td +++ b/llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td @@ -315,6 +315,9 @@ (and node:$op1, (xor node:$op2, (SVEAllActive))), (AArch64bic_node node:$op1, node:$op2)]>; +def AArch64subr : PatFrag<(ops node:$op1, node:$op2), + (sub node:$op2, node:$op1)>; + let Predicates = [HasSVE] in { defm RDFFR_PPz : sve_int_rdffr_pred<0b0, "rdffr", int_aarch64_sve_rdffr_z>; def RDFFRS_PPz : sve_int_rdffr_pred<0b1, "rdffrs">; @@ -360,7 +363,7 @@ let Predicates = [HasSVEorSME] in { defm ADD_ZI : sve_int_arith_imm0<0b000, "add", add>; defm SUB_ZI : sve_int_arith_imm0<0b001, "sub", sub>; - defm SUBR_ZI : sve_int_arith_imm0_subr<0b011, "subr", sub>; + defm SUBR_ZI : sve_int_arith_imm0<0b011, "subr", AArch64subr>; defm SQADD_ZI : sve_int_arith_imm0<0b100, "sqadd", saddsat>; defm UQADD_ZI : sve_int_arith_imm0<0b101, "uqadd", uaddsat>; defm SQSUB_ZI : sve_int_arith_imm0<0b110, "sqsub", ssubsat>; diff --git a/llvm/lib/Target/AArch64/SVEInstrFormats.td b/llvm/lib/Target/AArch64/SVEInstrFormats.td --- a/llvm/lib/Target/AArch64/SVEInstrFormats.td +++ b/llvm/lib/Target/AArch64/SVEInstrFormats.td @@ -380,11 +380,6 @@ (inst $Op3, $Op1, $Op2)>; } -class SVE_1_Op_Imm_OptLsl_Reverse_Pat - : Pat<(vt (op (vt (AArch64dup (it (cpx i32:$imm, i32:$shift)))), (vt zprty:$Op1))), - (inst $Op1, i32:$imm, i32:$shift)>; - class SVE_1_Op_Imm_OptLsl_Pat : Pat<(vt (op (vt zprty:$Op1), (vt (AArch64dup (it (cpx i32:$imm, i32:$shift)))))), @@ -4380,18 +4375,6 @@ def : SVE_1_Op_Imm_OptLsl_Pat(NAME # _D)>; } -multiclass sve_int_arith_imm0_subr opc, string asm, SDPatternOperator op> { - def _B : sve_int_arith_imm0<0b00, opc, asm, ZPR8, addsub_imm8_opt_lsl_i8>; - def _H : sve_int_arith_imm0<0b01, opc, asm, ZPR16, addsub_imm8_opt_lsl_i16>; - def _S : sve_int_arith_imm0<0b10, opc, asm, ZPR32, addsub_imm8_opt_lsl_i32>; - def _D : sve_int_arith_imm0<0b11, opc, asm, ZPR64, addsub_imm8_opt_lsl_i64>; - - def : SVE_1_Op_Imm_OptLsl_Reverse_Pat(NAME # _B)>; - def : SVE_1_Op_Imm_OptLsl_Reverse_Pat(NAME # _H)>; - def : SVE_1_Op_Imm_OptLsl_Reverse_Pat(NAME # _S)>; - def : SVE_1_Op_Imm_OptLsl_Reverse_Pat(NAME # _D)>; -} - class sve_int_arith_imm sz8_64, bits<6> opc, string asm, ZPRRegOp zprty, Operand immtype> : I<(outs zprty:$Zdn), (ins zprty:$_Zdn, immtype:$imm),