1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple riscv32 -mattr=+m,+v < %s \
5 define i32 @vscale_zero() nounwind {
6 ; CHECK-LABEL: vscale_zero:
7 ; CHECK: # %bb.0: # %entry
11 %0 = call i32 @llvm.vscale.i32()
16 define i32 @vscale_one() nounwind {
17 ; CHECK-LABEL: vscale_one:
18 ; CHECK: # %bb.0: # %entry
19 ; CHECK-NEXT: csrr a0, vlenb
20 ; CHECK-NEXT: srli a0, a0, 3
23 %0 = call i32 @llvm.vscale.i32()
28 define i32 @vscale_uimmpow2xlen() nounwind {
29 ; CHECK-LABEL: vscale_uimmpow2xlen:
30 ; CHECK: # %bb.0: # %entry
31 ; CHECK-NEXT: csrr a0, vlenb
32 ; CHECK-NEXT: slli a0, a0, 3
35 %0 = call i32 @llvm.vscale.i32()
40 define i32 @vscale_non_pow2() nounwind {
41 ; CHECK-LABEL: vscale_non_pow2:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: csrr a0, vlenb
44 ; CHECK-NEXT: slli a1, a0, 1
45 ; CHECK-NEXT: add a0, a1, a0
48 %0 = call i32 @llvm.vscale.i32()
53 declare i32 @llvm.vscale.i32()