1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=riscv64 -mattr=+v,+f,+m,+zfh,+zvfh \
3 ; RUN: < %s | FileCheck %s
5 declare <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8>, i64 immarg)
6 declare <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8>, <16 x i8>, i64 immarg)
7 declare <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8>, <vscale x 8 x i8>, i64, i64, i64 immarg)
8 declare <vscale x 2 x i32> @llvm.vector.insert.nxv2i32.v4i32(<vscale x 2 x i32>, <4 x i32>, i64 immarg)
10 define void @foo(<vscale x 8 x i8> %0) {
13 ; CHECK-NEXT: addi sp, sp, -32
14 ; CHECK-NEXT: .cfi_def_cfa_offset 32
15 ; CHECK-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
16 ; CHECK-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
17 ; CHECK-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
18 ; CHECK-NEXT: .cfi_offset ra, -8
19 ; CHECK-NEXT: .cfi_offset s0, -16
20 ; CHECK-NEXT: .cfi_offset s1, -24
21 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
22 ; CHECK-NEXT: vmv.v.i v9, 0
23 ; CHECK-NEXT: vsetivli zero, 0, e8, m1, tu, ma
24 ; CHECK-NEXT: vslideup.vi v9, v10, 0
25 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
26 ; CHECK-NEXT: vmv.x.s s0, v9
27 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, tu, ma
28 ; CHECK-NEXT: vslideup.vi v8, v9, 0
29 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
30 ; CHECK-NEXT: vmv.x.s s1, v8
31 ; CHECK-NEXT: .LBB0_1: # =>This Inner Loop Header: Depth=1
32 ; CHECK-NEXT: li a1, 0
33 ; CHECK-NEXT: mv a0, s0
34 ; CHECK-NEXT: mv a2, s1
35 ; CHECK-NEXT: li a3, 0
36 ; CHECK-NEXT: li a4, 0
37 ; CHECK-NEXT: li a5, 0
39 ; CHECK-NEXT: j .LBB0_1
40 %2 = tail call <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8> undef, <16 x i8> undef, i64 0)
41 %3 = tail call <vscale x 8 x i8> @llvm.vector.insert.nxv8i8.v16i8(<vscale x 8 x i8> undef, <16 x i8> poison, i64 0)
45 %5 = tail call <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8> zeroinitializer, <vscale x 8 x i8> %2, i64 0, i64 0, i64 0)
46 %6 = tail call <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8> %5, i64 0)
47 %7 = bitcast <16 x i8> %6 to <2 x i64>
48 %8 = extractelement <2 x i64> %7, i64 0
49 %9 = insertvalue [2 x i64] zeroinitializer, i64 %8, 0
50 %10 = tail call <vscale x 8 x i8> @llvm.riscv.vslideup.nxv8i8.i64(<vscale x 8 x i8> %0, <vscale x 8 x i8> %3, i64 0, i64 0, i64 0)
51 %11 = tail call <16 x i8> @llvm.vector.extract.v16i8.nxv8i8(<vscale x 8 x i8> %10, i64 0)
52 %12 = bitcast <16 x i8> %11 to <2 x i64>
53 %13 = extractelement <2 x i64> %12, i64 0
54 %14 = insertvalue [2 x i64] zeroinitializer, i64 %13, 0
55 %15 = tail call fastcc [2 x i64] null([2 x i64] %9, [2 x i64] %14, [2 x i64] zeroinitializer)