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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
| ; RUN: opt -gvn-hoist -S < %s | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@GlobalVar = internal global float 1.000000e+00
; Check that all scalar expressions are hoisted.
;
; CHECK-LABEL: @scalarsHoisting
; CHECK: fsub
; CHECK: fmul
; CHECK: fsub
; CHECK: fmul
; CHECK-NOT: fmul
; CHECK-NOT: fsub
define float @scalarsHoisting(float %d, float %min, float %max, float %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = fsub float %min, %a
%mul = fmul float %sub, %div
%sub1 = fsub float %max, %a
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
%sub3 = fsub float %max, %a
%mul4 = fmul float %sub3, %div
%sub5 = fsub float %min, %a
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that all loads and scalars depending on the loads are hoisted.
; Check that getelementptr computation gets hoisted before the load.
;
; CHECK-LABEL: @readsAndScalarsHoisting
; CHECK: load
; CHECK: load
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK: fsub
; CHECK: fmul
; CHECK-NOT: load
; CHECK-NOT: fmul
; CHECK-NOT: fsub
define float @readsAndScalarsHoisting(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%A = getelementptr float, float* %min, i32 1
%0 = load float, float* %A, align 4
%1 = load float, float* %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%B = getelementptr float, float* %min, i32 1
%5 = load float, float* %B, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we do not hoist loads after a store: the first two loads will be
; hoisted, and then the third load will not be hoisted.
;
; CHECK-LABEL: @readsAndWrites
; CHECK: load
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK: store
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK-NOT: load
; CHECK-NOT: fmul
; CHECK-NOT: fsub
define float @readsAndWrites(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
store float %0, float* @GlobalVar
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we do hoist loads when the store is above the insertion point.
;
; CHECK-LABEL: @readsAndWriteAboveInsertPt
; CHECK: load
; CHECK: load
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK: fsub
; CHECK: fmul
; CHECK-NOT: load
; CHECK-NOT: fmul
; CHECK-NOT: fsub
define float @readsAndWriteAboveInsertPt(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
store float 0.000000e+00, float* @GlobalVar
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that dependent expressions are hoisted.
; CHECK-LABEL: @dependentScalarsHoisting
; CHECK: fsub
; CHECK: fadd
; CHECK: fdiv
; CHECK: fmul
; CHECK-NOT: fsub
; CHECK-NOT: fadd
; CHECK-NOT: fdiv
; CHECK-NOT: fmul
define float @dependentScalarsHoisting(float %a, float %b, i1 %c) {
entry:
br i1 %c, label %if.then, label %if.else
if.then:
%d = fsub float %b, %a
%e = fadd float %d, %a
%f = fdiv float %e, %a
%g = fmul float %f, %a
br label %if.end
if.else:
%h = fsub float %b, %a
%i = fadd float %h, %a
%j = fdiv float %i, %a
%k = fmul float %j, %a
br label %if.end
if.end:
%r = phi float [ %g, %if.then ], [ %k, %if.else ]
ret float %r
}
; Check that all independent expressions are hoisted.
; CHECK-LABEL: @independentScalarsHoisting
; CHECK: fsub
; CHECK: fdiv
; CHECK: fmul
; CHECK: fadd
; CHECK-NOT: fsub
; CHECK-NOT: fdiv
; CHECK-NOT: fmul
define float @independentScalarsHoisting(float %a, float %b, i1 %c) {
entry:
br i1 %c, label %if.then, label %if.else
if.then:
%d = fadd float %b, %a
%e = fsub float %b, %a
%f = fdiv float %b, %a
%g = fmul float %b, %a
br label %if.end
if.else:
%i = fadd float %b, %a
%h = fsub float %b, %a
%j = fdiv float %b, %a
%k = fmul float %b, %a
br label %if.end
if.end:
%p = phi float [ %d, %if.then ], [ %i, %if.else ]
%q = phi float [ %e, %if.then ], [ %h, %if.else ]
%r = phi float [ %f, %if.then ], [ %j, %if.else ]
%s = phi float [ %g, %if.then ], [ %k, %if.else ]
%t = fadd float %p, %q
%u = fadd float %r, %s
%v = fadd float %t, %u
ret float %v
}
; Check that we hoist load and scalar expressions in triangles.
; CHECK-LABEL: @triangleHoisting
; CHECK: load
; CHECK: load
; CHECK: load
; CHECK: fsub
; CHECK: fmul
; CHECK: fsub
; CHECK: fmul
; CHECK-NOT: load
; CHECK-NOT: fmul
; CHECK-NOT: fsub
define float @triangleHoisting(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.end: ; preds = %entry
%p1 = phi float [ %mul2, %if.then ], [ 0.000000e+00, %entry ]
%p2 = phi float [ %mul, %if.then ], [ 0.000000e+00, %entry ]
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
%x = fadd float %p1, %mul6
%y = fadd float %p2, %mul4
%z = fadd float %x, %y
ret float %z
}
; Check that we do not hoist loads past stores within a same basic block.
; CHECK-LABEL: @noHoistInSingleBBWithStore
; CHECK: load
; CHECK: store
; CHECK: load
; CHECK: store
define i32 @noHoistInSingleBBWithStore() {
entry:
%D = alloca i32, align 4
%0 = bitcast i32* %D to i8*
%bf = load i8, i8* %0, align 4
%bf.clear = and i8 %bf, -3
store i8 %bf.clear, i8* %0, align 4
%bf1 = load i8, i8* %0, align 4
%bf.clear1 = and i8 %bf1, 1
store i8 %bf.clear1, i8* %0, align 4
ret i32 0
}
; Check that we do not hoist loads past calls within a same basic block.
; CHECK-LABEL: @noHoistInSingleBBWithCall
; CHECK: load
; CHECK: call
; CHECK: load
declare void @foo()
define i32 @noHoistInSingleBBWithCall() {
entry:
%D = alloca i32, align 4
%0 = bitcast i32* %D to i8*
%bf = load i8, i8* %0, align 4
%bf.clear = and i8 %bf, -3
call void @foo()
%bf1 = load i8, i8* %0, align 4
%bf.clear1 = and i8 %bf1, 1
ret i32 0
}
; Check that we do not hoist loads past stores in any branch of a diamond.
; CHECK-LABEL: @noHoistInDiamondWithOneStore1
; CHECK: fdiv
; CHECK: fcmp
; CHECK: br
define float @noHoistInDiamondWithOneStore1(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
store float 0.000000e+00, float* @GlobalVar
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
; There are no side effects on the if.else branch.
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%6 = load float, float* %max, align 4
%7 = load float, float* %a, align 4
%sub6 = fsub float %6, %7
%mul7 = fmul float %sub6, %div
%8 = load float, float* %min, align 4
%sub8 = fsub float %8, %7
%mul9 = fmul float %sub8, %div
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we do not hoist loads past stores from half diamond.
; CHECK-LABEL: @noHoistInHalfDiamondPastStore
; CHECK: load
; CHECK-NEXT: load
; CHECK-NEXT: store
; CHECK-NEXT: br
; CHECK: load
; CHECK: load
; CHECK: load
; CHECK: br
define float @noHoistInHalfDiamondPastStore(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
; Loads should not be hoisted above this store.
store float 0.000000e+00, float* @GlobalVar
br i1 %cmp, label %if.then, label %if.end
if.then:
; There are no side effects on the if.then branch.
%2 = load float, float* %max, align 4
%3 = load float, float* %a, align 4
%sub3 = fsub float %2, %3
%mul4 = fmul float %sub3, %div
%4 = load float, float* %min, align 4
%sub5 = fsub float %4, %3
%mul6 = fmul float %sub5, %div
br label %if.end
if.end:
%tmax.0 = phi float [ %mul4, %if.then ], [ %0, %entry ]
%tmin.0 = phi float [ %mul6, %if.then ], [ %1, %entry ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we do not hoist loads past a store in any branch of a diamond.
; CHECK-LABEL: @noHoistInDiamondWithOneStore2
; CHECK: fdiv
; CHECK: fcmp
; CHECK: br
define float @noHoistInDiamondWithOneStore2(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
; There are no side effects on the if.then branch.
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %if.end
if.else: ; preds = %entry
store float 0.000000e+00, float* @GlobalVar
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end: ; preds = %if.else, %if.then
%tmax.0 = phi float [ %mul2, %if.then ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %if.then ], [ %mul4, %if.else ]
%6 = load float, float* %max, align 4
%7 = load float, float* %a, align 4
%sub6 = fsub float %6, %7
%mul7 = fmul float %sub6, %div
%8 = load float, float* %min, align 4
%sub8 = fsub float %8, %7
%mul9 = fmul float %sub8, %div
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we do not hoist loads outside a loop containing stores.
; CHECK-LABEL: @noHoistInLoopsWithStores
; CHECK: fdiv
; CHECK: fcmp
; CHECK: br
define float @noHoistInLoopsWithStores(float %d, float* %min, float* %max, float* %a) {
entry:
%div = fdiv float 1.000000e+00, %d
%cmp = fcmp oge float %div, 0.000000e+00
br i1 %cmp, label %do.body, label %if.else
do.body:
%0 = load float, float* %min, align 4
%1 = load float, float* %a, align 4
; It is unsafe to hoist the loads outside the loop because of the store.
store float 0.000000e+00, float* @GlobalVar
%sub = fsub float %0, %1
%mul = fmul float %sub, %div
%2 = load float, float* %max, align 4
%sub1 = fsub float %2, %1
%mul2 = fmul float %sub1, %div
br label %while.cond
while.cond:
%cmp1 = fcmp oge float %mul2, 0.000000e+00
br i1 %cmp1, label %if.end, label %do.body
if.else:
%3 = load float, float* %max, align 4
%4 = load float, float* %a, align 4
%sub3 = fsub float %3, %4
%mul4 = fmul float %sub3, %div
%5 = load float, float* %min, align 4
%sub5 = fsub float %5, %4
%mul6 = fmul float %sub5, %div
br label %if.end
if.end:
%tmax.0 = phi float [ %mul2, %while.cond ], [ %mul6, %if.else ]
%tmin.0 = phi float [ %mul, %while.cond ], [ %mul4, %if.else ]
%add = fadd float %tmax.0, %tmin.0
ret float %add
}
; Check that we hoist stores: all the instructions from the then branch
; should be hoisted.
; CHECK-LABEL: @hoistStores
; CHECK: zext
; CHECK-NEXT: trunc
; CHECK-NEXT: getelementptr
; CHECK-NEXT: load
; CHECK-NEXT: getelementptr
; CHECK-NEXT: getelementptr
; CHECK-NEXT: store
; CHECK-NEXT: load
; CHECK-NEXT: load
; CHECK-NEXT: zext
; CHECK-NEXT: add
; CHECK-NEXT: store
; CHECK-NEXT: br
; CHECK: if.then
; CHECK: br
%struct.foo = type { i16* }
define void @hoistStores(%struct.foo* %s, i32* %coord, i1 zeroext %delta) {
entry:
%frombool = zext i1 %delta to i8
%tobool = trunc i8 %frombool to i1
br i1 %tobool, label %if.then, label %if.else
if.then: ; preds = %entry
%p = getelementptr inbounds %struct.foo, %struct.foo* %s, i32 0, i32 0
%0 = load i16*, i16** %p, align 8
%incdec.ptr = getelementptr inbounds i16, i16* %0, i32 1
store i16* %incdec.ptr, i16** %p, align 8
%1 = load i16, i16* %0, align 2
%conv = zext i16 %1 to i32
%2 = load i32, i32* %coord, align 4
%add = add i32 %2, %conv
store i32 %add, i32* %coord, align 4
br label %if.end
if.else: ; preds = %entry
%p1 = getelementptr inbounds %struct.foo, %struct.foo* %s, i32 0, i32 0
%3 = load i16*, i16** %p1, align 8
%incdec.ptr2 = getelementptr inbounds i16, i16* %3, i32 1
store i16* %incdec.ptr2, i16** %p1, align 8
%4 = load i16, i16* %3, align 2
%conv3 = zext i16 %4 to i32
%5 = load i32, i32* %coord, align 4
%add4 = add i32 %5, %conv3
store i32 %add4, i32* %coord, align 4
%6 = load i16*, i16** %p1, align 8
%incdec.ptr6 = getelementptr inbounds i16, i16* %6, i32 1
store i16* %incdec.ptr6, i16** %p1, align 8
%7 = load i16, i16* %6, align 2
%conv7 = zext i16 %7 to i32
%shl = shl i32 %conv7, 8
%8 = load i32, i32* %coord, align 4
%add8 = add i32 %8, %shl
store i32 %add8, i32* %coord, align 4
br label %if.end
if.end: ; preds = %if.else, %if.then
ret void
}
define i32 @mergeAlignments(i1 %b, i32* %y) {
entry:
br i1 %b, label %if.then, label %if.end
if.then: ; preds = %entry
%l1 = load i32, i32* %y, align 4
br label %return
if.end: ; preds = %entry
%l2 = load i32, i32* %y, align 1
br label %return
return: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ %l1, %if.then ], [ %l2, %if.end ]
ret i32 %retval.0
}
; CHECK-LABEL: define i32 @mergeAlignments(
; CHECK: %[[load:.*]] = load i32, i32* %y, align 1
; CHECK: %[[phi:.*]] = phi i32 [ %[[load]], %{{.*}} ], [ %[[load]], %{{.*}} ]
; CHECK: i32 %[[phi]]
declare i8 @pr30991_f() nounwind readonly
declare void @pr30991_f1(i8)
define i8 @pr30991(i8* %sp, i8* %word, i1 %b1, i1 %b2) {
entry:
br i1 %b1, label %a, label %b
a:
%r0 = load i8, i8* %word, align 1
%incdec.ptr = getelementptr i8, i8* %sp, i32 1
%rr0 = call i8 @pr30991_f() nounwind readonly
call void @pr30991_f1(i8 %r0)
ret i8 %rr0
b:
br i1 %b2, label %c, label %x
c:
%r1 = load i8, i8* %word, align 1
%incdec.ptr115 = getelementptr i8, i8* %sp, i32 1
%rr1 = call i8 @pr30991_f() nounwind readonly
call void @pr30991_f1(i8 %r1)
ret i8 %rr1
x:
%r2 = load i8, i8* %word, align 1
ret i8 %r2
}
; CHECK-LABEL: define i8 @pr30991
; CHECK: %r0 = load i8, i8* %word, align 1
; CHECK-NEXT: br i1 %b1, label %a, label %b
|