1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=riscv32 -O2 -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -O2 -verify-machineinstrs < %s | FileCheck %s
5 define void @u_case1_a(ptr %a, i32 signext %b, ptr %c, ptr %d) {
6 ; CHECK-LABEL: u_case1_a:
8 ; CHECK-NEXT: li a4, 32
9 ; CHECK-NEXT: sw a4, 0(a0)
10 ; CHECK-NEXT: bgeu a1, a4, .LBB0_2
11 ; CHECK-NEXT: # %bb.1: # %block1
12 ; CHECK-NEXT: sw a1, 0(a2)
14 ; CHECK-NEXT: .LBB0_2: # %block2
15 ; CHECK-NEXT: li a0, 87
16 ; CHECK-NEXT: sw a0, 0(a3)
19 %p = icmp ule i32 %b, 31
20 br i1 %p, label %block1, label %block2
30 end_block: ; preds = %block2, %block1
34 define void @case1_a(ptr %a, i32 signext %b, ptr %c, ptr %d) {
35 ; CHECK-LABEL: case1_a:
37 ; CHECK-NEXT: li a4, -1
38 ; CHECK-NEXT: sw a4, 0(a0)
39 ; CHECK-NEXT: bge a1, a4, .LBB1_2
40 ; CHECK-NEXT: # %bb.1: # %block1
41 ; CHECK-NEXT: sw a1, 0(a2)
43 ; CHECK-NEXT: .LBB1_2: # %block2
44 ; CHECK-NEXT: li a0, 87
45 ; CHECK-NEXT: sw a0, 0(a3)
48 %p = icmp sle i32 %b, -2
49 br i1 %p, label %block1, label %block2
59 end_block: ; preds = %block2, %block1
63 define void @u_case2_a(ptr %a, i32 signext %b, ptr %c, ptr %d) {
64 ; CHECK-LABEL: u_case2_a:
66 ; CHECK-NEXT: li a4, 32
67 ; CHECK-NEXT: sw a4, 0(a0)
68 ; CHECK-NEXT: bgeu a4, a1, .LBB2_2
69 ; CHECK-NEXT: # %bb.1: # %block1
70 ; CHECK-NEXT: sw a1, 0(a2)
72 ; CHECK-NEXT: .LBB2_2: # %block2
73 ; CHECK-NEXT: li a0, 87
74 ; CHECK-NEXT: sw a0, 0(a3)
77 %p = icmp uge i32 %b, 33
78 br i1 %p, label %block1, label %block2
88 end_block: ; preds = %block2, %block1
92 define void @case2_a(ptr %a, i32 signext %b, ptr %c, ptr %d) {
93 ; CHECK-LABEL: case2_a:
95 ; CHECK-NEXT: li a4, -4
96 ; CHECK-NEXT: sw a4, 0(a0)
97 ; CHECK-NEXT: bge a4, a1, .LBB3_2
98 ; CHECK-NEXT: # %bb.1: # %block1
99 ; CHECK-NEXT: sw a1, 0(a2)
101 ; CHECK-NEXT: .LBB3_2: # %block2
102 ; CHECK-NEXT: li a0, 87
103 ; CHECK-NEXT: sw a0, 0(a3)
106 %p = icmp sge i32 %b, -3
107 br i1 %p, label %block1, label %block2
117 end_block: ; preds = %block2, %block1