1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s
define void @foo(i16 %finder_idx) {
; CHECK-LABEL: foo:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: .LBB0_1: # %for.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: slli a0, a0, 48
; CHECK-NEXT: bltz a0, .LBB0_4
; CHECK-NEXT: # %bb.2: # %while.cond.preheader.i
; CHECK-NEXT: # in Loop: Header=BB0_1 Depth=1
; CHECK-NEXT: li a0, 0
; CHECK-NEXT: bnez zero, .LBB0_1
; CHECK-NEXT: # %bb.3: # %while.body
; CHECK-NEXT: .LBB0_4: # %while.cond1.preheader.i
entry:
br label %for.body
for.body:
%info = phi i16 [ 0, %if.then ], [ %finder_idx, %entry ]
%cmp.i = icmp sgt i16 %info, -1
%tobool = icmp eq ptr poison, null
br i1 %cmp.i, label %while.cond.preheader.i, label %while.cond1.preheader.i
while.cond1.preheader.i:
unreachable
while.cond.preheader.i:
br label %exit
exit:
br i1 %tobool, label %exit1, label %while.body
while.body:
unreachable
exit1:
br label %if.then
if.then:
br label %for.body
}
define void @bar(i16 %finder_idx) {
; CHECK-LABEL: bar:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: .LBB1_1: # %for.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: slli a0, a0, 48
; CHECK-NEXT: bgez a0, .LBB1_4
; CHECK-NEXT: # %bb.2: # %while.cond.preheader.i
; CHECK-NEXT: # in Loop: Header=BB1_1 Depth=1
; CHECK-NEXT: li a0, 0
; CHECK-NEXT: bnez zero, .LBB1_1
; CHECK-NEXT: # %bb.3: # %while.body
; CHECK-NEXT: .LBB1_4: # %while.cond1.preheader.i
entry:
br label %for.body
for.body:
%info = phi i16 [ 0, %if.then ], [ %finder_idx, %entry ]
%cmp.i = icmp sle i16 %info, -1
%tobool = icmp eq ptr poison, null
br i1 %cmp.i, label %while.cond.preheader.i, label %while.cond1.preheader.i
while.cond1.preheader.i:
unreachable
while.cond.preheader.i:
br label %exit
exit:
br i1 %tobool, label %exit1, label %while.body
while.body:
unreachable
exit1:
br label %if.then
if.then:
br label %for.body
}
|