[PATCH] D129751: [AArch64][SVE] Add patterns to select masked add/sub instructions
Paul Walker via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 21 09:54:03 PDT 2022
paulwalker-arm added a comment.
Perhaps worth having a less descriptive name for the test (e.g. sve-masked-int-arith.ll or even less descriptive) given we're likely to add many more cases.
================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:340-341
+ (sub node:$op2, node:$op1)>;
+def AArch64subr : PatFrag<(ops node:$pred, node:$op1, node:$op2),
+ (int_aarch64_sve_subr node:$pred, node:$op1, node:$op2)>;
+def AArch64add : PatFrags<(ops node:$pred, node:$op1, node:$op2),
----------------
Is this strictly required? There's only a single pattern and no operand shuffling going on so I think not.
================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:342-347
+def AArch64add : PatFrags<(ops node:$pred, node:$op1, node:$op2),
+ [(int_aarch64_sve_add node:$pred, node:$op1, node:$op2),
+ (add node:$op1, (vselect node:$pred, node:$op2, (SVEDup0)))]>;
+def AArch64sub : PatFrags<(ops node:$pred, node:$op1, node:$op2),
+ [(int_aarch64_sve_sub node:$pred, node:$op1, node:$op2),
+ (sub node:$op1, (vselect node:$pred, node:$op2, (SVEDup0)))]>;
----------------
We have a naming scheme documented above which says these should be called `AArch64add_m1` and `AArch64sub_m1` which means you don't need to rename the original `AArch64subr` def.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129751/new/
https://reviews.llvm.org/D129751
More information about the llvm-commits
mailing list