1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;RUN: llc < %s -mtriple=i686-- -mattr=-slow-incdec | FileCheck %s -check-prefixes=CHECK,SLOW
3 ;RUN: llc < %s -mtriple=i686-- -mattr=+slow-incdec | FileCheck %s -check-prefixes=CHECK,FAST
5 define void @foo(i32 inreg %dns) minsize {
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: xorl %ecx, %ecx
9 ; CHECK-NEXT: decl %ecx
10 ; CHECK-NEXT: .LBB0_1: # %for.body
11 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
12 ; CHECK-NEXT: movzwl %cx, %edx
13 ; CHECK-NEXT: decl %ecx
14 ; CHECK-NEXT: cmpl %eax, %edx
15 ; CHECK-NEXT: jl .LBB0_1
16 ; CHECK-NEXT: # %bb.2: # %for.end
22 %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
23 %dec = add i16 %i.05, -1
24 %conv = zext i16 %dec to i32
25 %cmp = icmp slt i32 %conv, %dns
26 br i1 %cmp, label %for.body, label %for.end
32 define void @bar(i32 inreg %dns) minsize {
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: xorl %ecx, %ecx
36 ; CHECK-NEXT: incl %ecx
37 ; CHECK-NEXT: .LBB1_1: # %for.body
38 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
39 ; CHECK-NEXT: movzwl %cx, %edx
40 ; CHECK-NEXT: incl %ecx
41 ; CHECK-NEXT: cmpl %eax, %edx
42 ; CHECK-NEXT: jl .LBB1_1
43 ; CHECK-NEXT: # %bb.2: # %for.end
49 %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
50 %inc = add i16 %i.05, 1
51 %conv = zext i16 %inc to i32
52 %cmp = icmp slt i32 %conv, %dns
53 br i1 %cmp, label %for.body, label %for.end
58 define void @foo_optsize(i32 inreg %dns) optsize {
59 ; CHECK-LABEL: foo_optsize:
60 ; CHECK: # %bb.0: # %entry
61 ; CHECK-NEXT: xorl %ecx, %ecx
62 ; CHECK-NEXT: decl %ecx
63 ; CHECK-NEXT: .LBB2_1: # %for.body
64 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
65 ; CHECK-NEXT: movzwl %cx, %edx
66 ; CHECK-NEXT: decl %ecx
67 ; CHECK-NEXT: cmpl %eax, %edx
68 ; CHECK-NEXT: jl .LBB2_1
69 ; CHECK-NEXT: # %bb.2: # %for.end
75 %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
76 %dec = add i16 %i.05, -1
77 %conv = zext i16 %dec to i32
78 %cmp = icmp slt i32 %conv, %dns
79 br i1 %cmp, label %for.body, label %for.end
85 define void @bar_optsize(i32 inreg %dns) optsize {
86 ; CHECK-LABEL: bar_optsize:
87 ; CHECK: # %bb.0: # %entry
88 ; CHECK-NEXT: xorl %ecx, %ecx
89 ; CHECK-NEXT: incl %ecx
90 ; CHECK-NEXT: .LBB3_1: # %for.body
91 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
92 ; CHECK-NEXT: movzwl %cx, %edx
93 ; CHECK-NEXT: incl %ecx
94 ; CHECK-NEXT: cmpl %eax, %edx
95 ; CHECK-NEXT: jl .LBB3_1
96 ; CHECK-NEXT: # %bb.2: # %for.end
102 %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
103 %inc = add i16 %i.05, 1
104 %conv = zext i16 %inc to i32
105 %cmp = icmp slt i32 %conv, %dns
106 br i1 %cmp, label %for.body, label %for.end
111 define void @foo_pgso(i32 inreg %dns) !prof !14 {
112 ; CHECK-LABEL: foo_pgso:
113 ; CHECK: # %bb.0: # %entry
114 ; CHECK-NEXT: xorl %ecx, %ecx
115 ; CHECK-NEXT: decl %ecx
116 ; CHECK-NEXT: .LBB4_1: # %for.body
117 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
118 ; CHECK-NEXT: movzwl %cx, %edx
119 ; CHECK-NEXT: decl %ecx
120 ; CHECK-NEXT: cmpl %eax, %edx
121 ; CHECK-NEXT: jl .LBB4_1
122 ; CHECK-NEXT: # %bb.2: # %for.end
128 %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
129 %dec = add i16 %i.05, -1
130 %conv = zext i16 %dec to i32
131 %cmp = icmp slt i32 %conv, %dns
132 br i1 %cmp, label %for.body, label %for.end
138 define void @bar_pgso(i32 inreg %dns) !prof !14 {
139 ; CHECK-LABEL: bar_pgso:
140 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: xorl %ecx, %ecx
142 ; CHECK-NEXT: incl %ecx
143 ; CHECK-NEXT: .LBB5_1: # %for.body
144 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
145 ; CHECK-NEXT: movzwl %cx, %edx
146 ; CHECK-NEXT: incl %ecx
147 ; CHECK-NEXT: cmpl %eax, %edx
148 ; CHECK-NEXT: jl .LBB5_1
149 ; CHECK-NEXT: # %bb.2: # %for.end
155 %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
156 %inc = add i16 %i.05, 1
157 %conv = zext i16 %inc to i32
158 %cmp = icmp slt i32 %conv, %dns
159 br i1 %cmp, label %for.body, label %for.end
164 define void @foo_nosize(i32 inreg %dns) {
165 ; SLOW-LABEL: foo_nosize:
166 ; SLOW: # %bb.0: # %entry
167 ; SLOW-NEXT: movw $-1, %cx
168 ; SLOW-NEXT: .p2align 4
169 ; SLOW-NEXT: .LBB6_1: # %for.body
170 ; SLOW-NEXT: # =>This Inner Loop Header: Depth=1
171 ; SLOW-NEXT: movzwl %cx, %edx
172 ; SLOW-NEXT: decl %ecx
173 ; SLOW-NEXT: cmpl %eax, %edx
174 ; SLOW-NEXT: jl .LBB6_1
175 ; SLOW-NEXT: # %bb.2: # %for.end
178 ; FAST-LABEL: foo_nosize:
179 ; FAST: # %bb.0: # %entry
180 ; FAST-NEXT: movw $-1, %cx
181 ; FAST-NEXT: .p2align 4
182 ; FAST-NEXT: .LBB6_1: # %for.body
183 ; FAST-NEXT: # =>This Inner Loop Header: Depth=1
184 ; FAST-NEXT: movzwl %cx, %edx
185 ; FAST-NEXT: addl $-1, %ecx
186 ; FAST-NEXT: cmpl %eax, %edx
187 ; FAST-NEXT: jl .LBB6_1
188 ; FAST-NEXT: # %bb.2: # %for.end
194 %i.05 = phi i16 [ %dec, %for.body ], [ 0, %entry ]
195 %dec = add i16 %i.05, -1
196 %conv = zext i16 %dec to i32
197 %cmp = icmp slt i32 %conv, %dns
198 br i1 %cmp, label %for.body, label %for.end
204 define void @bar_nosize(i32 inreg %dns) {
205 ; SLOW-LABEL: bar_nosize:
206 ; SLOW: # %bb.0: # %entry
207 ; SLOW-NEXT: movw $1, %cx
208 ; SLOW-NEXT: .p2align 4
209 ; SLOW-NEXT: .LBB7_1: # %for.body
210 ; SLOW-NEXT: # =>This Inner Loop Header: Depth=1
211 ; SLOW-NEXT: movzwl %cx, %edx
212 ; SLOW-NEXT: incl %ecx
213 ; SLOW-NEXT: cmpl %eax, %edx
214 ; SLOW-NEXT: jl .LBB7_1
215 ; SLOW-NEXT: # %bb.2: # %for.end
218 ; FAST-LABEL: bar_nosize:
219 ; FAST: # %bb.0: # %entry
220 ; FAST-NEXT: movw $1, %cx
221 ; FAST-NEXT: .p2align 4
222 ; FAST-NEXT: .LBB7_1: # %for.body
223 ; FAST-NEXT: # =>This Inner Loop Header: Depth=1
224 ; FAST-NEXT: movzwl %cx, %edx
225 ; FAST-NEXT: addl $1, %ecx
226 ; FAST-NEXT: cmpl %eax, %edx
227 ; FAST-NEXT: jl .LBB7_1
228 ; FAST-NEXT: # %bb.2: # %for.end
234 %i.05 = phi i16 [ %inc, %for.body ], [ 0, %entry ]
235 %inc = add i16 %i.05, 1
236 %conv = zext i16 %inc to i32
237 %cmp = icmp slt i32 %conv, %dns
238 br i1 %cmp, label %for.body, label %for.end
243 !llvm.module.flags = !{!0}
244 !0 = !{i32 1, !"ProfileSummary", !1}
245 !1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
246 !2 = !{!"ProfileFormat", !"InstrProf"}
247 !3 = !{!"TotalCount", i64 10000}
248 !4 = !{!"MaxCount", i64 10}
249 !5 = !{!"MaxInternalCount", i64 1}
250 !6 = !{!"MaxFunctionCount", i64 1000}
251 !7 = !{!"NumCounts", i64 3}
252 !8 = !{!"NumFunctions", i64 3}
253 !9 = !{!"DetailedSummary", !10}
254 !10 = !{!11, !12, !13}
255 !11 = !{i32 10000, i64 100, i32 1}
256 !12 = !{i32 999000, i64 100, i32 1}
257 !13 = !{i32 999999, i64 1, i32 2}
258 !14 = !{!"function_entry_count", i64 0}