[llvm] cc8e3da - [AArch64][SVE] NFC: Add test for scaled stepvector.
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 28 05:08:35 PST 2022
Author: Sander de Smalen
Date: 2022-01-28T13:08:15Z
New Revision: cc8e3dadc464001b521f38a067586e583b904fc7
URL: https://github.com/llvm/llvm-project/commit/cc8e3dadc464001b521f38a067586e583b904fc7
DIFF: https://github.com/llvm/llvm-project/commit/cc8e3dadc464001b521f38a067586e583b904fc7.diff
LOG: [AArch64][SVE] NFC: Add test for scaled stepvector.
This commutative test could be optimised into:
index z0.d, x0, x1
But currently isn't yet.
Added:
Modified:
llvm/test/CodeGen/AArch64/sve-stepvector.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/sve-stepvector.ll b/llvm/test/CodeGen/AArch64/sve-stepvector.ll
index 8dd8562670ccd..20c0ee35d8cdc 100644
--- a/llvm/test/CodeGen/AArch64/sve-stepvector.ll
+++ b/llvm/test/CodeGen/AArch64/sve-stepvector.ll
@@ -289,6 +289,26 @@ entry:
ret <vscale x 2 x i64> %6
}
+define <vscale x 2 x i64> @mul_add_stepvector_nxv2i64_commutative(i64 %x, i64 %y) {
+; CHECK-LABEL: mul_add_stepvector_nxv2i64_commutative:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: index z1.d, #0, #1
+; CHECK-NEXT: mov z2.d, x1
+; CHECK-NEXT: ptrue p0.d
+; CHECK-NEXT: mov z0.d, x0
+; CHECK-NEXT: mla z0.d, p0/m, z2.d, z1.d
+; CHECK-NEXT: ret
+entry:
+ %0 = insertelement <vscale x 2 x i64> poison, i64 %y, i32 0
+ %1 = shufflevector <vscale x 2 x i64> %0, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
+ %2 = call <vscale x 2 x i64> @llvm.experimental.stepvector.nxv2i64()
+ %3 = mul <vscale x 2 x i64> %1, %2
+ %4 = insertelement <vscale x 2 x i64> poison, i64 %x, i32 0
+ %5 = shufflevector <vscale x 2 x i64> %4, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
+ %6 = add <vscale x 2 x i64> %5, %3
+ ret <vscale x 2 x i64> %6
+}
+
define <vscale x 2 x i64> @mul_add_stepvector_bigconst_nxv2i64(i64 %x) {
; CHECK-LABEL: mul_add_stepvector_bigconst_nxv2i64:
; CHECK: // %bb.0: // %entry
More information about the llvm-commits
mailing list