xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/2010-02-23-SingleDefPhiJoin.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s
2*9880d681SAndroid Build Coastguard Worker; PR6363
3*9880d681SAndroid Build Coastguard Worker;
4*9880d681SAndroid Build Coastguard Worker; This test case creates a phi join register with a single definition. The other
5*9880d681SAndroid Build Coastguard Worker; predecessor blocks are implicit-def.
6*9880d681SAndroid Build Coastguard Worker;
7*9880d681SAndroid Build Coastguard Worker; If LiveIntervalAnalysis fails to recognize this as a phi join, the coalescer
8*9880d681SAndroid Build Coastguard Worker; will detect an infinity valno loop.
9*9880d681SAndroid Build Coastguard Worker;
10*9880d681SAndroid Build Coastguard Workertarget 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"
11*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu"
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerdefine i32 @decode(i8* nocapture %input, i32 %offset, i8* nocapture %output) nounwind {
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB86, label %meshBB102
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerbb:                                               ; preds = %meshBB106, %meshBB102
18*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb9, label %meshBB90
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerbb.nph:                                           ; preds = %meshBB90
21*9880d681SAndroid Build Coastguard Worker  br label %meshBB114
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerbb.nph.fragment:                                  ; preds = %meshBB114
24*9880d681SAndroid Build Coastguard Worker  br label %meshBB118
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Workerbb1.fragment:                                     ; preds = %meshBB118
27*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb2, label %bb3
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerbb2:                                              ; preds = %bb1.fragment
30*9880d681SAndroid Build Coastguard Worker  br label %meshBB74
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerbb2.fragment15:                                   ; preds = %meshBB74
33*9880d681SAndroid Build Coastguard Worker  br label %meshBB98
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerbb3:                                              ; preds = %bb1.fragment
36*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB, label %meshBB102
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Workerbb4:                                              ; preds = %meshBB
39*9880d681SAndroid Build Coastguard Worker  br label %meshBB118
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Workerbb4.fragment:                                     ; preds = %meshBB118
42*9880d681SAndroid Build Coastguard Worker  br label %meshBB82
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Workerbb5:                                              ; preds = %meshBB102, %meshBB82
45*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb6, label %bb7
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Workerbb6:                                              ; preds = %bb5
48*9880d681SAndroid Build Coastguard Worker  br label %bb7
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Workerbb7:                                              ; preds = %meshBB98, %bb6, %bb5
51*9880d681SAndroid Build Coastguard Worker  br label %meshBB114
52*9880d681SAndroid Build Coastguard Worker
53*9880d681SAndroid Build Coastguard Workerbb7.fragment:                                     ; preds = %meshBB114
54*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB74, label %bb9
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard Workerbb9:                                              ; preds = %bb7.fragment, %bb
57*9880d681SAndroid Build Coastguard Worker  br label %bb1.i23
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Workerbb1.i23:                                          ; preds = %meshBB110, %bb9
60*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB106, label %meshBB110
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard Workerskip_to_newline.exit26:                           ; preds = %meshBB106
63*9880d681SAndroid Build Coastguard Worker  br label %meshBB86
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerskip_to_newline.exit26.fragment:                  ; preds = %meshBB86
66*9880d681SAndroid Build Coastguard Worker  br i1 false, label %meshBB90, label %meshBB106
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Workerbb11.fragment:                                    ; preds = %meshBB90, %meshBB86
69*9880d681SAndroid Build Coastguard Worker  br label %meshBB122
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Workerbb1.i:                                            ; preds = %meshBB122, %meshBB
72*9880d681SAndroid Build Coastguard Worker  %ooffset.2.lcssa.phi.SV.phi203 = phi i32 [ 0, %meshBB122 ], [ %ooffset.2.lcssa.phi.SV.phi233, %meshBB ] ; <i32> [#uses=1]
73*9880d681SAndroid Build Coastguard Worker  br label %meshBB98
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard Workerbb1.i.fragment:                                   ; preds = %meshBB98
76*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB78, label %meshBB
77*9880d681SAndroid Build Coastguard Worker
78*9880d681SAndroid Build Coastguard Workerskip_to_newline.exit:                             ; preds = %meshBB78
79*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb12, label %meshBB110
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Workerbb12:                                             ; preds = %skip_to_newline.exit
82*9880d681SAndroid Build Coastguard Worker  br label %meshBB94
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard Workerbb12.fragment:                                    ; preds = %meshBB94
85*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb13, label %meshBB78
86*9880d681SAndroid Build Coastguard Worker
87*9880d681SAndroid Build Coastguard Workerbb13:                                             ; preds = %bb12.fragment
88*9880d681SAndroid Build Coastguard Worker  br label %meshBB82
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Workerbb13.fragment:                                    ; preds = %meshBB82
91*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %meshBB94, label %meshBB122
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Workerbb14:                                             ; preds = %meshBB94
94*9880d681SAndroid Build Coastguard Worker  ret i32 %ooffset.2.lcssa.phi.SV.phi250
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard Workerbb15:                                             ; preds = %meshBB122, %meshBB110, %meshBB78
97*9880d681SAndroid Build Coastguard Worker  unreachable
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard WorkermeshBB:                                           ; preds = %bb1.i.fragment, %bb3
100*9880d681SAndroid Build Coastguard Worker  %ooffset.2.lcssa.phi.SV.phi233 = phi i32 [ undef, %bb3 ], [ %ooffset.2.lcssa.phi.SV.phi209, %bb1.i.fragment ] ; <i32> [#uses=1]
101*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb1.i, label %bb4
102*9880d681SAndroid Build Coastguard Worker
103*9880d681SAndroid Build Coastguard WorkermeshBB74:                                         ; preds = %bb7.fragment, %bb2
104*9880d681SAndroid Build Coastguard Worker  br i1 false, label %meshBB118, label %bb2.fragment15
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard WorkermeshBB78:                                         ; preds = %bb12.fragment, %bb1.i.fragment
107*9880d681SAndroid Build Coastguard Worker  %ooffset.2.lcssa.phi.SV.phi239 = phi i32 [ %ooffset.2.lcssa.phi.SV.phi209, %bb1.i.fragment ], [ %ooffset.2.lcssa.phi.SV.phi250, %bb12.fragment ] ; <i32> [#uses=1]
108*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb15, label %skip_to_newline.exit
109*9880d681SAndroid Build Coastguard Worker
110*9880d681SAndroid Build Coastguard WorkermeshBB82:                                         ; preds = %bb13, %bb4.fragment
111*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb5, label %bb13.fragment
112*9880d681SAndroid Build Coastguard Worker
113*9880d681SAndroid Build Coastguard WorkermeshBB86:                                         ; preds = %skip_to_newline.exit26, %entry
114*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %skip_to_newline.exit26.fragment, label %bb11.fragment
115*9880d681SAndroid Build Coastguard Worker
116*9880d681SAndroid Build Coastguard WorkermeshBB90:                                         ; preds = %skip_to_newline.exit26.fragment, %bb
117*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb11.fragment, label %bb.nph
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard WorkermeshBB94:                                         ; preds = %bb13.fragment, %bb12
120*9880d681SAndroid Build Coastguard Worker  %ooffset.2.lcssa.phi.SV.phi250 = phi i32 [ 0, %bb13.fragment ], [ %ooffset.2.lcssa.phi.SV.phi239, %bb12 ] ; <i32> [#uses=2]
121*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb12.fragment, label %bb14
122*9880d681SAndroid Build Coastguard Worker
123*9880d681SAndroid Build Coastguard WorkermeshBB98:                                         ; preds = %bb1.i, %bb2.fragment15
124*9880d681SAndroid Build Coastguard Worker  %ooffset.2.lcssa.phi.SV.phi209 = phi i32 [ undef, %bb2.fragment15 ], [ %ooffset.2.lcssa.phi.SV.phi203, %bb1.i ] ; <i32> [#uses=2]
125*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb1.i.fragment, label %bb7
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard WorkermeshBB102:                                        ; preds = %bb3, %entry
128*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb5, label %bb
129*9880d681SAndroid Build Coastguard Worker
130*9880d681SAndroid Build Coastguard WorkermeshBB106:                                        ; preds = %skip_to_newline.exit26.fragment, %bb1.i23
131*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb, label %skip_to_newline.exit26
132*9880d681SAndroid Build Coastguard Worker
133*9880d681SAndroid Build Coastguard WorkermeshBB110:                                        ; preds = %skip_to_newline.exit, %bb1.i23
134*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb15, label %bb1.i23
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard WorkermeshBB114:                                        ; preds = %bb7, %bb.nph
137*9880d681SAndroid Build Coastguard Worker  %meshStackVariable115.phi = phi i32 [ 19, %bb7 ], [ 8, %bb.nph ] ; <i32> [#uses=0]
138*9880d681SAndroid Build Coastguard Worker  br i1 undef, label %bb.nph.fragment, label %bb7.fragment
139*9880d681SAndroid Build Coastguard Worker
140*9880d681SAndroid Build Coastguard WorkermeshBB118:                                        ; preds = %meshBB74, %bb4, %bb.nph.fragment
141*9880d681SAndroid Build Coastguard Worker  %meshCmp121 = icmp eq i32 undef, 10             ; <i1> [#uses=1]
142*9880d681SAndroid Build Coastguard Worker  br i1 %meshCmp121, label %bb4.fragment, label %bb1.fragment
143*9880d681SAndroid Build Coastguard Worker
144*9880d681SAndroid Build Coastguard WorkermeshBB122:                                        ; preds = %bb13.fragment, %bb11.fragment
145*9880d681SAndroid Build Coastguard Worker  br i1 false, label %bb1.i, label %bb15
146*9880d681SAndroid Build Coastguard Worker}
147