1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 define void @foo(i16 %finder_idx) {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: .LBB0_1: # %for.body
9 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
10 ; CHECK-NEXT: slli a0, a0, 48
11 ; CHECK-NEXT: bltz a0, .LBB0_4
12 ; CHECK-NEXT: # %bb.2: # %while.cond.preheader.i
13 ; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
14 ; CHECK-NEXT: li a0, 0
15 ; CHECK-NEXT: bnez zero, .LBB0_1
16 ; CHECK-NEXT: # %bb.3: # %while.body
17 ; CHECK-NEXT: .LBB0_4: # %while.cond1.preheader.i
22 %info = phi i16 [ 0, %if.then ], [ %finder_idx, %entry ]
23 %cmp.i = icmp sgt i16 %info, -1
24 %tobool = icmp eq ptr poison, null
25 br i1 %cmp.i, label %while.cond.preheader.i, label %while.cond1.preheader.i
27 while.cond1.preheader.i:
30 while.cond.preheader.i:
34 br i1 %tobool, label %exit1, label %while.body
46 define void @bar(i16 %finder_idx) {
48 ; CHECK: # %bb.0: # %entry
49 ; CHECK-NEXT: .LBB1_1: # %for.body
50 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
51 ; CHECK-NEXT: slli a0, a0, 48
52 ; CHECK-NEXT: bgez a0, .LBB1_4
53 ; CHECK-NEXT: # %bb.2: # %while.cond.preheader.i
54 ; CHECK-NEXT: # in Loop: Header=BB1_1 Depth=1
55 ; CHECK-NEXT: li a0, 0
56 ; CHECK-NEXT: bnez zero, .LBB1_1
57 ; CHECK-NEXT: # %bb.3: # %while.body
58 ; CHECK-NEXT: .LBB1_4: # %while.cond1.preheader.i
63 %info = phi i16 [ 0, %if.then ], [ %finder_idx, %entry ]
64 %cmp.i = icmp sle i16 %info, -1
65 %tobool = icmp eq ptr poison, null
66 br i1 %cmp.i, label %while.cond.preheader.i, label %while.cond1.preheader.i
68 while.cond1.preheader.i:
71 while.cond.preheader.i:
75 br i1 %tobool, label %exit1, label %while.body