[llvm] [AArch64][SVE] Detect MOV (imm, pred, zeroing/merging) (PR #116032)
Ricardo Jesus via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 14 00:25:09 PST 2024
================
@@ -892,6 +892,26 @@ let Predicates = [HasSVEorSME] in {
def : Pat<(nxv2i64 (splat_vector (i64 (SVECpyDupImm64Pat i32:$a, i32:$b)))),
(DUP_ZI_D $a, $b)>;
+ // Duplicate Int immediate to active vector elements (zeroing).
+ def : Pat<(nxv16i8 (AArch64dup_mt PPR:$pg, (i32 (SVECpyDupImm8Pat i32:$a, i32:$b)), (SVEDup0Undef))),
+ (CPY_ZPzI_B $pg, $a, $b)>;
+ def : Pat<(nxv8i16 (AArch64dup_mt PPR:$pg, (i32 (SVECpyDupImm16Pat i32:$a, i32:$b)), (SVEDup0Undef))),
+ (CPY_ZPzI_H $pg, $a, $b)>;
+ def : Pat<(nxv4i32 (AArch64dup_mt PPR:$pg, (i32 (SVECpyDupImm32Pat i32:$a, i32:$b)), (SVEDup0Undef))),
+ (CPY_ZPzI_S $pg, $a, $b)>;
+ def : Pat<(nxv2i64 (AArch64dup_mt PPR:$pg, (i64 (SVECpyDupImm64Pat i32:$a, i32:$b)), (SVEDup0Undef))),
+ (CPY_ZPzI_D $pg, $a, $b)>;
----------------
rj-jesus wrote:
> Can these be pushed into sve_int_dup_imm_pred_merge in the same way as we do for sve_int_perm_cpy_r?
Thanks, could you please have a look at the most recent commit to see if that's what you had in mind?
I believe here you meant `sve_int_dup_imm_pred_zero` (and vice-versa for the patterns below), but please let me know if I got this wrong.
> I think you want SVEDup0 rather than SVEDup0Undef
Thanks, I've changed this.
https://github.com/llvm/llvm-project/pull/116032
More information about the llvm-commits
mailing list