1 ; RUN: opt < %s -S -analyze -scalar-evolution | FileCheck %s
3 ; Positive and negative tests for inferring flags like nsw from
4 ; reasoning about how a poison value from overflow would trigger
11 ; Example where an add should get the nsw flag, so that a sext can be
12 ; distributed over the add.
13 define void @test-add-nsw(float* %input, i32 %offset, i32 %numIterations) {
14 ; CHECK-LABEL: @test-add-nsw
18 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
21 ; CHECK: --> {%offset,+,1}<nsw>
22 %index32 = add nsw i32 %i, %offset
25 ; CHECK: --> {(sext i32 %offset to i64),+,1}<nsw>
26 %index64 = sext i32 %index32 to i64
28 %ptr = getelementptr inbounds float, float* %input, i64 %index64
29 %nexti = add nsw i32 %i, 1
30 %f = load float, float* %ptr, align 4
32 %exitcond = icmp eq i32 %nexti, %numIterations
33 br i1 %exitcond, label %exit, label %loop
38 ; Example where an add should get the nuw flag.
39 define void @test-add-nuw(float* %input, i32 %offset, i32 %numIterations) {
40 ; CHECK-LABEL: @test-add-nuw
44 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
47 ; CHECK: --> {%offset,+,1}<nuw>
48 %index32 = add nuw i32 %i, %offset
50 %ptr = getelementptr inbounds float, float* %input, i32 %index32
51 %nexti = add nuw i32 %i, 1
52 %f = load float, float* %ptr, align 4
53 %exitcond = icmp eq i32 %nexti, %numIterations
54 br i1 %exitcond, label %exit, label %loop
60 define void @test-add-nuw-from-icmp(float* %input, i32 %offset,
62 ; CHECK-LABEL: @test-add-nuw-from-icmp
66 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
69 ; CHECK: --> {%offset,+,1}<nuw>
70 %index32 = add nuw i32 %i, %offset
71 %cmp = icmp sgt i32 %index32, 0
72 %cmp.idx = sext i1 %cmp to i32
74 %ptr = getelementptr inbounds float, float* %input, i32 %cmp.idx
75 %nexti = add nuw i32 %i, 1
76 %f = load float, float* %ptr, align 4
77 %exitcond = icmp eq i32 %nexti, %numIterations
78 br i1 %exitcond, label %exit, label %loop
84 ; With no load to trigger UB from poison, we cannot infer nsw.
85 define void @test-add-no-load(float* %input, i32 %offset, i32 %numIterations) {
86 ; CHECK-LABEL: @test-add-no-load
90 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
93 ; CHECK: --> {%offset,+,1}<nw>
94 %index32 = add nsw i32 %i, %offset
96 %ptr = getelementptr inbounds float, float* %input, i32 %index32
97 %nexti = add nuw i32 %i, 1
98 %exitcond = icmp eq i32 %nexti, %numIterations
99 br i1 %exitcond, label %exit, label %loop
105 ; The current code is only supposed to look at the loop header, so
106 ; it should not infer nsw in this case, as that would require looking
107 ; outside the loop header.
108 define void @test-add-not-header(float* %input, i32 %offset, i32 %numIterations) {
109 ; CHECK-LABEL: @test-add-not-header
113 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
118 ; CHECK: --> {%offset,+,1}<nw>
119 %index32 = add nsw i32 %i, %offset
121 %ptr = getelementptr inbounds float, float* %input, i32 %index32
122 %nexti = add nsw i32 %i, 1
123 %f = load float, float* %ptr, align 4
124 %exitcond = icmp eq i32 %nexti, %numIterations
125 br i1 %exitcond, label %exit, label %loop
130 ; Same thing as test-add-not-header, but in this case only the load
131 ; instruction is outside the loop header.
132 define void @test-add-not-header2(float* %input, i32 %offset, i32 %numIterations) {
133 ; CHECK-LABEL: @test-add-not-header2
137 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
140 ; CHECK: --> {%offset,+,1}<nsw>
141 %index32 = add nsw i32 %i, %offset
143 %ptr = getelementptr inbounds float, float* %input, i32 %index32
144 %nexti = add nsw i32 %i, 1
147 %f = load float, float* %ptr, align 4
148 %exitcond = icmp eq i32 %nexti, %numIterations
149 br i1 %exitcond, label %exit, label %loop
154 ; Similar to test-add-not-header, but in this case the load
155 ; instruction may not be executed.
156 define void @test-add-not-header3(float* %input, i32 %offset, i32 %numIterations,
158 ; CHECK-LABEL: @test-add-not-header3
162 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
165 ; CHECK: --> {%offset,+,1}<nw>
166 %index32 = add nsw i32 %i, %offset
168 %ptr = getelementptr inbounds float, float* %input, i32 %index32
169 %nexti = add nsw i32 %i, 1
170 %cond = load volatile i1, i1* %cond_buf
171 br i1 %cond, label %loop2, label %exit
173 %f = load float, float* %ptr, align 4
174 %exitcond = icmp eq i32 %nexti, %numIterations
175 br i1 %exitcond, label %exit, label %loop
180 ; Same thing as test-add-not-header2, except we have a few extra
182 define void @test-add-not-header4(float* %input, i32 %offset, i32 %numIterations) {
183 ; CHECK-LABEL: @test-add-not-header4
187 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
190 ; CHECK: --> {%offset,+,1}<nsw>
191 %index32 = add nsw i32 %i, %offset
193 %ptr = getelementptr inbounds float, float* %input, i32 %index32
194 %nexti = add nsw i32 %i, 1
201 %f = load float, float* %ptr, align 4
202 %exitcond = icmp eq i32 %nexti, %numIterations
203 br i1 %exitcond, label %exit, label %loop
208 ; Demonstrate why we need a Visited set in llvm::programUndefinedIfFullPoison.
209 define void @test-add-not-header5(float* %input, i32 %offset) {
210 ; CHECK-LABEL: @test-add-not-header5
214 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
217 ; CHECK: --> {%offset,+,1}<nw>
218 %index32 = add nsw i32 %i, %offset
220 %ptr = getelementptr inbounds float, float* %input, i32 %index32
221 %nexti = add nsw i32 %i, 1
228 ; The call instruction makes it not guaranteed that the add will be
229 ; executed, since it could run forever or throw an exception, so we
230 ; cannot assume that the UB is realized.
231 define void @test-add-call(float* %input, i32 %offset, i32 %numIterations) {
232 ; CHECK-LABEL: @test-add-call
236 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
239 ; CHECK: --> {%offset,+,1}<nw>
241 %index32 = add nsw i32 %i, %offset
243 %ptr = getelementptr inbounds float, float* %input, i32 %index32
244 %nexti = add nsw i32 %i, 1
245 %f = load float, float* %ptr, align 4
246 %exitcond = icmp eq i32 %nexti, %numIterations
247 br i1 %exitcond, label %exit, label %loop
252 ; Same issue as test-add-call, but this time the call is between the
253 ; producer of poison and the load that consumes it.
254 define void @test-add-call2(float* %input, i32 %offset, i32 %numIterations) {
255 ; CHECK-LABEL: @test-add-call2
259 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
262 ; CHECK: --> {%offset,+,1}<nw>
263 %index32 = add nsw i32 %i, %offset
265 %ptr = getelementptr inbounds float, float* %input, i32 %index32
266 %nexti = add nsw i32 %i, 1
268 %f = load float, float* %ptr, align 4
269 %exitcond = icmp eq i32 %nexti, %numIterations
270 br i1 %exitcond, label %exit, label %loop
275 ; Any poison input makes getelementptr produce poison
276 define void @test-gep-propagates-poison(float* %input, i32 %offset, i32 %numIterations) {
277 ; CHECK-LABEL: @test-gep-propagates-poison
281 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
284 ; CHECK: --> {%offset,+,1}<nsw>
285 %index32 = add nsw i32 %i, %offset
287 %ptr = getelementptr float, float* %input, i32 %index32
288 %nexti = add nsw i32 %i, 1
289 %f = load float, float* %ptr, align 4
290 %exitcond = icmp eq i32 %nexti, %numIterations
291 br i1 %exitcond, label %exit, label %loop
296 ; Multiplication by a non-zero constant propagates poison if there is
297 ; a nuw or nsw flag on the multiplication.
298 define void @test-add-mul-propagates(float* %input, i32 %offset, i32 %numIterations) {
299 ; CHECK-LABEL: @test-add-mul-propagates
303 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
306 ; CHECK: --> {%offset,+,1}<nsw>
307 %index32 = add nsw i32 %i, %offset
309 %indexmul = mul nuw i32 %index32, 2
310 %ptr = getelementptr inbounds float, float* %input, i32 %indexmul
311 %nexti = add nsw i32 %i, 1
312 %f = load float, float* %ptr, align 4
313 %exitcond = icmp eq i32 %nexti, %numIterations
314 br i1 %exitcond, label %exit, label %loop
319 ; Any poison input to multiplication propages poison.
320 define void @test-mul-propagates-poison(float* %input, i32 %offset, i32 %numIterations) {
321 ; CHECK-LABEL: @test-mul-propagates-poison
325 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
328 ; CHECK: --> {%offset,+,1}<nsw>
329 %index32 = add nsw i32 %i, %offset
331 %indexmul = mul nsw i32 %index32, %offset
332 %ptr = getelementptr inbounds float, float* %input, i32 %indexmul
333 %nexti = add nsw i32 %i, 1
334 %f = load float, float* %ptr, align 4
335 %exitcond = icmp eq i32 %nexti, %numIterations
336 br i1 %exitcond, label %exit, label %loop
341 define void @test-mul-propagates-poison-2(float* %input, i32 %offset, i32 %numIterations) {
342 ; CHECK-LABEL: @test-mul-propagates-poison-2
346 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
349 ; CHECK: --> {%offset,+,1}<nsw>
350 %index32 = add nsw i32 %i, %offset
352 %indexmul = mul i32 %index32, 2
353 %ptr = getelementptr inbounds float, float* %input, i32 %indexmul
354 %nexti = add nsw i32 %i, 1
355 %f = load float, float* %ptr, align 4
356 %exitcond = icmp eq i32 %nexti, %numIterations
357 br i1 %exitcond, label %exit, label %loop
362 ; Division by poison triggers UB.
363 define void @test-add-div(float* %input, i32 %offset, i32 %numIterations) {
364 ; CHECK-LABEL: @test-add-div
368 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
371 ; CHECK: --> {%offset,+,1}<nsw>
372 %j = add nsw i32 %i, %offset
374 %q = sdiv i32 %numIterations, %j
375 %nexti = add nsw i32 %i, 1
376 %exitcond = icmp eq i32 %nexti, %numIterations
377 br i1 %exitcond, label %exit, label %loop
382 ; Remainder of poison by non-poison divisor does not trigger UB.
383 define void @test-add-div2(float* %input, i32 %offset, i32 %numIterations) {
384 ; CHECK-LABEL: @test-add-div2
388 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
391 ; CHECK: --> {%offset,+,1}<nw>
392 %j = add nsw i32 %i, %offset
394 %q = sdiv i32 %j, %numIterations
395 %nexti = add nsw i32 %i, 1
396 %exitcond = icmp eq i32 %nexti, %numIterations
397 br i1 %exitcond, label %exit, label %loop
402 ; Store to poison address triggers UB.
403 define void @test-add-store(float* %input, i32 %offset, i32 %numIterations) {
404 ; CHECK-LABEL: @test-add-store
408 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
411 ; CHECK: --> {%offset,+,1}<nsw>
412 %index32 = add nsw i32 %i, %offset
414 %ptr = getelementptr inbounds float, float* %input, i32 %index32
415 %nexti = add nsw i32 %i, 1
416 store float 1.0, float* %ptr, align 4
417 %exitcond = icmp eq i32 %nexti, %numIterations
418 br i1 %exitcond, label %exit, label %loop
423 ; Three sequential adds where the middle add should have nsw. There is
424 ; a special case for sequential adds and this test covers that. We have to
425 ; put the final add first in the program since otherwise the special case
426 ; is not triggered, hence the strange basic block ordering.
427 define void @test-add-twice(float* %input, i32 %offset, i32 %numIterations) {
428 ; CHECK-LABEL: @test-add-twice
433 ; CHECK: --> {(2 + %offset),+,1}<nw>
434 %seq = add nsw nuw i32 %index32, 1
435 %exitcond = icmp eq i32 %nexti, %numIterations
436 br i1 %exitcond, label %exit, label %loop
439 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
441 %j = add nsw i32 %i, 1
443 ; CHECK: --> {(1 + %offset)<nsw>,+,1}<nsw>
444 %index32 = add nsw i32 %j, %offset
446 %ptr = getelementptr inbounds float, float* %input, i32 %index32
447 %nexti = add nsw i32 %i, 1
448 store float 1.0, float* %ptr, align 4
454 ; Example where a mul should get the nsw flag, so that a sext can be
455 ; distributed over the mul.
456 define void @test-mul-nsw(float* %input, i32 %stride, i32 %numIterations) {
457 ; CHECK-LABEL: @test-mul-nsw
461 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
464 ; CHECK: --> {0,+,%stride}<nsw>
465 %index32 = mul nsw i32 %i, %stride
468 ; CHECK: --> {0,+,(sext i32 %stride to i64)}<nsw>
469 %index64 = sext i32 %index32 to i64
471 %ptr = getelementptr inbounds float, float* %input, i64 %index64
472 %nexti = add nsw i32 %i, 1
473 %f = load float, float* %ptr, align 4
474 %exitcond = icmp eq i32 %nexti, %numIterations
475 br i1 %exitcond, label %exit, label %loop
480 ; Example where a mul should get the nuw flag.
481 define void @test-mul-nuw(float* %input, i32 %stride, i32 %numIterations) {
482 ; CHECK-LABEL: @test-mul-nuw
486 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
489 ; CHECK: --> {0,+,%stride}<nuw>
490 %index32 = mul nuw i32 %i, %stride
492 %ptr = getelementptr inbounds float, float* %input, i32 %index32
493 %nexti = add nuw i32 %i, 1
494 %f = load float, float* %ptr, align 4
495 %exitcond = icmp eq i32 %nexti, %numIterations
496 br i1 %exitcond, label %exit, label %loop
502 ; Example where a shl should get the nsw flag, so that a sext can be
503 ; distributed over the shl.
504 define void @test-shl-nsw(float* %input, i32 %start, i32 %numIterations) {
505 ; CHECK-LABEL: @test-shl-nsw
509 %i = phi i32 [ %nexti, %loop ], [ %start, %entry ]
512 ; CHECK: --> {(256 * %start),+,256}<nsw>
513 %index32 = shl nsw i32 %i, 8
516 ; CHECK: --> {(sext i32 (256 * %start) to i64),+,256}<nsw>
517 %index64 = sext i32 %index32 to i64
519 %ptr = getelementptr inbounds float, float* %input, i64 %index64
520 %nexti = add nsw i32 %i, 1
521 %f = load float, float* %ptr, align 4
522 %exitcond = icmp eq i32 %nexti, %numIterations
523 br i1 %exitcond, label %exit, label %loop
528 ; Example where a shl should get the nuw flag.
529 define void @test-shl-nuw(float* %input, i32 %numIterations) {
530 ; CHECK-LABEL: @test-shl-nuw
534 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
537 ; CHECK: --> {0,+,512}<nuw>
538 %index32 = shl nuw i32 %i, 9
540 %ptr = getelementptr inbounds float, float* %input, i32 %index32
541 %nexti = add nuw i32 %i, 1
542 %f = load float, float* %ptr, align 4
543 %exitcond = icmp eq i32 %nexti, %numIterations
544 br i1 %exitcond, label %exit, label %loop
550 ; Example where a sub should *not* get the nsw flag, because of how
551 ; scalar evolution represents A - B as A + (-B) and -B can wrap even
552 ; in cases where A - B does not.
553 define void @test-sub-no-nsw(float* %input, i32 %start, i32 %sub, i32 %numIterations) {
554 ; CHECK-LABEL: @test-sub-no-nsw
558 %i = phi i32 [ %nexti, %loop ], [ %start, %entry ]
561 ; CHECK: --> {((-1 * %sub) + %start),+,1}<nw>
562 %index32 = sub nsw i32 %i, %sub
563 %index64 = sext i32 %index32 to i64
565 %ptr = getelementptr inbounds float, float* %input, i64 %index64
566 %nexti = add nsw i32 %i, 1
567 %f = load float, float* %ptr, align 4
568 %exitcond = icmp eq i32 %nexti, %numIterations
569 br i1 %exitcond, label %exit, label %loop
574 ; Example where a sub should get the nsw flag as the RHS cannot be the
575 ; minimal signed value.
576 define void @test-sub-nsw(float* %input, i32 %start, i32 %sub, i32 %numIterations) {
577 ; CHECK-LABEL: @test-sub-nsw
579 %halfsub = ashr i32 %sub, 1
582 %i = phi i32 [ %nexti, %loop ], [ %start, %entry ]
585 ; CHECK: --> {((-1 * %halfsub)<nsw> + %start)<nsw>,+,1}<nsw>
586 %index32 = sub nsw i32 %i, %halfsub
587 %index64 = sext i32 %index32 to i64
589 %ptr = getelementptr inbounds float, float* %input, i64 %index64
590 %nexti = add nsw i32 %i, 1
591 %f = load float, float* %ptr, align 4
592 %exitcond = icmp eq i32 %nexti, %numIterations
593 br i1 %exitcond, label %exit, label %loop
598 ; Example where a sub should get the nsw flag, since the LHS is non-negative,
599 ; which implies that the RHS cannot be the minimal signed value.
600 define void @test-sub-nsw-lhs-non-negative(float* %input, i32 %sub, i32 %numIterations) {
601 ; CHECK-LABEL: @test-sub-nsw-lhs-non-negative
605 %i = phi i32 [ %nexti, %loop ], [ 0, %entry ]
608 ; CHECK: --> {(-1 * %sub),+,1}<nsw>
609 %index32 = sub nsw i32 %i, %sub
612 ; CHECK: --> {(-1 * (sext i32 %sub to i64))<nsw>,+,1}<nsw
613 %index64 = sext i32 %index32 to i64
615 %ptr = getelementptr inbounds float, float* %input, i64 %index64
616 %nexti = add nsw i32 %i, 1
617 %f = load float, float* %ptr, align 4
618 %exitcond = icmp eq i32 %nexti, %numIterations
619 br i1 %exitcond, label %exit, label %loop
624 ; Example checking that a sext is pushed onto a sub's operands if the sub is an
625 ; overflow intrinsic.
626 define void @test-sext-sub(float* %input, i32 %sub, i32 %numIterations) {
627 ; CHECK-LABEL: @test-sext-sub
631 %i = phi i32 [ %nexti, %cont ], [ 0, %entry ]
633 ; CHECK: %val = extractvalue { i32, i1 } %ssub, 0
634 ; CHECK: --> {(-1 * %sub),+,1}<nw>
635 %ssub = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %i, i32 %sub)
636 %val = extractvalue { i32, i1 } %ssub, 0
637 %ovfl = extractvalue { i32, i1 } %ssub, 1
638 br i1 %ovfl, label %trap, label %cont
641 tail call void @llvm.trap()
646 ; CHECK: --> {(-1 * (sext i32 %sub to i64))<nsw>,+,1}<nsw
647 %index64 = sext i32 %val to i64
649 %ptr = getelementptr inbounds float, float* %input, i64 %index64
650 %nexti = add nsw i32 %i, 1
651 %f = load float, float* %ptr, align 4
652 %exitcond = icmp eq i32 %nexti, %numIterations
653 br i1 %exitcond, label %exit, label %loop
658 ; Two adds with a sub in the middle and the sub should have nsw. There is
659 ; a special case for sequential adds/subs and this test covers that. We have to
660 ; put the final add first in the program since otherwise the special case
661 ; is not triggered, hence the strange basic block ordering.
662 define void @test-sub-with-add(float* %input, i32 %offset, i32 %numIterations) {
663 ; CHECK-LABEL: @test-sub-with-add
668 ; CHECK: --> {(2 + (-1 * %offset)),+,1}<nw>
669 %seq = add nsw nuw i32 %index32, 1
670 %exitcond = icmp eq i32 %nexti, %numIterations
671 br i1 %exitcond, label %exit, label %loop
674 %i = phi i32 [ %nexti, %loop2 ], [ 0, %entry ]
676 %j = add nsw i32 %i, 1
678 ; CHECK: --> {(1 + (-1 * %offset))<nsw>,+,1}<nsw>
679 %index32 = sub nsw i32 %j, %offset
681 %ptr = getelementptr inbounds float, float* %input, i32 %index32
682 %nexti = add nsw i32 %i, 1
683 store float 1.0, float* %ptr, align 4
690 ; Subtraction of two recurrences. The addition in the SCEV that this
691 ; maps to is NSW, but the negation of the RHS does not since that
692 ; recurrence could be the most negative representable value.
693 define void @subrecurrences(i32 %outer_l, i32 %inner_l, i32 %val) {
694 ; CHECK-LABEL: @subrecurrences
699 %o_idx = phi i32 [ 0, %entry ], [ %o_idx.inc, %outer.be ]
700 %o_idx.inc = add nsw i32 %o_idx, 1
701 %cond = icmp eq i32 %o_idx, %val
702 br i1 %cond, label %inner, label %outer.be
705 %i_idx = phi i32 [ 0, %outer ], [ %i_idx.inc, %inner ]
706 %i_idx.inc = add nsw i32 %i_idx, 1
708 ; CHECK-NEXT: --> {{[{][{]}}-1,+,-1}<nw><%outer>,+,1}<nsw><%inner>
709 %v = sub nsw i32 %i_idx, %o_idx.inc
710 %forub = udiv i32 1, %v
711 %cond2 = icmp eq i32 %i_idx, %inner_l
712 br i1 %cond2, label %outer.be, label %inner
715 %cond3 = icmp eq i32 %o_idx, %outer_l
716 br i1 %cond3, label %exit, label %outer
723 ; PR28932: Don't assert on non-SCEV-able value %2.
724 %struct.anon = type { i8* }
725 @a = common global %struct.anon* null, align 8
726 @b = common global i32 0, align 4
727 declare { i32, i1 } @llvm.ssub.with.overflow.i32(i32, i32)
728 declare void @llvm.trap()
729 define i32 @pr28932() {
731 %.pre = load %struct.anon*, %struct.anon** @a, align 8
732 %.pre7 = load i32, i32* @b, align 4
735 for.cond: ; preds = %cont6, %entry
736 %0 = phi i32 [ %3, %cont6 ], [ %.pre7, %entry ]
737 %1 = phi %struct.anon* [ %.ph, %cont6 ], [ %.pre, %entry ]
738 %tobool = icmp eq %struct.anon* %1, null
739 %2 = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %0, i32 1)
740 %3 = extractvalue { i32, i1 } %2, 0
741 %4 = extractvalue { i32, i1 } %2, 1
742 %idxprom = sext i32 %3 to i64
743 %5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 0
744 %6 = load i8*, i8** %5, align 8
745 %7 = getelementptr inbounds i8, i8* %6, i64 %idxprom
746 %8 = load i8, i8* %7, align 1
747 br i1 %tobool, label %if.else, label %if.then
749 if.then: ; preds = %for.cond
750 br i1 %4, label %trap, label %cont6
752 trap: ; preds = %if.else, %if.then
753 tail call void @llvm.trap()
756 if.else: ; preds = %for.cond
757 br i1 %4, label %trap, label %cont1
759 cont1: ; preds = %if.else
760 %conv5 = sext i8 %8 to i64
761 %9 = inttoptr i64 %conv5 to %struct.anon*
762 store %struct.anon* %9, %struct.anon** @a, align 8
765 cont6: ; preds = %cont1, %if.then
766 %.ph = phi %struct.anon* [ %9, %cont1 ], [ %1, %if.then ]
767 store i32 %3, i32* @b, align 4