It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for...
[oota-llvm.git] / test / Transforms / CorrelatedValuePropagation / 2010-09-26-MergeConstantRange.ll
1 ; ModuleID = 'bugpoint-reduced-simplified.bc'
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
3 target triple = "x86_64-apple-darwin11.0.0"
4
5 %struct.S2 = type {}
6
7 @g_128 = external global %struct.S2, align 1
8 @g_106 = external global i16, align 2
9
10 define void @int328(i16 signext %p_82) noreturn nounwind ssp {
11 entry:
12   %tobool3 = icmp eq i16 %p_82, 0
13   br label %for.cond.outer
14
15 for.cond.outer:                                   ; preds = %for.cond.loopexit, %entry
16   br label %for.cond
17
18 for.cond.loopexit:                                ; preds = %bb.nph, %for.cond9.preheader
19   br label %for.cond.outer
20
21 for.cond.loopexit4.us-lcssa:                      ; preds = %if.then
22   br label %for.cond.loopexit4
23
24 for.cond.loopexit4:                               ; preds = %for.cond.loopexit4.us-lcssa.us, %for.cond.loopexit4.us-lcssa
25   br label %for.cond.backedge
26
27 for.cond:                                         ; preds = %for.cond.backedge, %for.cond.outer
28   br i1 %tobool3, label %for.cond.split.us, label %for.cond.for.cond.split_crit_edge
29
30 for.cond.for.cond.split_crit_edge:                ; preds = %for.cond
31   br label %lbl_133
32
33 for.cond.split.us:                                ; preds = %for.cond
34   br label %lbl_133.us
35
36 lbl_133.us:                                       ; preds = %lbl_134.us, %for.cond.split.us
37   br i1 undef, label %if.else14.us-lcssa.us, label %if.then.us
38
39 lbl_134.us:                                       ; preds = %if.then.us
40   br i1 icmp eq (i16 ptrtoint (%struct.S2* @g_128 to i16), i16 0), label %for.cond9.preheader.us-lcssa.us, label %lbl_133.us
41
42 if.then.us:                                       ; preds = %lbl_133.us
43   br i1 true, label %for.cond.loopexit4.us-lcssa.us, label %lbl_134.us
44
45 if.else14.us-lcssa.us:                            ; preds = %lbl_133.us
46   br label %if.else14
47
48 for.cond9.preheader.us-lcssa.us:                  ; preds = %lbl_134.us
49   br label %for.cond9.preheader
50
51 for.cond.loopexit4.us-lcssa.us:                   ; preds = %if.then.us
52   br label %for.cond.loopexit4
53
54 lbl_133:                                          ; preds = %lbl_134, %for.cond.for.cond.split_crit_edge
55   %l_109.0 = phi i16 [ 0, %for.cond.for.cond.split_crit_edge ], [ ptrtoint (%struct.S2* @g_128 to i16), %lbl_134 ]
56   %tobool = icmp eq i32 undef, 0
57   br i1 %tobool, label %if.else14.us-lcssa, label %if.then
58
59 if.then:                                          ; preds = %lbl_133
60   br i1 false, label %for.cond.loopexit4.us-lcssa, label %lbl_134
61
62 lbl_134:                                          ; preds = %if.then
63   br i1 icmp eq (i16 ptrtoint (%struct.S2* @g_128 to i16), i16 0), label %for.cond9.preheader.us-lcssa, label %lbl_133
64
65 for.cond9.preheader.us-lcssa:                     ; preds = %lbl_134
66   br label %for.cond9.preheader
67
68 for.cond9.preheader:                              ; preds = %for.cond9.preheader.us-lcssa, %for.cond9.preheader.us-lcssa.us
69   br i1 undef, label %bb.nph, label %for.cond.loopexit
70
71 bb.nph:                                           ; preds = %for.cond9.preheader
72   br label %for.cond.loopexit
73
74 if.else14.us-lcssa:                               ; preds = %lbl_133
75   br label %if.else14
76
77 if.else14:                                        ; preds = %if.else14.us-lcssa, %if.else14.us-lcssa.us
78   %l_109.0.lcssa = phi i16 [ %l_109.0, %if.else14.us-lcssa ], [ 0, %if.else14.us-lcssa.us ]
79   store i16 undef, i16* @g_106, align 2
80   br label %for.cond.backedge
81
82 for.cond.backedge:                                ; preds = %if.else14, %for.cond.loopexit4
83   br label %for.cond
84 }