[llvm] [AArch64][SVE] Use ADD/ADR instead of MUL/MLA for x*N (PR #198566)
Tomas Matheson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 01:51:32 PDT 2026
================
@@ -1948,6 +1948,121 @@ let Predicates = [HasSVE] in {
defm : adrShiftPat<nxv4i32, nxv4i1, i32, ADR_LSL_ZZZ_S_2, 2>;
defm : adrShiftPat<nxv4i32, nxv4i1, i32, ADR_LSL_ZZZ_S_3, 3>;
+ // Avoid MUL/MLA for small constants where ADD/ADR forms are available.
+ multiclass sveMulImmAddAdrPat<ValueType Ty, ValueType PredTy,
+ ValueType ScalarTy, Instruction Add,
+ Instruction Adr1, Instruction Adr2,
+ Instruction Adr3> {
+ def : Pat<(Ty (AArch64mul_m1 (PredTy (SVEAllActive)), Ty:$Op,
+ (Ty (splat_vector (ScalarTy 2))))),
+ (Add $Op, $Op)>;
----------------
tommat01 wrote:
Done
https://github.com/llvm/llvm-project/pull/198566
More information about the llvm-commits
mailing list