13 Commits

Author SHA1 Message Date
Zhaoxuan Jiang
147c5d6686
[AArch64] Allow LDR merge with same destination register by renaming (#71908)
The patch is based on a reverted patch:
https://reviews.llvm.org/D103597. It was trying to rename registers
before alias check, which is not safe and causes miscompiles. This patch
does 2 things:

1. Do the renaming with necessary checks passed, including alias check.
2. Rename the register for the instructions between the pairs and
combine the second load into the first. By doing so we can just check
the renamability between the pairs and avoid scanning unknown amount of
instructions before/after the pairs.

Necessary refactoring has been made in order to reuse as much code
possible with STR renaming.
2023-11-23 08:21:27 +00:00
chuongg3
692fbd6c00
[AArch64][GlobalISel] Support udot lowering for vecreduce add (#70784)
vecreduce_add(mul(ext, ext)) -> vecreduce_add(udot) 
vecreduce_add(ext) -> vecreduce_add(ext)

Vectors of scalar size of 8-bits with element count of multiples of 8
2023-11-15 11:41:46 +00:00
chuongg3
f4defbf6bf
[AArch64][GlobalISel] Legalize G_VECREDUCE_ADD bigger types (#68202)
Legalize bigger types for i8 and i16 vector types for G_VECREDUCE_ADD
2023-10-10 16:22:20 +01:00
Tuan Chuong Goh
c381cea873 [AArch64] Fixup test for G_VECREDUCE_ADD
Fix test since the review was created
2023-09-28 12:52:17 +00:00
chuongg3
140a094f5f
[AArch64][GlobalISel] More type support for G_VECREDUCE_ADD (#67433)
G_VECREDUCE_ADD is now able to have v4i16 and v8i8 vector types as
source registers
2023-09-28 11:47:26 +01:00
Harvin Iriawan
db158c7c83 [AArch64] Update generic sched model to A510
Refresh of the generic scheduling model to use A510 instead of A55.
  Main benefits are to the little core, and introducing SVE scheduling information.
  Changes tested on various OoO cores, no performance degradation is seen.

  Differential Revision: https://reviews.llvm.org/D156799
2023-08-21 12:25:15 +01:00
David Green
1af3f596f6 [DAG] Fold Op(vecreduce(a), vecreduce(b)) into vecreduce(Op(a,b))
So long as the operation is reassociative, we can reassociate the double
vecreduce from for example fadd(vecreduce(a), vecreduce(b)) to
vecreduce(fadd(a,b)). This will in general save a few instructions, but some
architectures (MVE) require the opposite fold, so a shouldExpandReduction is
added to account for it. Only targets that use shouldExpandReduction will be
affected.

Differential Revision: https://reviews.llvm.org/D141870
2023-02-08 11:43:36 +00:00
David Green
a2bd372307 [AArch64] Recurse further into performUADDVCombine
This adjusts the performUADDVCombine to recurse further into adds from
reductions, which can help produce more UADDLP when the order of lanes is
unimportant. It also prevents some regressions from subsequent patches.
2023-02-07 19:14:06 +00:00
David Green
9bd58f6f05 [ARM][AArch64][RISCV] Add tests for various double reductions. NFC 2023-02-07 16:39:20 +00:00
Pavel Kosov
37fa99eda0 [SchedModels][CortexA55] Add ASIMD integer instructions
Depends on D114642

Original review https://reviews.llvm.org/D112201

OS Laboratory. Huawei Russian Research Institute. Saint-Petersburg

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D117003
2022-02-17 13:41:57 +03:00
David Green
74d1fe72f4 [AArch64] Expand UADDLV patterns to SADDLV
We already had some patterns for UADDV(UADDLP(x)) -> UADDLV(x), this
simply expands them to the signed instructions by re-using the tablegen
patterns.

Differential Revision: https://reviews.llvm.org/D118133
2022-02-04 14:07:02 +00:00
David Green
31373fb88a [AArch64] Reassociate integer extending reductions to pairwise addition.
Given an (integer) vecreduce, we know the order of the inputs does not matter.
We can convert UADDV(add(zext(extract_lo(x)), zext(extract_hi(x)))) into
UADDV(UADDLP(x)). This can also happen through an extra add, where we transform
UADDV(add(y, add(zext(extract_lo(x)), zext(extract_hi(x))))).

This makes sure the same thing happens signed cases too, which requires adding
a new SADDLP node.

Differential Revision: https://reviews.llvm.org/D118107
2022-02-03 11:05:48 +00:00
David Green
c415ff186d [AArch64] Add extra vecreduce.add tests, including extending reductions. NFC
This is all the reductions from i8 -> i64 with either sign or zero
extensions.
2022-01-25 18:10:09 +00:00