1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-darwin | FileCheck %s --check-prefix=GENERIC
3 ; RUN: llc < %s -mtriple=x86_64-darwin -mcpu=atom | FileCheck %s --check-prefix=ATOM
5 @Te0 = external global [256 x i32] ; <[256 x i32]*> [#uses=5]
6 @Te1 = external global [256 x i32] ; <[256 x i32]*> [#uses=4]
7 @Te3 = external global [256 x i32] ; <[256 x i32]*> [#uses=2]
9 define void @t(i8* nocapture %in, i8* nocapture %out, i32* nocapture %rk, i32 %r) nounwind {
11 ; GENERIC: ## %bb.0: ## %entry
12 ; GENERIC-NEXT: pushq %rbp
13 ; GENERIC-NEXT: pushq %r15
14 ; GENERIC-NEXT: pushq %r14
15 ; GENERIC-NEXT: pushq %rbx
16 ; GENERIC-NEXT: ## kill: def $ecx killed $ecx def $rcx
17 ; GENERIC-NEXT: movl (%rdx), %r8d
18 ; GENERIC-NEXT: movl 4(%rdx), %ebx
19 ; GENERIC-NEXT: decl %ecx
20 ; GENERIC-NEXT: leaq 20(%rdx), %r9
21 ; GENERIC-NEXT: movq _Te0@GOTPCREL(%rip), %rdi
22 ; GENERIC-NEXT: movq _Te1@GOTPCREL(%rip), %rax
23 ; GENERIC-NEXT: movq _Te3@GOTPCREL(%rip), %r10
24 ; GENERIC-NEXT: movq %rcx, %r11
25 ; GENERIC-NEXT: .p2align 4, 0x90
26 ; GENERIC-NEXT: LBB0_1: ## %bb
27 ; GENERIC-NEXT: ## =>This Inner Loop Header: Depth=1
28 ; GENERIC-NEXT: movzbl %r8b, %r14d
29 ; GENERIC-NEXT: ## kill: def $r8d killed $r8d def $r8
30 ; GENERIC-NEXT: shrl $24, %r8d
31 ; GENERIC-NEXT: movl %ebx, %r15d
32 ; GENERIC-NEXT: shrl $14, %r15d
33 ; GENERIC-NEXT: andl $1020, %r15d ## imm = 0x3FC
34 ; GENERIC-NEXT: movl (%rax,%r15), %ebp
35 ; GENERIC-NEXT: xorl (%rdi,%r8,4), %ebp
36 ; GENERIC-NEXT: xorl -12(%r9), %ebp
37 ; GENERIC-NEXT: shrl $24, %ebx
38 ; GENERIC-NEXT: movl (%r10,%r14,4), %r14d
39 ; GENERIC-NEXT: xorl (%rdi,%rbx,4), %r14d
40 ; GENERIC-NEXT: xorl -8(%r9), %r14d
41 ; GENERIC-NEXT: movl %ebp, %r8d
42 ; GENERIC-NEXT: shrl $24, %r8d
43 ; GENERIC-NEXT: movl (%rdi,%r8,4), %r8d
44 ; GENERIC-NEXT: subq $1, %r11
45 ; GENERIC-NEXT: jb LBB0_3
46 ; GENERIC-NEXT: ## %bb.2: ## %bb1
47 ; GENERIC-NEXT: ## in Loop: Header=BB0_1 Depth=1
48 ; GENERIC-NEXT: movl %r14d, %ebx
49 ; GENERIC-NEXT: shrl $14, %ebx
50 ; GENERIC-NEXT: andl $1020, %ebx ## imm = 0x3FC
51 ; GENERIC-NEXT: xorl (%rax,%rbx), %r8d
52 ; GENERIC-NEXT: xorl -4(%r9), %r8d
53 ; GENERIC-NEXT: shrl $24, %r14d
54 ; GENERIC-NEXT: movzbl %bpl, %ebx
55 ; GENERIC-NEXT: movl (%r10,%rbx,4), %ebx
56 ; GENERIC-NEXT: xorl (%rdi,%r14,4), %ebx
57 ; GENERIC-NEXT: xorl (%r9), %ebx
58 ; GENERIC-NEXT: addq $16, %r9
59 ; GENERIC-NEXT: jmp LBB0_1
60 ; GENERIC-NEXT: LBB0_3: ## %bb2
61 ; GENERIC-NEXT: shlq $4, %rcx
62 ; GENERIC-NEXT: andl $-16777216, %r8d ## imm = 0xFF000000
63 ; GENERIC-NEXT: movl %r14d, %r9d
64 ; GENERIC-NEXT: shrl $14, %r9d
65 ; GENERIC-NEXT: andl $1020, %r9d ## imm = 0x3FC
66 ; GENERIC-NEXT: movzbl 2(%rax,%r9), %r9d
67 ; GENERIC-NEXT: shll $16, %r9d
68 ; GENERIC-NEXT: orl %r8d, %r9d
69 ; GENERIC-NEXT: xorl 16(%rcx,%rdx), %r9d
70 ; GENERIC-NEXT: shrl $8, %r14d
71 ; GENERIC-NEXT: movzbl 3(%rdi,%r14,4), %edi
72 ; GENERIC-NEXT: shll $24, %edi
73 ; GENERIC-NEXT: movzbl %bpl, %r8d
74 ; GENERIC-NEXT: movzbl 2(%rax,%r8,4), %eax
75 ; GENERIC-NEXT: shll $16, %eax
76 ; GENERIC-NEXT: orl %edi, %eax
77 ; GENERIC-NEXT: xorl 20(%rcx,%rdx), %eax
78 ; GENERIC-NEXT: movl %r9d, %ecx
79 ; GENERIC-NEXT: shrl $24, %ecx
80 ; GENERIC-NEXT: movb %cl, (%rsi)
81 ; GENERIC-NEXT: shrl $16, %r9d
82 ; GENERIC-NEXT: movb %r9b, 1(%rsi)
83 ; GENERIC-NEXT: movl %eax, %ecx
84 ; GENERIC-NEXT: shrl $24, %ecx
85 ; GENERIC-NEXT: movb %cl, 4(%rsi)
86 ; GENERIC-NEXT: shrl $16, %eax
87 ; GENERIC-NEXT: movb %al, 5(%rsi)
88 ; GENERIC-NEXT: popq %rbx
89 ; GENERIC-NEXT: popq %r14
90 ; GENERIC-NEXT: popq %r15
91 ; GENERIC-NEXT: popq %rbp
95 ; ATOM: ## %bb.0: ## %entry
96 ; ATOM-NEXT: pushq %r15
97 ; ATOM-NEXT: pushq %r14
98 ; ATOM-NEXT: pushq %rbx
99 ; ATOM-NEXT: ## kill: def $ecx killed $ecx def $rcx
100 ; ATOM-NEXT: movl (%rdx), %r8d
101 ; ATOM-NEXT: movl 4(%rdx), %r15d
102 ; ATOM-NEXT: leaq 20(%rdx), %r9
103 ; ATOM-NEXT: movq _Te0@GOTPCREL(%rip), %rdi
104 ; ATOM-NEXT: movq _Te1@GOTPCREL(%rip), %rax
105 ; ATOM-NEXT: movq _Te3@GOTPCREL(%rip), %r10
106 ; ATOM-NEXT: decl %ecx
107 ; ATOM-NEXT: movq %rcx, %r11
108 ; ATOM-NEXT: .p2align 4, 0x90
109 ; ATOM-NEXT: LBB0_1: ## %bb
110 ; ATOM-NEXT: ## =>This Inner Loop Header: Depth=1
111 ; ATOM-NEXT: movl %r15d, %ebx
112 ; ATOM-NEXT: movl %r8d, %r14d
113 ; ATOM-NEXT: movzbl %r8b, %r8d
114 ; ATOM-NEXT: shrl $24, %r15d
115 ; ATOM-NEXT: shrl $14, %ebx
116 ; ATOM-NEXT: shrl $24, %r14d
117 ; ATOM-NEXT: andl $1020, %ebx ## imm = 0x3FC
118 ; ATOM-NEXT: movl (%rax,%rbx), %ebx
119 ; ATOM-NEXT: xorl (%rdi,%r14,4), %ebx
120 ; ATOM-NEXT: movl (%r10,%r8,4), %r14d
121 ; ATOM-NEXT: xorl -12(%r9), %ebx
122 ; ATOM-NEXT: xorl (%rdi,%r15,4), %r14d
123 ; ATOM-NEXT: movl %ebx, %r8d
124 ; ATOM-NEXT: xorl -8(%r9), %r14d
125 ; ATOM-NEXT: shrl $24, %r8d
126 ; ATOM-NEXT: subq $1, %r11
127 ; ATOM-NEXT: movl (%rdi,%r8,4), %r8d
128 ; ATOM-NEXT: jb LBB0_3
129 ; ATOM-NEXT: ## %bb.2: ## %bb1
130 ; ATOM-NEXT: ## in Loop: Header=BB0_1 Depth=1
131 ; ATOM-NEXT: movl %r14d, %r15d
132 ; ATOM-NEXT: movzbl %bl, %ebx
133 ; ATOM-NEXT: shrl $24, %r14d
134 ; ATOM-NEXT: shrl $14, %r15d
135 ; ATOM-NEXT: andl $1020, %r15d ## imm = 0x3FC
136 ; ATOM-NEXT: xorl (%rax,%r15), %r8d
137 ; ATOM-NEXT: movl (%r10,%rbx,4), %r15d
138 ; ATOM-NEXT: xorl (%rdi,%r14,4), %r15d
139 ; ATOM-NEXT: xorl -4(%r9), %r8d
140 ; ATOM-NEXT: xorl (%r9), %r15d
141 ; ATOM-NEXT: addq $16, %r9
142 ; ATOM-NEXT: jmp LBB0_1
143 ; ATOM-NEXT: LBB0_3: ## %bb2
144 ; ATOM-NEXT: movl %r14d, %r9d
145 ; ATOM-NEXT: andl $-16777216, %r8d ## imm = 0xFF000000
146 ; ATOM-NEXT: shrl $8, %r14d
147 ; ATOM-NEXT: shlq $4, %rcx
148 ; ATOM-NEXT: shrl $14, %r9d
149 ; ATOM-NEXT: movzbl 3(%rdi,%r14,4), %edi
150 ; ATOM-NEXT: andl $1020, %r9d ## imm = 0x3FC
151 ; ATOM-NEXT: shll $24, %edi
152 ; ATOM-NEXT: movzbl 2(%rax,%r9), %r9d
153 ; ATOM-NEXT: shll $16, %r9d
154 ; ATOM-NEXT: orl %r8d, %r9d
155 ; ATOM-NEXT: movzbl %bl, %r8d
156 ; ATOM-NEXT: movzbl 2(%rax,%r8,4), %eax
157 ; ATOM-NEXT: xorl 16(%rcx,%rdx), %r9d
158 ; ATOM-NEXT: shll $16, %eax
159 ; ATOM-NEXT: orl %edi, %eax
160 ; ATOM-NEXT: movl %r9d, %edi
161 ; ATOM-NEXT: shrl $16, %r9d
162 ; ATOM-NEXT: xorl 20(%rcx,%rdx), %eax
163 ; ATOM-NEXT: shrl $24, %edi
164 ; ATOM-NEXT: movl %eax, %ecx
165 ; ATOM-NEXT: shrl $16, %eax
166 ; ATOM-NEXT: movb %dil, (%rsi)
167 ; ATOM-NEXT: movb %r9b, 1(%rsi)
168 ; ATOM-NEXT: shrl $24, %ecx
169 ; ATOM-NEXT: movb %cl, 4(%rsi)
170 ; ATOM-NEXT: movb %al, 5(%rsi)
171 ; ATOM-NEXT: popq %rbx
172 ; ATOM-NEXT: popq %r14
173 ; ATOM-NEXT: popq %r15
176 %0 = load i32, i32* %rk, align 4 ; <i32> [#uses=1]
177 %1 = getelementptr i32, i32* %rk, i64 1 ; <i32*> [#uses=1]
178 %2 = load i32, i32* %1, align 4 ; <i32> [#uses=1]
179 %tmp15 = add i32 %r, -1 ; <i32> [#uses=1]
180 %tmp.16 = zext i32 %tmp15 to i64 ; <i64> [#uses=2]
183 bb: ; preds = %bb1, %entry
184 %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %bb1 ] ; <i64> [#uses=3]
185 %s1.0 = phi i32 [ %2, %entry ], [ %56, %bb1 ] ; <i32> [#uses=2]
186 %s0.0 = phi i32 [ %0, %entry ], [ %43, %bb1 ] ; <i32> [#uses=2]
187 %tmp18 = shl i64 %indvar, 4 ; <i64> [#uses=4]
188 %rk26 = bitcast i32* %rk to i8* ; <i8*> [#uses=6]
189 %3 = lshr i32 %s0.0, 24 ; <i32> [#uses=1]
190 %4 = zext i32 %3 to i64 ; <i64> [#uses=1]
191 %5 = getelementptr [256 x i32], [256 x i32]* @Te0, i64 0, i64 %4 ; <i32*> [#uses=1]
192 %6 = load i32, i32* %5, align 4 ; <i32> [#uses=1]
193 %7 = lshr i32 %s1.0, 16 ; <i32> [#uses=1]
194 %8 = and i32 %7, 255 ; <i32> [#uses=1]
195 %9 = zext i32 %8 to i64 ; <i64> [#uses=1]
196 %10 = getelementptr [256 x i32], [256 x i32]* @Te1, i64 0, i64 %9 ; <i32*> [#uses=1]
197 %11 = load i32, i32* %10, align 4 ; <i32> [#uses=1]
198 %ctg2.sum2728 = or disjoint i64 %tmp18, 8 ; <i64> [#uses=1]
199 %12 = getelementptr i8, i8* %rk26, i64 %ctg2.sum2728 ; <i8*> [#uses=1]
200 %13 = bitcast i8* %12 to i32* ; <i32*> [#uses=1]
201 %14 = load i32, i32* %13, align 4 ; <i32> [#uses=1]
202 %15 = xor i32 %11, %6 ; <i32> [#uses=1]
203 %16 = xor i32 %15, %14 ; <i32> [#uses=3]
204 %17 = lshr i32 %s1.0, 24 ; <i32> [#uses=1]
205 %18 = zext i32 %17 to i64 ; <i64> [#uses=1]
206 %19 = getelementptr [256 x i32], [256 x i32]* @Te0, i64 0, i64 %18 ; <i32*> [#uses=1]
207 %20 = load i32, i32* %19, align 4 ; <i32> [#uses=1]
208 %21 = and i32 %s0.0, 255 ; <i32> [#uses=1]
209 %22 = zext i32 %21 to i64 ; <i64> [#uses=1]
210 %23 = getelementptr [256 x i32], [256 x i32]* @Te3, i64 0, i64 %22 ; <i32*> [#uses=1]
211 %24 = load i32, i32* %23, align 4 ; <i32> [#uses=1]
212 %ctg2.sum2930 = or disjoint i64 %tmp18, 12 ; <i64> [#uses=1]
213 %25 = getelementptr i8, i8* %rk26, i64 %ctg2.sum2930 ; <i8*> [#uses=1]
214 %26 = bitcast i8* %25 to i32* ; <i32*> [#uses=1]
215 %27 = load i32, i32* %26, align 4 ; <i32> [#uses=1]
216 %28 = xor i32 %24, %20 ; <i32> [#uses=1]
217 %29 = xor i32 %28, %27 ; <i32> [#uses=4]
218 %30 = lshr i32 %16, 24 ; <i32> [#uses=1]
219 %31 = zext i32 %30 to i64 ; <i64> [#uses=1]
220 %32 = getelementptr [256 x i32], [256 x i32]* @Te0, i64 0, i64 %31 ; <i32*> [#uses=1]
221 %33 = load i32, i32* %32, align 4 ; <i32> [#uses=2]
222 %exitcond = icmp eq i64 %indvar, %tmp.16 ; <i1> [#uses=1]
223 br i1 %exitcond, label %bb2, label %bb1
226 %ctg2.sum31 = add i64 %tmp18, 16 ; <i64> [#uses=1]
227 %34 = getelementptr i8, i8* %rk26, i64 %ctg2.sum31 ; <i8*> [#uses=1]
228 %35 = bitcast i8* %34 to i32* ; <i32*> [#uses=1]
229 %36 = lshr i32 %29, 16 ; <i32> [#uses=1]
230 %37 = and i32 %36, 255 ; <i32> [#uses=1]
231 %38 = zext i32 %37 to i64 ; <i64> [#uses=1]
232 %39 = getelementptr [256 x i32], [256 x i32]* @Te1, i64 0, i64 %38 ; <i32*> [#uses=1]
233 %40 = load i32, i32* %39, align 4 ; <i32> [#uses=1]
234 %41 = load i32, i32* %35, align 4 ; <i32> [#uses=1]
235 %42 = xor i32 %40, %33 ; <i32> [#uses=1]
236 %43 = xor i32 %42, %41 ; <i32> [#uses=1]
237 %44 = lshr i32 %29, 24 ; <i32> [#uses=1]
238 %45 = zext i32 %44 to i64 ; <i64> [#uses=1]
239 %46 = getelementptr [256 x i32], [256 x i32]* @Te0, i64 0, i64 %45 ; <i32*> [#uses=1]
240 %47 = load i32, i32* %46, align 4 ; <i32> [#uses=1]
241 %48 = and i32 %16, 255 ; <i32> [#uses=1]
242 %49 = zext i32 %48 to i64 ; <i64> [#uses=1]
243 %50 = getelementptr [256 x i32], [256 x i32]* @Te3, i64 0, i64 %49 ; <i32*> [#uses=1]
244 %51 = load i32, i32* %50, align 4 ; <i32> [#uses=1]
245 %ctg2.sum32 = add i64 %tmp18, 20 ; <i64> [#uses=1]
246 %52 = getelementptr i8, i8* %rk26, i64 %ctg2.sum32 ; <i8*> [#uses=1]
247 %53 = bitcast i8* %52 to i32* ; <i32*> [#uses=1]
248 %54 = load i32, i32* %53, align 4 ; <i32> [#uses=1]
249 %55 = xor i32 %51, %47 ; <i32> [#uses=1]
250 %56 = xor i32 %55, %54 ; <i32> [#uses=1]
251 %indvar.next = add i64 %indvar, 1 ; <i64> [#uses=1]
255 %tmp10 = shl i64 %tmp.16, 4 ; <i64> [#uses=2]
256 %ctg2.sum = add i64 %tmp10, 16 ; <i64> [#uses=1]
257 %tmp1213 = getelementptr i8, i8* %rk26, i64 %ctg2.sum ; <i8*> [#uses=1]
258 %57 = bitcast i8* %tmp1213 to i32* ; <i32*> [#uses=1]
259 %58 = and i32 %33, -16777216 ; <i32> [#uses=1]
260 %59 = lshr i32 %29, 16 ; <i32> [#uses=1]
261 %60 = and i32 %59, 255 ; <i32> [#uses=1]
262 %61 = zext i32 %60 to i64 ; <i64> [#uses=1]
263 %62 = getelementptr [256 x i32], [256 x i32]* @Te1, i64 0, i64 %61 ; <i32*> [#uses=1]
264 %63 = load i32, i32* %62, align 4 ; <i32> [#uses=1]
265 %64 = and i32 %63, 16711680 ; <i32> [#uses=1]
266 %65 = or i32 %64, %58 ; <i32> [#uses=1]
267 %66 = load i32, i32* %57, align 4 ; <i32> [#uses=1]
268 %67 = xor i32 %65, %66 ; <i32> [#uses=2]
269 %68 = lshr i32 %29, 8 ; <i32> [#uses=1]
270 %69 = zext i32 %68 to i64 ; <i64> [#uses=1]
271 %70 = getelementptr [256 x i32], [256 x i32]* @Te0, i64 0, i64 %69 ; <i32*> [#uses=1]
272 %71 = load i32, i32* %70, align 4 ; <i32> [#uses=1]
273 %72 = and i32 %71, -16777216 ; <i32> [#uses=1]
274 %73 = and i32 %16, 255 ; <i32> [#uses=1]
275 %74 = zext i32 %73 to i64 ; <i64> [#uses=1]
276 %75 = getelementptr [256 x i32], [256 x i32]* @Te1, i64 0, i64 %74 ; <i32*> [#uses=1]
277 %76 = load i32, i32* %75, align 4 ; <i32> [#uses=1]
278 %77 = and i32 %76, 16711680 ; <i32> [#uses=1]
279 %78 = or i32 %77, %72 ; <i32> [#uses=1]
280 %ctg2.sum25 = add i64 %tmp10, 20 ; <i64> [#uses=1]
281 %79 = getelementptr i8, i8* %rk26, i64 %ctg2.sum25 ; <i8*> [#uses=1]
282 %80 = bitcast i8* %79 to i32* ; <i32*> [#uses=1]
283 %81 = load i32, i32* %80, align 4 ; <i32> [#uses=1]
284 %82 = xor i32 %78, %81 ; <i32> [#uses=2]
285 %83 = lshr i32 %67, 24 ; <i32> [#uses=1]
286 %84 = trunc i32 %83 to i8 ; <i8> [#uses=1]
287 store i8 %84, i8* %out, align 1
288 %85 = lshr i32 %67, 16 ; <i32> [#uses=1]
289 %86 = trunc i32 %85 to i8 ; <i8> [#uses=1]
290 %87 = getelementptr i8, i8* %out, i64 1 ; <i8*> [#uses=1]
291 store i8 %86, i8* %87, align 1
292 %88 = getelementptr i8, i8* %out, i64 4 ; <i8*> [#uses=1]
293 %89 = lshr i32 %82, 24 ; <i32> [#uses=1]
294 %90 = trunc i32 %89 to i8 ; <i8> [#uses=1]
295 store i8 %90, i8* %88, align 1
296 %91 = lshr i32 %82, 16 ; <i32> [#uses=1]
297 %92 = trunc i32 %91 to i8 ; <i8> [#uses=1]
298 %93 = getelementptr i8, i8* %out, i64 5 ; <i8*> [#uses=1]
299 store i8 %92, i8* %93, align 1
303 ; Check that DAGCombiner doesn't mess up the IV update when the exiting value
304 ; is equal to the stride.
305 ; It must not fold (cmp (add iv, 1), 1) --> (cmp iv, 0).
307 define i32 @f(i32 %i, i32* nocapture %a) nounwind uwtable readonly ssp {
309 ; GENERIC: ## %bb.0: ## %entry
310 ; GENERIC-NEXT: xorl %eax, %eax
311 ; GENERIC-NEXT: cmpl $1, %edi
312 ; GENERIC-NEXT: je LBB1_3
313 ; GENERIC-NEXT: ## %bb.1: ## %for.body.lr.ph
314 ; GENERIC-NEXT: movslq %edi, %rax
315 ; GENERIC-NEXT: leaq (%rsi,%rax,4), %rcx
316 ; GENERIC-NEXT: xorl %eax, %eax
317 ; GENERIC-NEXT: xorl %edx, %edx
318 ; GENERIC-NEXT: .p2align 4, 0x90
319 ; GENERIC-NEXT: LBB1_2: ## %for.body
320 ; GENERIC-NEXT: ## =>This Inner Loop Header: Depth=1
321 ; GENERIC-NEXT: movl (%rcx), %esi
322 ; GENERIC-NEXT: cmpl %edx, %esi
323 ; GENERIC-NEXT: cmoval %esi, %edx
324 ; GENERIC-NEXT: cmoval %edi, %eax
325 ; GENERIC-NEXT: incl %edi
326 ; GENERIC-NEXT: addq $4, %rcx
327 ; GENERIC-NEXT: cmpl $1, %edi
328 ; GENERIC-NEXT: jne LBB1_2
329 ; GENERIC-NEXT: LBB1_3: ## %for.end
333 ; ATOM: ## %bb.0: ## %entry
334 ; ATOM-NEXT: xorl %eax, %eax
335 ; ATOM-NEXT: cmpl $1, %edi
336 ; ATOM-NEXT: je LBB1_3
337 ; ATOM-NEXT: ## %bb.1: ## %for.body.lr.ph
338 ; ATOM-NEXT: movslq %edi, %rax
339 ; ATOM-NEXT: xorl %edx, %edx
340 ; ATOM-NEXT: leaq (%rsi,%rax,4), %rcx
341 ; ATOM-NEXT: xorl %eax, %eax
342 ; ATOM-NEXT: .p2align 4, 0x90
343 ; ATOM-NEXT: LBB1_2: ## %for.body
344 ; ATOM-NEXT: ## =>This Inner Loop Header: Depth=1
345 ; ATOM-NEXT: movl (%rcx), %esi
346 ; ATOM-NEXT: cmpl %edx, %esi
347 ; ATOM-NEXT: cmoval %esi, %edx
348 ; ATOM-NEXT: cmoval %edi, %eax
349 ; ATOM-NEXT: incl %edi
350 ; ATOM-NEXT: leaq 4(%rcx), %rcx
351 ; ATOM-NEXT: cmpl $1, %edi
352 ; ATOM-NEXT: jne LBB1_2
353 ; ATOM-NEXT: LBB1_3: ## %for.end
358 %cmp4 = icmp eq i32 %i, 1
359 br i1 %cmp4, label %for.end, label %for.body.lr.ph
361 for.body.lr.ph: ; preds = %entry
362 %0 = sext i32 %i to i64
365 for.body: ; preds = %for.body.lr.ph, %for.body
366 %indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
367 %bi.06 = phi i32 [ 0, %for.body.lr.ph ], [ %i.addr.0.bi.0, %for.body ]
368 %b.05 = phi i32 [ 0, %for.body.lr.ph ], [ %.b.0, %for.body ]
369 %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
370 %1 = load i32, i32* %arrayidx, align 4
371 %cmp1 = icmp ugt i32 %1, %b.05
372 %.b.0 = select i1 %cmp1, i32 %1, i32 %b.05
373 %2 = trunc i64 %indvars.iv to i32
374 %i.addr.0.bi.0 = select i1 %cmp1, i32 %2, i32 %bi.06
375 %indvars.iv.next = add i64 %indvars.iv, 1
376 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
377 %exitcond = icmp eq i32 %lftr.wideiv, 1
378 br i1 %exitcond, label %for.end, label %for.body
380 for.end: ; preds = %for.body, %entry
381 %bi.0.lcssa = phi i32 [ 0, %entry ], [ %i.addr.0.bi.0, %for.body ]