testb-je-fusion.ll
16.4 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefix=NOFUSION_NOPOSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefix=BRANCHFUSION_NOPOSTRA --check-prefix=BRANCHFUSIONONLY_NOPOSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -post-RA-scheduler=0 | FileCheck %s --check-prefix=BRANCHFUSION_NOPOSTRA --check-prefix=MACROFUSION_NOPOSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=NOFUSION_POSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=BRANCHFUSION_POSTRA --check-prefix=BRANCHFUSIONONLY_POSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -post-RA-scheduler=1 | FileCheck %s --check-prefix=BRANCHFUSION_POSTRA --check-prefix=MACROFUSION_POSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,-branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=NOFUSION_MISCHEDPOSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=-macrofusion,+branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=BRANCHFUSION_MISCHEDPOSTRA --check-prefix=BRANCHFUSIONONLY_MISCHEDPOSTRA
; RUN: llc < %s -mtriple=x86_64-- -mattr=+macrofusion,-branchfusion -enable-misched=0 -misched-postra=1 -enable-post-misched | FileCheck %s --check-prefix=BRANCHFUSION_MISCHEDPOSTRA --check-prefix=MACROFUSION_MISCHEDPOSTRA
; testb should be scheduled right before je to enable macro-fusion.
define i32 @macrofuse_test_je(i32 %flags, i8* %p) nounwind {
; NOFUSION_NOPOSTRA-LABEL: macrofuse_test_je:
; NOFUSION_NOPOSTRA: # %bb.0: # %entry
; NOFUSION_NOPOSTRA-NEXT: xorl %eax, %eax
; NOFUSION_NOPOSTRA-NEXT: testl $512, %edi # imm = 0x200
; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_NOPOSTRA-NEXT: je .LBB0_2
; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax
; NOFUSION_NOPOSTRA-NEXT: .LBB0_2: # %if.end
; NOFUSION_NOPOSTRA-NEXT: retq
;
; BRANCHFUSION_NOPOSTRA-LABEL: macrofuse_test_je:
; BRANCHFUSION_NOPOSTRA: # %bb.0: # %entry
; BRANCHFUSION_NOPOSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_NOPOSTRA-NEXT: testl $512, %edi # imm = 0x200
; BRANCHFUSION_NOPOSTRA-NEXT: je .LBB0_2
; BRANCHFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_NOPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_NOPOSTRA-NEXT: .LBB0_2: # %if.end
; BRANCHFUSION_NOPOSTRA-NEXT: retq
;
; NOFUSION_POSTRA-LABEL: macrofuse_test_je:
; NOFUSION_POSTRA: # %bb.0: # %entry
; NOFUSION_POSTRA-NEXT: xorl %eax, %eax
; NOFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200
; NOFUSION_POSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_POSTRA-NEXT: je .LBB0_2
; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_POSTRA-NEXT: movl $1, %eax
; NOFUSION_POSTRA-NEXT: .LBB0_2: # %if.end
; NOFUSION_POSTRA-NEXT: retq
;
; BRANCHFUSION_POSTRA-LABEL: macrofuse_test_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
; BRANCHFUSION_POSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_POSTRA-NEXT: testl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: je .LBB0_2
; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_POSTRA-NEXT: .LBB0_2: # %if.end
; BRANCHFUSION_POSTRA-NEXT: retq
;
; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_test_je:
; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; NOFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: testl $512, %edi # imm = 0x200
; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB0_2
; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB0_2: # %if.end
; NOFUSION_MISCHEDPOSTRA-NEXT: retq
;
; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_test_je:
; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: testl $512, %edi # imm = 0x200
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB0_2
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB0_2: # %if.end
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq
entry:
%and = and i32 %flags, 512
%tobool = icmp eq i32 %and, 0
store i8 1, i8* %p
br i1 %tobool, label %if.end, label %if.then
if.then:
br label %if.end
if.end:
%hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
ret i32 %hasflag
}
define i32 @macrofuse_cmp_je(i32 %flags, i8* %p) nounwind {
; NOFUSION_NOPOSTRA-LABEL: macrofuse_cmp_je:
; NOFUSION_NOPOSTRA: # %bb.0: # %entry
; NOFUSION_NOPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_NOPOSTRA-NEXT: je .LBB1_1
; NOFUSION_NOPOSTRA-NEXT: # %bb.2: # %if.then
; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax
; NOFUSION_NOPOSTRA-NEXT: retq
; NOFUSION_NOPOSTRA-NEXT: .LBB1_1:
; NOFUSION_NOPOSTRA-NEXT: xorl %eax, %eax
; NOFUSION_NOPOSTRA-NEXT: retq
;
; BRANCHFUSION_NOPOSTRA-LABEL: macrofuse_cmp_je:
; BRANCHFUSION_NOPOSTRA: # %bb.0: # %entry
; BRANCHFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_NOPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; BRANCHFUSION_NOPOSTRA-NEXT: je .LBB1_1
; BRANCHFUSION_NOPOSTRA-NEXT: # %bb.2: # %if.then
; BRANCHFUSION_NOPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_NOPOSTRA-NEXT: retq
; BRANCHFUSION_NOPOSTRA-NEXT: .LBB1_1:
; BRANCHFUSION_NOPOSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_NOPOSTRA-NEXT: retq
;
; NOFUSION_POSTRA-LABEL: macrofuse_cmp_je:
; NOFUSION_POSTRA: # %bb.0: # %entry
; NOFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; NOFUSION_POSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_POSTRA-NEXT: je .LBB1_1
; NOFUSION_POSTRA-NEXT: # %bb.2: # %if.then
; NOFUSION_POSTRA-NEXT: movl $1, %eax
; NOFUSION_POSTRA-NEXT: retq
; NOFUSION_POSTRA-NEXT: .LBB1_1:
; NOFUSION_POSTRA-NEXT: xorl %eax, %eax
; NOFUSION_POSTRA-NEXT: retq
;
; BRANCHFUSION_POSTRA-LABEL: macrofuse_cmp_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_POSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; BRANCHFUSION_POSTRA-NEXT: je .LBB1_1
; BRANCHFUSION_POSTRA-NEXT: # %bb.2: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_POSTRA-NEXT: retq
; BRANCHFUSION_POSTRA-NEXT: .LBB1_1:
; BRANCHFUSION_POSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_POSTRA-NEXT: retq
;
; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_cmp_je:
; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; NOFUSION_MISCHEDPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB1_1
; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.2: # %if.then
; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: retq
; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB1_1:
; NOFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: retq
;
; BRANCHFUSION_MISCHEDPOSTRA-LABEL: macrofuse_cmp_je:
; BRANCHFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: cmpl $512, %edi # imm = 0x200
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: je .LBB1_1
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: # %bb.2: # %if.then
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: .LBB1_1:
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: xorl %eax, %eax
; BRANCHFUSION_MISCHEDPOSTRA-NEXT: retq
entry:
%sub = sub i32 %flags, 512
%tobool = icmp eq i32 %sub, 0
store i8 1, i8* %p
br i1 %tobool, label %if.end, label %if.then
if.then:
br label %if.end
if.end:
%hasflag = phi i32 [ 1, %if.then ], [ 0, %entry ]
ret i32 %hasflag
}
define i32 @macrofuse_alu_je(i32 %flags, i8* %p) nounwind {
; NOFUSION_NOPOSTRA-LABEL: macrofuse_alu_je:
; NOFUSION_NOPOSTRA: # %bb.0: # %entry
; NOFUSION_NOPOSTRA-NEXT: movl %edi, %eax
; NOFUSION_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_NOPOSTRA-NEXT: je .LBB2_2
; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax
; NOFUSION_NOPOSTRA-NEXT: .LBB2_2: # %if.end
; NOFUSION_NOPOSTRA-NEXT: retq
;
; BRANCHFUSIONONLY_NOPOSTRA-LABEL: macrofuse_alu_je:
; BRANCHFUSIONONLY_NOPOSTRA: # %bb.0: # %entry
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl %edi, %eax
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: je .LBB2_2
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: .LBB2_2: # %if.end
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: retq
;
; MACROFUSION_NOPOSTRA-LABEL: macrofuse_alu_je:
; MACROFUSION_NOPOSTRA: # %bb.0: # %entry
; MACROFUSION_NOPOSTRA-NEXT: movl %edi, %eax
; MACROFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; MACROFUSION_NOPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; MACROFUSION_NOPOSTRA-NEXT: je .LBB2_2
; MACROFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; MACROFUSION_NOPOSTRA-NEXT: movl $1, %eax
; MACROFUSION_NOPOSTRA-NEXT: .LBB2_2: # %if.end
; MACROFUSION_NOPOSTRA-NEXT: retq
;
; NOFUSION_POSTRA-LABEL: macrofuse_alu_je:
; NOFUSION_POSTRA: # %bb.0: # %entry
; NOFUSION_POSTRA-NEXT: movl %edi, %eax
; NOFUSION_POSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_POSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; NOFUSION_POSTRA-NEXT: je .LBB2_2
; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_POSTRA-NEXT: movl $1, %eax
; NOFUSION_POSTRA-NEXT: .LBB2_2: # %if.end
; NOFUSION_POSTRA-NEXT: retq
;
; BRANCHFUSION_POSTRA-LABEL: macrofuse_alu_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
; BRANCHFUSION_POSTRA-NEXT: movl %edi, %eax
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_POSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; BRANCHFUSION_POSTRA-NEXT: je .LBB2_2
; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_POSTRA-NEXT: .LBB2_2: # %if.end
; BRANCHFUSION_POSTRA-NEXT: retq
;
; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_alu_je:
; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; NOFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB2_2
; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB2_2: # %if.end
; NOFUSION_MISCHEDPOSTRA-NEXT: retq
;
; BRANCHFUSIONONLY_MISCHEDPOSTRA-LABEL: macrofuse_alu_je:
; BRANCHFUSIONONLY_MISCHEDPOSTRA: # %bb.0: # %entry
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: je .LBB2_2
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: .LBB2_2: # %if.end
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: retq
;
; MACROFUSION_MISCHEDPOSTRA-LABEL: macrofuse_alu_je:
; MACROFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; MACROFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; MACROFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; MACROFUSION_MISCHEDPOSTRA-NEXT: addl $-512, %eax # imm = 0xFE00
; MACROFUSION_MISCHEDPOSTRA-NEXT: je .LBB2_2
; MACROFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; MACROFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; MACROFUSION_MISCHEDPOSTRA-NEXT: .LBB2_2: # %if.end
; MACROFUSION_MISCHEDPOSTRA-NEXT: retq
entry:
%sub = sub i32 %flags, 512
%tobool = icmp eq i32 %sub, 0
store i8 1, i8* %p
br i1 %tobool, label %if.end, label %if.then
if.then:
br label %if.end
if.end:
%hasflag = phi i32 [ 1, %if.then ], [ %sub, %entry ]
ret i32 %hasflag
}
define i32 @macrofuse_dec_je(i32 %flags, i8* %p) nounwind {
; NOFUSION_NOPOSTRA-LABEL: macrofuse_dec_je:
; NOFUSION_NOPOSTRA: # %bb.0: # %entry
; NOFUSION_NOPOSTRA-NEXT: movl %edi, %eax
; NOFUSION_NOPOSTRA-NEXT: decl %eax
; NOFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_NOPOSTRA-NEXT: je .LBB3_2
; NOFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_NOPOSTRA-NEXT: movl $1, %eax
; NOFUSION_NOPOSTRA-NEXT: .LBB3_2: # %if.end
; NOFUSION_NOPOSTRA-NEXT: retq
;
; BRANCHFUSIONONLY_NOPOSTRA-LABEL: macrofuse_dec_je:
; BRANCHFUSIONONLY_NOPOSTRA: # %bb.0: # %entry
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl %edi, %eax
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: decl %eax
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: je .LBB3_2
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: .LBB3_2: # %if.end
; BRANCHFUSIONONLY_NOPOSTRA-NEXT: retq
;
; MACROFUSION_NOPOSTRA-LABEL: macrofuse_dec_je:
; MACROFUSION_NOPOSTRA: # %bb.0: # %entry
; MACROFUSION_NOPOSTRA-NEXT: movl %edi, %eax
; MACROFUSION_NOPOSTRA-NEXT: movb $1, (%rsi)
; MACROFUSION_NOPOSTRA-NEXT: decl %eax
; MACROFUSION_NOPOSTRA-NEXT: je .LBB3_2
; MACROFUSION_NOPOSTRA-NEXT: # %bb.1: # %if.then
; MACROFUSION_NOPOSTRA-NEXT: movl $1, %eax
; MACROFUSION_NOPOSTRA-NEXT: .LBB3_2: # %if.end
; MACROFUSION_NOPOSTRA-NEXT: retq
;
; NOFUSION_POSTRA-LABEL: macrofuse_dec_je:
; NOFUSION_POSTRA: # %bb.0: # %entry
; NOFUSION_POSTRA-NEXT: movl %edi, %eax
; NOFUSION_POSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_POSTRA-NEXT: decl %eax
; NOFUSION_POSTRA-NEXT: je .LBB3_2
; NOFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_POSTRA-NEXT: movl $1, %eax
; NOFUSION_POSTRA-NEXT: .LBB3_2: # %if.end
; NOFUSION_POSTRA-NEXT: retq
;
; BRANCHFUSION_POSTRA-LABEL: macrofuse_dec_je:
; BRANCHFUSION_POSTRA: # %bb.0: # %entry
; BRANCHFUSION_POSTRA-NEXT: movl %edi, %eax
; BRANCHFUSION_POSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSION_POSTRA-NEXT: decl %eax
; BRANCHFUSION_POSTRA-NEXT: je .LBB3_2
; BRANCHFUSION_POSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSION_POSTRA-NEXT: movl $1, %eax
; BRANCHFUSION_POSTRA-NEXT: .LBB3_2: # %if.end
; BRANCHFUSION_POSTRA-NEXT: retq
;
; NOFUSION_MISCHEDPOSTRA-LABEL: macrofuse_dec_je:
; NOFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; NOFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: decl %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; NOFUSION_MISCHEDPOSTRA-NEXT: je .LBB3_2
; NOFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; NOFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; NOFUSION_MISCHEDPOSTRA-NEXT: .LBB3_2: # %if.end
; NOFUSION_MISCHEDPOSTRA-NEXT: retq
;
; BRANCHFUSIONONLY_MISCHEDPOSTRA-LABEL: macrofuse_dec_je:
; BRANCHFUSIONONLY_MISCHEDPOSTRA: # %bb.0: # %entry
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: decl %eax
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: je .LBB3_2
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: movl $1, %eax
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: .LBB3_2: # %if.end
; BRANCHFUSIONONLY_MISCHEDPOSTRA-NEXT: retq
;
; MACROFUSION_MISCHEDPOSTRA-LABEL: macrofuse_dec_je:
; MACROFUSION_MISCHEDPOSTRA: # %bb.0: # %entry
; MACROFUSION_MISCHEDPOSTRA-NEXT: movl %edi, %eax
; MACROFUSION_MISCHEDPOSTRA-NEXT: movb $1, (%rsi)
; MACROFUSION_MISCHEDPOSTRA-NEXT: decl %eax
; MACROFUSION_MISCHEDPOSTRA-NEXT: je .LBB3_2
; MACROFUSION_MISCHEDPOSTRA-NEXT: # %bb.1: # %if.then
; MACROFUSION_MISCHEDPOSTRA-NEXT: movl $1, %eax
; MACROFUSION_MISCHEDPOSTRA-NEXT: .LBB3_2: # %if.end
; MACROFUSION_MISCHEDPOSTRA-NEXT: retq
entry:
%sub = sub i32 %flags, 1
%tobool = icmp eq i32 %sub, 0
store i8 1, i8* %p
br i1 %tobool, label %if.end, label %if.then
if.then:
br label %if.end
if.end:
%hasflag = phi i32 [ 1, %if.then ], [ %sub, %entry ]
ret i32 %hasflag
}