[llvm] 43c7ca8 - [AArch64][GlobalISel] Legalize store <2 x i16>
Jon Roelofs via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 11:13:03 PDT 2021
Author: Jon Roelofs
Date: 2021-07-13T11:12:05-07:00
New Revision: 43c7ca8e4963beb2e5a57639f20b8f43608296d7
URL: https://github.com/llvm/llvm-project/commit/43c7ca8e4963beb2e5a57639f20b8f43608296d7
DIFF: https://github.com/llvm/llvm-project/commit/43c7ca8e4963beb2e5a57639f20b8f43608296d7.diff
LOG: [AArch64][GlobalISel] Legalize store <2 x i16>
Differential revision: https://reviews.llvm.org/D105912
Added:
Modified:
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
index c0356af14a55..97c27ac8e2ce 100644
--- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
@@ -346,7 +346,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
.clampMaxNumElements(0, s32, 4)
.clampMaxNumElements(0, s64, 2)
.lowerIfMemSizeNotPow2()
- .customIf(IsPtrVecPred);
+ .customIf(IsPtrVecPred)
+ .scalarizeIf(typeIs(0, v2s16), 0);
// Constants
getActionDefinitionsBuilder(G_CONSTANT)
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
index 8c0c6e62f4d7..5428ffda34b7 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
@@ -542,3 +542,26 @@ body: |
G_STORE %val(<6 x s64>), %ptr(p0) :: (store (<6 x s64>), align 16)
RET_ReallyLR
...
+---
+name: store_2xi16
+tracksRegLiveness: true
+body: |
+ bb.1:
+ liveins: $s0, $x0
+
+ ; CHECK-LABEL: name: store_2xi16
+ ; CHECK: liveins: $s0, $x0
+ ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s16>) = COPY $s0
+ ; CHECK: [[UV:%[0-9]+]]:_(s16), [[UV1:%[0-9]+]]:_(s16) = G_UNMERGE_VALUES [[COPY1]](<2 x s16>)
+ ; CHECK: G_STORE [[UV]](s16), [[COPY]](p0) :: (store (s16), align 4)
+ ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
+ ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s64)
+ ; CHECK: G_STORE [[UV1]](s16), [[PTR_ADD]](p0) :: (store (s16) into unknown-address + 2)
+ ; CHECK: RET_ReallyLR
+ %0:_(p0) = COPY $x0
+ %1:_(<2 x s16>) = COPY $s0
+ G_STORE %1(<2 x s16>), %0(p0) :: (store (<2 x s16>))
+ RET_ReallyLR
+
+...
More information about the llvm-commits
mailing list