compact-branches.ll
4.73 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
; RUN: llc -march=mipsel -mcpu=mips32r6 -relocation-model=static \
; RUN: -disable-mips-delay-filler < %s | FileCheck %s -check-prefix=STATIC32
; RUN: llc -march=mipsel -mcpu=mips64r6 -relocation-model=pic -target-abi n64 \
; RUN: -disable-mips-delay-filler < %s | FileCheck %s -check-prefix=PIC
; Function Attrs: nounwind
define void @l() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
; PIC: jalrc $25
%call1 = tail call i32 @j()
%cmp = icmp eq i32 %call, %call1
; CHECK: bnec
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext -2)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
declare i32 @k()
declare i32 @j()
declare void @f(i32 signext)
; Function Attrs: define void @l2() {
define void @l2() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
; PIC: jalrc $25
%call1 = tail call i32 @i()
%cmp = icmp eq i32 %call, %call1
; CHECK: beqc
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext -1)
br label %if.end
if.end: ; preds = %entry, %if.then
; CHECK: jrc $ra
ret void
}
declare i32 @i()
; Function Attrs: nounwind
define void @l3() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
%cmp = icmp slt i32 %call, 0
; CHECK: bgez
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext 0)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
; Function Attrs: nounwind
define void @l4() {
entry:
%call = tail call i32 @k()
%cmp = icmp slt i32 %call, 1
; CHECK: bgtzc
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
tail call void @f(i32 signext 1)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
; Function Attrs: nounwind
define void @l5() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
; PIC: jalrc $25
%cmp = icmp sgt i32 %call, 0
; CHECK: blezc
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext 2)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
; Function Attrs: nounwind
define void @l6() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
; PIC: jalrc $25
%cmp = icmp sgt i32 %call, -1
; CHECK: bltzc
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext 3)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
; Function Attrs: nounwind
define void @l7() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
%cmp = icmp eq i32 %call, 0
; CHECK: bnezc
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext 4)
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret void
}
; Function Attrs: nounwind
define void @l8() {
entry:
; PIC: jalrc $25
%call = tail call i32 @k()
%cmp = icmp eq i32 %call, 0
; CHECK: beqzc
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %entry:
; STATIC: nop
; STATIC: jal
; PIC: jalrc $25
tail call void @f(i32 signext 5)
br label %if.end
if.end: ; preds = %entry, %if.then
; CHECK: jrc $ra
ret void
}
define i32 @l9(i8* ()* %i) #0 {
entry:
%i.addr = alloca i8* ()*, align 4
store i8* ()* %i, i8* ()** %i.addr, align 4
; STATIC32: jal
; STATIC32: nop
; PIC: jalrc $25
%call = call i32 @k()
; PIC: jalrc $25
%cmp = icmp ne i32 %call, 0
; CHECK: beqzc
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load i8* ()*, i8* ()** %i.addr, align 4
; CHECK: jalrc $25
%call1 = call i8* %0()
br label %if.end
if.end: ; preds = %if.then, %entry
; CHECK: jrc $ra
ret i32 -1
}