[PATCH] D155274: [GIsel][AArch64] extend legalization of G_INSERT_VECTOR_ELT
Thorsten via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 03:26:51 PDT 2023
tschuett updated this revision to Diff 540934.
tschuett added a comment.
reformat
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155274/new/
https://reviews.llvm.org/D155274
Files:
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/pr-63826.mir
Index: llvm/test/CodeGen/AArch64/GlobalISel/pr-63826.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AArch64/GlobalISel/pr-63826.mir
@@ -0,0 +1,21 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -mtriple=aarch64 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
+---
+name: pr63826
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: pr63826
+ ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s16>) = IMPLICIT_DEF
+ ; CHECK-NEXT: [[DEF1:%[0-9]+]]:_(s16) = IMPLICIT_DEF
+ ; CHECK-NEXT: [[DEF2:%[0-9]+]]:_(s32) = IMPLICIT_DEF
+ ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[DEF]](<2 x s16>)
+ ; CHECK-NEXT: [[DEF3:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
+ ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s16>) = G_BUILD_VECTOR [[UV]](s16), [[UV1]](s16), [[DEF3]](s16), [[DEF3]](s16)
+ ; CHECK-NEXT: [[IVEC:%[0-9]+]]:_(<4 x s16>) = G_INSERT_VECTOR_ELT [[BUILD_VECTOR]], [[DEF1]](s16), [[DEF2]](s32)
+ ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[IVEC]](<4 x s16>)
+ ; CHECK-NEXT: $w0 = COPY [[UV2]](<2 x s16>)
+ %0:_(<2 x s16>) = IMPLICIT_DEF
+ %1:_(s16) = IMPLICIT_DEF
+ %2:_(s32) = IMPLICIT_DEF
+ %4:_(<2 x s16>) = G_INSERT_VECTOR_ELT %0(<2 x s16>), %1(s16), %2(s32)
+ $w0 = COPY %4(<2 x s16>)
Index: llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+++ llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
@@ -699,7 +699,9 @@
.clampMaxNumElements(1, p0, 2);
getActionDefinitionsBuilder(G_INSERT_VECTOR_ELT)
- .legalIf(typeInSet(0, {v16s8, v8s8, v8s16, v4s16, v4s32, v2s32, v2s64}));
+ .legalIf(typeInSet(0, {v16s8, v8s8, v8s16, v4s16, v4s32, v2s32, v2s64}))
+ .clampMinNumElements(0, s16, 4)
+ .clampMaxNumElements(0, s16, 8);
getActionDefinitionsBuilder(G_BUILD_VECTOR)
.legalFor({{v8s8, s8},
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155274.540934.patch
Type: text/x-patch
Size: 2109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230717/539639e9/attachment.bin>
More information about the llvm-commits
mailing list