You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/vector-deinterleave-load.ll
+161Lines changed: 161 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -538,3 +538,164 @@ define { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x
538
538
%res7 = insertvalue { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } %res6, <vscale x 8 x i8> %t7, 7
539
539
ret { <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8> } %res7
540
540
}
541
+
542
+
define {<vscale x 16 x i8>, <vscale x 16 x i8>} @masked_load_factor2(ptr%p) {
543
+
; CHECK-LABEL: masked_load_factor2:
544
+
; CHECK: # %bb.0:
545
+
; CHECK-NEXT: vl4r.v v12, (a0)
546
+
; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
547
+
; CHECK-NEXT: vnsrl.wi v8, v12, 0
548
+
; CHECK-NEXT: vnsrl.wi v10, v12, 8
549
+
; CHECK-NEXT: ret
550
+
%vec = call <vscale x 32 x i8> @llvm.masked.load(ptr%p, i324, <vscale x 32 x i1> splat (i1true), <vscale x 32 x i8> poison)
551
+
%deinterleaved.results = call {<vscale x 16 x i8>, <vscale x 16 x i8>} @llvm.vector.deinterleave2.nxv32i8(<vscale x 32 x i8> %vec)
552
+
ret {<vscale x 16 x i8>, <vscale x 16 x i8>} %deinterleaved.results
553
+
}
554
+
555
+
define {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @masked_loat_factor4(ptr%p) {
%vec = call <vscale x 32 x i8> @llvm.masked.load(ptr%p, i324, <vscale x 32 x i1> splat (i1true), <vscale x 32 x i8> poison)
577
+
%deinterleaved.results = call {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @llvm.vector.deinterleave4.nxv32i8(<vscale x 32 x i8> %vec)
578
+
ret {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} %deinterleaved.results
579
+
}
580
+
581
+
define {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @masked_loat_factor4_mask(ptr%p, <vscale x 8 x i1> %mask) {
%interleaved.mask = tailcall <vscale x 32 x i1> @llvm.vector.interleave4.nxv32i1(<vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask)
636
+
%vec = call <vscale x 32 x i8> @llvm.masked.load(ptr%p, i324, <vscale x 32 x i1> %interleaved.mask, <vscale x 32 x i8> poison)
637
+
%deinterleaved.results = call {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @llvm.vector.deinterleave4.nxv32i8(<vscale x 32 x i8> %vec)
638
+
ret {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} %deinterleaved.results
639
+
}
640
+
641
+
; Negative test - some of the deinterleaved elements might come from the
642
+
; passthru not the load
643
+
define {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @masked_loat_factor4_passthru(ptr%p, <vscale x 8 x i1> %mask, <vscale x 32 x i8> %passthru) {
%interleaved.mask = tailcall <vscale x 32 x i1> @llvm.vector.interleave4.nxv32i1(<vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask, <vscale x 8 x i1> %mask)
698
+
%vec = call <vscale x 32 x i8> @llvm.masked.load(ptr%p, i324, <vscale x 32 x i1> %interleaved.mask, <vscale x 32 x i8> %passthru)
699
+
%deinterleaved.results = call {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} @llvm.vector.deinterleave4.nxv32i8(<vscale x 32 x i8> %vec)
700
+
ret {<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i8>} %deinterleaved.results
0 commit comments