1 ; RUN: opt -jump-threading -S < %s | FileCheck %s
2 @a = common dso_local local_unnamed_addr global i16 0, align 2
4 ; Function Attrs: nofree norecurse nounwind
5 define internal fastcc void @s() unnamed_addr {
7 ; CHECK-NEXT: for.cond1.preheader.lr.ph:
8 ; CHECK-NEXT: br label [[FOR_COND1_PREHEADER:%.*]]
9 ; CHECK: for.cond1.preheader:
10 ; CHECK-NEXT: [[DOTPR_I_19:%.*]] = phi i32 [ undef, [[FOR_COND1_PREHEADER_LR_PH:%.*]] ], [ 0, [[FOR_INC_SPLIT_1:%.*]] ]
11 ; CHECK-NEXT: [[TMP0:%.*]] = phi i16 [ undef, [[FOR_COND1_PREHEADER_LR_PH]] ], [ [[INC9:%.*]], [[FOR_INC_SPLIT_1]] ]
12 ; CHECK-NEXT: [[TOBOOL4_I:%.*]] = icmp eq i32 [[DOTPR_I_19]], 0
13 ; CHECK-NEXT: br i1 [[TOBOOL4_I]], label [[FOR_INC_SPLIT_1]], label [[FOR_BODY_LR_PH_I:%.*]]
14 ; CHECK: for.body.lr.ph.i:
15 ; CHECK-NEXT: ret void
16 ; CHECK: for.cond.for.end10_crit_edge:
17 ; CHECK-NEXT: ret void
18 ; CHECK: for.inc.split.1:
19 ; CHECK-NEXT: [[INC9]] = add i16 [[TMP0]], 1
20 ; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i16 [[INC9]], 0
21 ; CHECK-NEXT: br i1 [[TOBOOL]], label [[FOR_COND_FOR_END10_CRIT_EDGE:%.*]], label [[FOR_COND1_PREHEADER]]
23 for.cond1.preheader.lr.ph:
24 br label %for.cond1.preheader
26 for.cond1.preheader: ; preds = %for.inc.split.1, %for.cond1.preheader.lr.ph
27 %.pr.i.19 = phi i32 [ undef, %for.cond1.preheader.lr.ph ], [ 0, %for.inc.split.1 ]
28 %0 = phi i16 [ undef, %for.cond1.preheader.lr.ph ], [ %inc9, %for.inc.split.1 ]
29 %tobool4.i = icmp eq i32 %.pr.i.19, 0
30 br i1 %tobool4.i, label %t.exit, label %for.body.lr.ph.i
32 for.body.lr.ph.i: ; preds = %for.cond1.preheader
35 t.exit: ; preds = %for.cond1.preheader
36 br label %for.inc.split
38 for.inc.split: ; preds = %t.exit
39 %tobool4.i.1 = icmp eq i32 %.pr.i.19, 0
40 br i1 %tobool4.i.1, label %for.inc.split.1, label %for.body.lr.ph.i.1
42 for.cond.for.end10_crit_edge: ; preds = %for.inc.split.1
45 for.body.lr.ph.i.1: ; preds = %for.inc.split
46 br label %for.body.lr.ph.split.i.1
48 for.body.lr.ph.split.i.1: ; preds = %for.body.lr.ph.i.1
49 br label %for.body.preheader.i.1
51 for.body.preheader.i.1: ; preds = %for.body.lr.ph.split.i.1
52 br label %for.body.i.us.1.preheader
54 for.body.i.us.1.preheader: ; preds = %for.body.preheader.i.1
55 br label %for.body.i.us.1
57 for.body.i.us.1: ; preds = %lor.end.i.us.1, %for.body.i.us.1.preheader
58 %.b.i.us.1 = phi i1 [ %spec.select44.i.us.1, %lor.end.i.us.1 ], [ undef, %for.body.i.us.1.preheader ]
59 br i1 %.b.i.us.1, label %lor.end.i.us.1, label %lor.rhs.i.us.1
61 lor.rhs.i.us.1: ; preds = %for.body.i.us.1
62 %conv5.i.us.1 = trunc i32 undef to i8
63 br label %lor.end.i.us.1
65 lor.end.i.us.1: ; preds = %lor.rhs.i.us.1, %for.body.i.us.1
66 %.b31.i.us.1 = or i1 undef, %.b.i.us.1
67 %spec.select44.i.us.1 = or i1 undef, %.b31.i.us.1
68 br i1 undef, label %for.end18.loopexit42.i.1.loopexit, label %for.body.i.us.1
70 for.end18.loopexit42.i.1.loopexit: ; preds = %lor.end.i.us.1
71 br label %for.end18.loopexit42.i.1
73 for.end18.loopexit42.i.1: ; preds = %for.end18.loopexit42.i.1.loopexit
74 br label %for.inc.split.1
76 for.inc.split.1: ; preds = %for.end18.loopexit42.i.1, %for.inc.split
78 %tobool = icmp eq i16 %inc9, 0
79 br i1 %tobool, label %for.cond.for.end10_crit_edge, label %for.cond1.preheader