[PATCH] D159302: [RISCV] Add tests for demanded bits in splat_vector_parts. NFC
Luke Lau via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 11:31:01 PDT 2023
luke created this revision.
luke added reviewers: craig.topper, reames, RKSimon.
Herald added subscribers: jobnoorman, asb, sunshaoce, pmatos, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, arichardson.
Herald added a project: All.
luke requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, eopXD, MaskRay.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D159302
Files:
llvm/test/CodeGen/RISCV/rvv/splat-vector-split-i64-vl-sdnode.ll
Index: llvm/test/CodeGen/RISCV/rvv/splat-vector-split-i64-vl-sdnode.ll
===================================================================
--- llvm/test/CodeGen/RISCV/rvv/splat-vector-split-i64-vl-sdnode.ll
+++ llvm/test/CodeGen/RISCV/rvv/splat-vector-split-i64-vl-sdnode.ll
@@ -87,3 +87,51 @@
%4 = trunc i64 %3 to i32
ret i32 %4
}
+
+define <vscale x 2 x i64> @demanded_bits_lo(i64 %x) {
+; CHECK-LABEL: demanded_bits_lo:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi sp, sp, -16
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: sw a1, 4(sp)
+; CHECK-NEXT: sw a0, 0(sp)
+; CHECK-NEXT: mv a0, sp
+; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
+; CHECK-NEXT: vlse64.v v8, (a0), zero
+; CHECK-NEXT: sw zero, 12(sp)
+; CHECK-NEXT: li a0, -1
+; CHECK-NEXT: sw a0, 8(sp)
+; CHECK-NEXT: addi a0, sp, 8
+; CHECK-NEXT: vlse64.v v10, (a0), zero
+; CHECK-NEXT: vand.vv v8, v8, v10
+; CHECK-NEXT: addi sp, sp, 16
+; CHECK-NEXT: ret
+ %1 = insertelement <vscale x 2 x i64> poison, i64 %x, i32 0
+ %2 = shufflevector <vscale x 2 x i64> %1, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
+ %3 = and <vscale x 2 x i64> %2, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i64 u0xffffffff, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
+ ret <vscale x 2 x i64> %3
+}
+
+define <vscale x 2 x i64> @demanded_bits_hi(i64 %x) {
+; CHECK-LABEL: demanded_bits_hi:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addi sp, sp, -16
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: sw a1, 4(sp)
+; CHECK-NEXT: sw a0, 0(sp)
+; CHECK-NEXT: mv a0, sp
+; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
+; CHECK-NEXT: vlse64.v v8, (a0), zero
+; CHECK-NEXT: li a0, -1
+; CHECK-NEXT: sw a0, 12(sp)
+; CHECK-NEXT: sw zero, 8(sp)
+; CHECK-NEXT: addi a0, sp, 8
+; CHECK-NEXT: vlse64.v v10, (a0), zero
+; CHECK-NEXT: vand.vv v8, v8, v10
+; CHECK-NEXT: addi sp, sp, 16
+; CHECK-NEXT: ret
+ %1 = insertelement <vscale x 2 x i64> poison, i64 %x, i32 0
+ %2 = shufflevector <vscale x 2 x i64> %1, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
+ %3 = and <vscale x 2 x i64> %2, shufflevector(<vscale x 2 x i64> insertelement(<vscale x 2 x i64> poison, i64 u0xffffffff00000000, i32 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer)
+ ret <vscale x 2 x i64> %3
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159302.555116.patch
Type: text/x-patch
Size: 2427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230831/f894caf1/attachment.bin>
More information about the llvm-commits
mailing list