• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; ModuleID = '<stdin>'
2; RUN: opt < %s -loop-reduce -S | FileCheck %s
3; PR10386
4
5declare i1 @foo()
6declare i8* @bar(i8*,i8*,i8*,i8*)
7
8define void @f(i64* %a,i64* %b,i64* %c,i64* %d,i64* %e,i64* %f,i64* %g) nounwind uwtable {
9entry:
10  br label %b_throw.preheader
11
12D_BREAK_LBL:                                      ; preds = %indirectgoto
13  call i1 @foo()
14  br label %indirectgoto
15
16H_CONST_LBL:                                      ; preds = %indirectgoto
17  call i1 @foo()
18  br label %body_failed
19
20H_MPZ_LBL:                                        ; preds = %indirectgoto
21  %boo3 = call i1 @foo()
22  br i1 %boo3, label %body_failed, label %while.cond.i
23
24while.cond.i:                                     ; preds = %while.body.i15795, %if.then.i15791
25  %phi = phi i64 [ %tmp20916, %while.body.i15795 ], [ 0, %H_MPZ_LBL ]
26  %tmp20916 = add i64 %phi, 1
27  %incdec.ptr.i15793 = getelementptr i64* %pc.0.lcssa.i1610719352, i64 %tmp20916
28  %boo2 = call i1 @foo()
29  br i1 %boo2, label %indirectgoto, label %while.body.i15795
30
31while.body.i15795:                                ; preds = %while.cond.i
32  %tmp20.i = load i64* %incdec.ptr.i15793, align 8
33  %boo1 = call i1 @foo()
34  br i1 %boo1, label %while.cond.i, label %body_failed
35
36b_throw.preheader:                                ; preds = %body_failed, %entry
37  call i1 @foo()
38  br label %indirectgoto
39
40body_failed:
41  %pc.0.lcssa.i1610719364 = phi i64* [ %pc.0.lcssa.i1610719352, %indirectgoto ], [ %pc.0.lcssa.i1610719352, %H_MPZ_LBL ], [ %b, %H_CONST_LBL ], [ %pc.0.lcssa.i1610719352, %while.body.i15795 ]
42  call i1 @foo()
43  br label %b_throw.preheader
44
45indirectgoto:
46  %pc.0.lcssa.i1610719352 = phi i64* [ %pc.0.lcssa.i1610719352, %D_BREAK_LBL ], [ %a, %b_throw.preheader ], [ %d, %while.cond.i ]
47  %p = call i8* @bar(i8* blockaddress(@f, %D_BREAK_LBL), i8* blockaddress(@f, %H_CONST_LBL), i8* blockaddress(@f, %H_MPZ_LBL), i8* blockaddress(@f, %body_failed) )
48  indirectbr i8* %p, [label %D_BREAK_LBL, label %H_CONST_LBL, label %H_MPZ_LBL, label %body_failed]
49}
50
51; CHECK: %p = call i8* @bar(i8* blockaddress(@f, %D_BREAK_LBL), i8* blockaddress(@f, %H_CONST_LBL), i8* blockaddress(@f, %H_MPZ_LBL), i8* blockaddress(@f, %body_failed))
52; CHECK: indirectbr i8* %p, [label %D_BREAK_LBL, label %H_CONST_LBL, label %H_MPZ_LBL, label %body_failed]
53