[llvm] [AArch64][SVE2] UZP should only have one result (PR #93041)
Miguel Saldivar via llvm-commits
llvm-commits at lists.llvm.org
Wed May 22 09:56:52 PDT 2024
https://github.com/Saldivarcher updated https://github.com/llvm/llvm-project/pull/93041
>From 2fe8a5b85a42e05222b75a4976865726433a8906 Mon Sep 17 00:00:00 2001
From: Miguel Saldivar <miguel.saldivar at hpe.com>
Date: Wed, 22 May 2024 09:51:18 -0500
Subject: [PATCH] [AArch64][SVE2] UZP should only have one result
`UZP1` and `UZP2` are only expecting one result value, so this `getNode`
call should be updated to match that.
---
.../Target/AArch64/AArch64ISelLowering.cpp | 6 ++--
llvm/test/CodeGen/AArch64/sve-pr92779.ll | 36 +++++++++++++++++++
2 files changed, 38 insertions(+), 4 deletions(-)
create mode 100644 llvm/test/CodeGen/AArch64/sve-pr92779.ll
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index e31a27e9428e8..bbc896dac77fa 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -13530,11 +13530,9 @@ SDValue AArch64TargetLowering::LowerBUILD_VECTOR(SDValue Op,
DAG.getConstant(NumElts, dl, MVT::i64));
if (Even && !Odd)
- return DAG.getNode(AArch64ISD::UZP1, dl, DAG.getVTList(VT, VT), LHS,
- RHS);
+ return DAG.getNode(AArch64ISD::UZP1, dl, VT, LHS, RHS);
if (Odd && !Even)
- return DAG.getNode(AArch64ISD::UZP2, dl, DAG.getVTList(VT, VT), LHS,
- RHS);
+ return DAG.getNode(AArch64ISD::UZP2, dl, VT, LHS, RHS);
}
}
diff --git a/llvm/test/CodeGen/AArch64/sve-pr92779.ll b/llvm/test/CodeGen/AArch64/sve-pr92779.ll
new file mode 100644
index 0000000000000..e25794817add0
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/sve-pr92779.ll
@@ -0,0 +1,36 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=aarch64 -mattr=+sve2 < %s | FileCheck %s
+
+define void @main(ptr %0) {
+; CHECK-LABEL: main:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: mov z0.d, #0 // =0x0
+; CHECK-NEXT: ptrue p0.d, vl1
+; CHECK-NEXT: mov z1.d, z0.d
+; CHECK-NEXT: ext z1.b, z1.b, z0.b, #8
+; CHECK-NEXT: uzp1 v1.2s, v0.2s, v1.2s
+; CHECK-NEXT: neg v1.2s, v1.2s
+; CHECK-NEXT: smov x8, v1.s[0]
+; CHECK-NEXT: smov x9, v1.s[1]
+; CHECK-NEXT: mov z0.d, p0/m, x8
+; CHECK-NEXT: mov z0.d, p0/m, x9
+; CHECK-NEXT: ptrue p0.d
+; CHECK-NEXT: st1d { z0.d }, p0, [x0]
+; CHECK-NEXT: ret
+"entry":
+ %1 = bitcast <vscale x 2 x i64> zeroinitializer to <vscale x 4 x i32>
+ %a = extractelement <vscale x 4 x i32> %1, i64 0
+ %b = insertelement <2 x i32> zeroinitializer, i32 %a, i64 0
+ %2 = bitcast <vscale x 2 x i64> zeroinitializer to <vscale x 4 x i32>
+ %c = extractelement <vscale x 4 x i32> %2, i64 2
+ %d = insertelement <2 x i32> %b, i32 %c, i64 1
+ %e = sub <2 x i32> zeroinitializer, %d
+ %f = extractelement <2 x i32> %e, i64 0
+ %g = sext i32 %f to i64
+ %h = insertelement <vscale x 2 x i64> zeroinitializer, i64 %g, i64 0
+ %i = extractelement <2 x i32> %e, i64 1
+ %j = sext i32 %i to i64
+ %k = insertelement <vscale x 2 x i64> %h, i64 %j, i64 0
+ store <vscale x 2 x i64> %k, ptr %0, align 16
+ ret void
+}
More information about the llvm-commits
mailing list