1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
3 @__const.test.var_45 = private unnamed_addr constant [2 x i8] c"\D1S", align 1
4 @__const.test.var_101 = private unnamed_addr constant [2 x i8] c"\830", align 1
6 ; Function Attrs: nounwind vscale_range(2,1024)
7 define dso_local void @test(ptr nocapture noundef %var_99) {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: lui a1, %hi(.L__const.test.var_45)
11 ; CHECK-NEXT: addi a1, a1, %lo(.L__const.test.var_45)
12 ; CHECK-NEXT: vsetivli zero, 2, e8, m4, ta, ma
13 ; CHECK-NEXT: vle8.v v8, (a1)
14 ; CHECK-NEXT: li a1, 1
15 ; CHECK-NEXT: vmul.vx v12, v8, a1
16 ; CHECK-NEXT: lui a1, %hi(.L__const.test.var_101)
17 ; CHECK-NEXT: addi a1, a1, %lo(.L__const.test.var_101)
18 ; CHECK-NEXT: vle8.v v16, (a1)
19 ; CHECK-NEXT: vmv.x.s a1, v12
20 ; CHECK-NEXT: csrwi vxrm, 0
21 ; CHECK-NEXT: vmsleu.vx v0, v8, a1
22 ; CHECK-NEXT: vssra.vv v8, v16, v8
23 ; CHECK-NEXT: vmerge.vvm v8, v8, v8, v0
24 ; CHECK-NEXT: vse8.v v8, (a0)
27 %0 = tail call <vscale x 32 x i8> @llvm.riscv.vle.nxv32i8.i64(<vscale x 32 x i8> undef, ptr nonnull @__const.test.var_45, i64 2)
28 %1 = tail call <vscale x 32 x i8> @llvm.riscv.vmul.nxv32i8.i8.i64(<vscale x 32 x i8> undef, <vscale x 32 x i8> %0, i8 1, i64 2)
29 %2 = tail call <vscale x 32 x i8> @llvm.riscv.vle.nxv32i8.i64(<vscale x 32 x i8> undef, ptr nonnull @__const.test.var_101, i64 2)
30 %3 = tail call i64 @llvm.riscv.vsetvli.i64(i64 32, i64 0, i64 2)
31 %4 = tail call i8 @llvm.riscv.vmv.x.s.nxv32i8(<vscale x 32 x i8> %1)
32 %5 = tail call <vscale x 32 x i8> @llvm.riscv.vssra.nxv32i8.nxv32i8.i64(<vscale x 32 x i8> undef, <vscale x 32 x i8> %2, <vscale x 32 x i8> %0, i64 0, i64 2)
33 %6 = tail call <vscale x 32 x i1> @llvm.riscv.vmsleu.nxv32i8.i8.i64(<vscale x 32 x i8> %0, i8 %4, i64 2)
34 %7 = tail call <vscale x 32 x i8> @llvm.riscv.vmerge.nxv32i8.nxv32i8.i64(<vscale x 32 x i8> poison, <vscale x 32 x i8> %5, <vscale x 32 x i8> %5, <vscale x 32 x i1> %6, i64 2)
35 tail call void @llvm.riscv.vse.nxv32i8.i64(<vscale x 32 x i8> %7, ptr %var_99, i64 2)
39 declare <vscale x 32 x i8> @llvm.riscv.vle.nxv32i8.i64(<vscale x 32 x i8>, ptr nocapture, i64) #1
40 declare <vscale x 32 x i8> @llvm.riscv.vmul.nxv32i8.i8.i64(<vscale x 32 x i8>, <vscale x 32 x i8>, i8, i64) #2
41 declare i64 @llvm.riscv.vsetvli.i64(i64, i64 immarg, i64 immarg) #3
42 declare i8 @llvm.riscv.vmv.x.s.nxv32i8(<vscale x 32 x i8>) #2
43 declare <vscale x 32 x i8> @llvm.riscv.vssra.nxv32i8.nxv32i8.i64(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i8>, i64, i64) #3
44 declare <vscale x 32 x i1> @llvm.riscv.vmsleu.nxv32i8.i8.i64(<vscale x 32 x i8>, i8, i64) #2
45 declare <vscale x 32 x i8> @llvm.riscv.vmerge.nxv32i8.nxv32i8.i64(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i64) #2
46 declare void @llvm.riscv.vse.nxv32i8.i64(<vscale x 32 x i8>, ptr nocapture, i64) #4
48 attributes #1 = { nofree nounwind memory(read) }
49 attributes #2 = { nofree nosync nounwind memory(none) }
50 attributes #3 = { nounwind }
51 attributes #4 = { nounwind memory(write) }