13 Commits

Author SHA1 Message Date
David Green
437346378f
[GlobalISel] Widen vector loads from aligned ptrs (#144309)
If the pointer is aligned to more than the size of the vector, we can
widen the load up to next power of 2 size, as SDAG performs.

Some of the v3 tests are currently worse - those should be addressed in
other issues.
2025-06-21 07:42:54 +01:00
Vladislav Dzhidzhoev
2f752cf0ac
[AArch64][GlobalISel] Adopt some Ld* patterns to reduce codegen regressions (#135492)
This is an update of #69607 after #101675 and #105686.

Ld1Lane64Pat, Ld1Lane128Pat, LoadInsertPatterns, Neon_INS_elt_pattern
from SelectionDAG didn't work for GlobalISel on v8i8 and v16i8 vector
types, because vector_insert for v8i8, v16i8 in SelectionDAG expects i32
scalar argument type, whereas G_INSERT_VECTOR_ELT expects s8.
2025-05-12 18:19:15 +02:00
Sander de Smalen
61510b51c3 Revert "[AArch64] Enable subreg liveness tracking by default."
This reverts commit 9c319d5bb40785c969d2af76535ca62448dfafa7.

Some issues were discovered with the bootstrap builds, which
seem like they were caused by this commit. I'm reverting to investigate.
2024-12-12 17:22:15 +00:00
Sander de Smalen
9c319d5bb4 [AArch64] Enable subreg liveness tracking by default.
Internal testing didn't flag up any functional- or performance regressions.
2024-12-12 16:05:49 +00:00
David Green
5dc9c39ac1
[GlobalISel] Check the correct register in sextload OneUse check. (#114763)
This fixes a bug that started triggering after #111730, where we could
remove a load with multiple uses. It looks like the match should be
checking the other register in a one-use check.

  %SrcReg = load..
  %DstReg = sign_extend_inreg %SrcReg
2024-11-05 10:18:07 +00:00
David Green
263775c0fd [AArch64] Extend and cleanup load.ll test. NFC
Adds some sext/zext variants of the scalar tests.
2024-11-04 08:30:11 +00:00
Thorsten Schütt
d8b17f2fb6
[GlobalISel] Combine G_UNMERGE_VALUES with anyext and build vector (#112370)
G_UNMERGE_VALUES (G_ANYEXT (G_BUILD_VECTOR))

ag G_UNMERGE_VALUES llvm/test/CodeGen/AArch64/GlobalISel | grep ANYEXT 
[ANYEXT] is build vector or shuffle vector

Prior art:
https://reviews.llvm.org/D87117
https://reviews.llvm.org/D87166
https://reviews.llvm.org/D87174
https://reviews.llvm.org/D87427

; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<8 x s8>) = G_BUILD_VECTOR 
[[C2]](s8), [[C2]](s8), [[C2]](s8), [[C2]](s8), [[DEF1]](s8),
[[DEF1]](s8), [[DEF1]](s8), [[DEF1]](s8)

; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(<8 x s16>) = G_ANYEXT
[[BUILD_VECTOR2]](<8 x s8>)

; CHECK-NEXT: [[UV10:%[0-9]+]]:_(<4 x s16>), [[UV11:%[0-9]+]]:_(<4 x
s16>) = G_UNMERGE_VALUES
              [[ANYEXT1]](<8 x s16>)

Test:
llvm/test/CodeGen/AArch64/GlobalISel/combine-unmerge.mir
2024-10-19 09:41:43 +02:00
David Green
a11509c3b9 [AArch64][GlobalISel] Scalarize i128/fp128 vector loads/stores.
Similar to other operations, we should scalarize these to allow the individual
elements to legalize.
2024-10-08 08:50:03 +01:00
chuongg3
9b5971ad03
[AArch64][GlobalISel] Lower G_BUILD_VECTOR to G_INSERT_VECTOR_ELT (#105686)
The lowering happens in post-legalizer lowering if any source registers
from G_BUILD_VECTOR are not constants.

Add pattern pragment setting `scalar_to_vector ($src)` asequivalent to
`vector_insert (undef), ($src), (i61 0)`
2024-09-03 18:55:23 -07:00
David Green
fbc247367a
[AArch64][GlobalISel] Legalization for small anyext/sext/zext (#86438)
Similar to #85625, some of the codegen is still far from optimal but
this helps fix quite a few fallback cases.
2024-03-26 09:48:06 +00:00
Dhruv Chawla (work)
1d900e2984
[AArch64][GlobalISel] Avoid generating inserts for undefs when selecting G_BUILD_VECTOR (#84452)
It is safe to ignore undef values when selecting G_BUILD_VECTOR as undef
values choose random registers for copying values from.
2024-03-12 11:57:07 +05:30
chuongg3
8e51b22ce2
[AArch64][GlobalISel] Legalize G_LOAD for v4s8 Vector (#82989)
Lowers `v4s8 = G_LOAD %ptr ptr` into

`s32 = G_LOAD %ptr ptr`
`v4s8 = G_BITCAST s32`
2024-02-28 13:55:27 +00:00
Tuan Chuong Goh
fd336c33b6 [AArch64][GlobalISel] Pre-Commit Test for Legalize G_LOAD v4i8 (#82989) 2024-02-28 10:57:10 +00:00