[ARM] Enable shrink-wrapping by default.
[oota-llvm.git] / test / CodeGen / ARM / 2012-05-29-TailDupBug.ll
1 ; RUN: llc -mtriple=thumbv7-apple-ios -mcpu=cortex-a8 -verify-machineinstrs < %s
2
3 ; Teach taildup to update livein set to appease verifier.
4 ; rdar://11538365
5
6 %struct.__CFString.2 = type opaque
7
8 declare void @CFRelease(i8*)
9
10 define hidden fastcc i32 @t() ssp {
11 entry:
12   %mylocale.i.i = alloca [256 x i8], align 1
13   br i1 undef, label %return, label %CFStringIsHyphenationAvailableForLocale.exit
14
15 CFStringIsHyphenationAvailableForLocale.exit:     ; preds = %entry
16   br i1 undef, label %return, label %if.end
17
18 if.end:                                           ; preds = %CFStringIsHyphenationAvailableForLocale.exit
19   br i1 undef, label %if.end8.thread.i, label %if.then.i
20
21 if.then.i:                                        ; preds = %if.end
22   br i1 undef, label %if.end8.thread.i, label %if.end8.i
23
24 if.end8.thread.i:                                 ; preds = %if.then.i, %if.end
25   unreachable
26
27 if.end8.i:                                        ; preds = %if.then.i
28   br i1 undef, label %if.then11.i, label %__CFHyphenationPullTokenizer.exit
29
30 if.then11.i:                                      ; preds = %if.end8.i
31   unreachable
32
33 __CFHyphenationPullTokenizer.exit:                ; preds = %if.end8.i
34   br i1 undef, label %if.end68, label %if.then3
35
36 if.then3:                                         ; preds = %__CFHyphenationPullTokenizer.exit
37   br i1 undef, label %cond.end, label %cond.false
38
39 cond.false:                                       ; preds = %if.then3
40   br label %cond.end
41
42 cond.end:                                         ; preds = %cond.false, %if.then3
43   br i1 undef, label %while.end, label %while.body
44
45 while.body:                                       ; preds = %cond.end
46   unreachable
47
48 while.end:                                        ; preds = %cond.end
49   br i1 undef, label %if.end5.i, label %if.then.i16
50
51 if.then.i16:                                      ; preds = %while.end
52   br i1 undef, label %if.then4.i, label %if.end5.i
53
54 if.then4.i:                                       ; preds = %if.then.i16
55   br i1 false, label %cleanup.thread, label %if.end.i20
56
57 if.end5.i:                                        ; preds = %if.then.i16, %while.end
58   unreachable
59
60 if.end.i20:                                       ; preds = %if.then4.i
61   br label %for.body.i146.i
62
63 for.body.i146.i:                                  ; preds = %for.body.i146.i, %if.end.i20
64   br i1 undef, label %if.end20.i, label %for.body.i146.i
65
66 if.end20.i:                                       ; preds = %for.body.i146.i
67   br i1 undef, label %cleanup.thread, label %if.end23.i
68
69 if.end23.i:                                       ; preds = %if.end20.i
70   br label %for.body.i94.i
71
72 for.body.i94.i:                                   ; preds = %for.body.i94.i, %if.end23.i
73   br i1 undef, label %if.then28.i, label %for.body.i94.i
74
75 if.then28.i:                                      ; preds = %for.body.i94.i
76   br i1 undef, label %cond.true.i26, label %land.lhs.true
77
78 cond.true.i26:                                    ; preds = %if.then28.i
79   br label %land.lhs.true
80
81 land.lhs.true:                                    ; preds = %cond.true.i26, %if.then28.i
82   br i1 false, label %cleanup.thread, label %if.end35
83
84 if.end35:                                         ; preds = %land.lhs.true
85   br i1 undef, label %cleanup.thread, label %if.end45
86
87 if.end45:                                         ; preds = %if.end35
88   br i1 undef, label %if.then50, label %if.end.i37
89
90 if.end.i37:                                       ; preds = %if.end45
91   br label %if.then50
92
93 if.then50:                                        ; preds = %if.end.i37, %if.end45
94   br i1 undef, label %__CFHyphenationGetHyphensForString.exit, label %if.end.i
95
96 if.end.i:                                         ; preds = %if.then50
97   br i1 undef, label %cleanup.i, label %cond.true.i
98
99 cond.true.i:                                      ; preds = %if.end.i
100   br i1 undef, label %for.cond16.preheader.i, label %for.cond57.preheader.i
101
102 for.cond16.preheader.i:                           ; preds = %cond.true.i
103   %cmp1791.i = icmp sgt i32 undef, 1
104   br i1 %cmp1791.i, label %for.body18.i, label %for.cond57.preheader.i
105
106 for.cond57.preheader.i:                           ; preds = %for.cond16.preheader.i, %cond.true.i
107   %sub69.i = add i32 undef, -2
108   br label %cleanup.i
109
110 for.body18.i:                                     ; preds = %for.cond16.preheader.i
111   store i16 0, i16* undef, align 2
112   br label %while.body.i
113
114 while.body.i:                                     ; preds = %while.body.i, %for.body18.i
115   br label %while.body.i
116
117 cleanup.i:                                        ; preds = %for.cond57.preheader.i, %if.end.i
118   br label %__CFHyphenationGetHyphensForString.exit
119
120 __CFHyphenationGetHyphensForString.exit:          ; preds = %cleanup.i, %if.then50
121   %retval.1.i = phi i32 [ 0, %cleanup.i ], [ -1, %if.then50 ]
122   %phitmp = bitcast %struct.__CFString.2* null to i8*
123   br label %if.end68
124
125 cleanup.thread:                                   ; preds = %if.end35, %land.lhs.true, %if.end20.i, %if.then4.i
126   call void @llvm.stackrestore(i8* null)
127   br label %return
128
129 if.end68:                                         ; preds = %__CFHyphenationGetHyphensForString.exit, %__CFHyphenationPullTokenizer.exit
130   %hyphenCount.2 = phi i32 [ %retval.1.i, %__CFHyphenationGetHyphensForString.exit ], [ 0, %__CFHyphenationPullTokenizer.exit ]
131   %_token.1 = phi i8* [ %phitmp, %__CFHyphenationGetHyphensForString.exit ], [ undef, %__CFHyphenationPullTokenizer.exit ]
132   call void @CFRelease(i8* %_token.1)
133   br label %return
134
135 return:                                           ; preds = %if.end68, %cleanup.thread, %CFStringIsHyphenationAvailableForLocale.exit, %entry
136   %retval.1 = phi i32 [ %hyphenCount.2, %if.end68 ], [ -1, %CFStringIsHyphenationAvailableForLocale.exit ], [ -1, %cleanup.thread ], [ -1, %entry ]
137   ret i32 %retval.1
138 }
139
140 declare void @llvm.stackrestore(i8*) nounwind