1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc < %s -mtriple=i686-darwin | FileCheck %s
4 define void @foo(ptr %buf, i32 %size, i32 %col, ptr %p) nounwind {
6 ; CHECK: ## %bb.0: ## %entry
7 ; CHECK-NEXT: pushl %ebx
8 ; CHECK-NEXT: pushl %edi
9 ; CHECK-NEXT: pushl %esi
10 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
11 ; CHECK-NEXT: testl %eax, %eax
12 ; CHECK-NEXT: jle LBB0_3
13 ; CHECK-NEXT: ## %bb.1: ## %bb.preheader
14 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
15 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edx
16 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
17 ; CHECK-NEXT: addl $8, %ecx
18 ; CHECK-NEXT: .p2align 4, 0x90
19 ; CHECK-NEXT: LBB0_2: ## %bb
20 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
21 ; CHECK-NEXT: movl (%esi), %edi
22 ; CHECK-NEXT: movzbl -8(%ecx), %ebx
23 ; CHECK-NEXT: movb %bl, (%edi,%edx)
24 ; CHECK-NEXT: movzbl -7(%ecx), %ebx
25 ; CHECK-NEXT: movb %bl, 7(%edi,%edx)
26 ; CHECK-NEXT: movzbl -6(%ecx), %ebx
27 ; CHECK-NEXT: movb %bl, 5(%edi,%edx)
28 ; CHECK-NEXT: movzbl -5(%ecx), %ebx
29 ; CHECK-NEXT: movb %bl, 3(%edi,%edx)
30 ; CHECK-NEXT: movzbl -4(%ecx), %ebx
31 ; CHECK-NEXT: movb %bl, 2(%edi,%edx)
32 ; CHECK-NEXT: movzbl -3(%ecx), %ebx
33 ; CHECK-NEXT: movb %bl, 1(%edi,%edx)
34 ; CHECK-NEXT: movzbl -2(%ecx), %ebx
35 ; CHECK-NEXT: movb %bl, 2(%edi,%edx)
36 ; CHECK-NEXT: movzbl -1(%ecx), %ebx
37 ; CHECK-NEXT: movb %bl, 4(%edi,%edx)
38 ; CHECK-NEXT: movzbl (%ecx), %ebx
39 ; CHECK-NEXT: movb %bl, 6(%edi,%edx)
40 ; CHECK-NEXT: addl $4, %esi
41 ; CHECK-NEXT: addl $9, %ecx
42 ; CHECK-NEXT: decl %eax
43 ; CHECK-NEXT: jne LBB0_2
44 ; CHECK-NEXT: LBB0_3: ## %return
45 ; CHECK-NEXT: popl %esi
46 ; CHECK-NEXT: popl %edi
47 ; CHECK-NEXT: popl %ebx
50 icmp sgt i32 %size, 0 ; <i1>:0 [#uses=1]
51 br i1 %0, label %bb.preheader, label %return
53 bb.preheader: ; preds = %entry
54 %tmp5.sum72 = add i32 %col, 7 ; <i32> [#uses=1]
55 %tmp5.sum71 = add i32 %col, 5 ; <i32> [#uses=1]
56 %tmp5.sum70 = add i32 %col, 3 ; <i32> [#uses=1]
57 %tmp5.sum69 = add i32 %col, 2 ; <i32> [#uses=1]
58 %tmp5.sum68 = add i32 %col, 1 ; <i32> [#uses=1]
59 %tmp5.sum66 = add i32 %col, 4 ; <i32> [#uses=1]
60 %tmp5.sum = add i32 %col, 6 ; <i32> [#uses=1]
63 bb: ; preds = %bb, %bb.preheader
64 %i.073.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=3]
65 %p_addr.076.0.rec = mul i32 %i.073.0, 9 ; <i32> [#uses=9]
66 %p_addr.076.0 = getelementptr i8, ptr %p, i32 %p_addr.076.0.rec ; <ptr> [#uses=1]
67 %tmp2 = getelementptr ptr, ptr %buf, i32 %i.073.0 ; <ptr> [#uses=1]
68 %tmp3 = load ptr, ptr %tmp2 ; <ptr> [#uses=8]
69 %tmp5 = getelementptr i8, ptr %tmp3, i32 %col ; <ptr> [#uses=1]
70 %tmp7 = load i8, ptr %p_addr.076.0 ; <i8> [#uses=1]
71 store i8 %tmp7, ptr %tmp5
72 %p_addr.076.0.sum93 = add i32 %p_addr.076.0.rec, 1 ; <i32> [#uses=1]
73 %tmp11 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum93 ; <ptr> [#uses=1]
74 %tmp13 = load i8, ptr %tmp11 ; <i8> [#uses=1]
75 %tmp15 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum72 ; <ptr> [#uses=1]
76 store i8 %tmp13, ptr %tmp15
77 %p_addr.076.0.sum92 = add i32 %p_addr.076.0.rec, 2 ; <i32> [#uses=1]
78 %tmp17 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum92 ; <ptr> [#uses=1]
79 %tmp19 = load i8, ptr %tmp17 ; <i8> [#uses=1]
80 %tmp21 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum71 ; <ptr> [#uses=1]
81 store i8 %tmp19, ptr %tmp21
82 %p_addr.076.0.sum91 = add i32 %p_addr.076.0.rec, 3 ; <i32> [#uses=1]
83 %tmp23 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum91 ; <ptr> [#uses=1]
84 %tmp25 = load i8, ptr %tmp23 ; <i8> [#uses=1]
85 %tmp27 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum70 ; <ptr> [#uses=1]
86 store i8 %tmp25, ptr %tmp27
87 %p_addr.076.0.sum90 = add i32 %p_addr.076.0.rec, 4 ; <i32> [#uses=1]
88 %tmp29 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum90 ; <ptr> [#uses=1]
89 %tmp31 = load i8, ptr %tmp29 ; <i8> [#uses=1]
90 %tmp33 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum69 ; <ptr> [#uses=2]
91 store i8 %tmp31, ptr %tmp33
92 %p_addr.076.0.sum89 = add i32 %p_addr.076.0.rec, 5 ; <i32> [#uses=1]
93 %tmp35 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum89 ; <ptr> [#uses=1]
94 %tmp37 = load i8, ptr %tmp35 ; <i8> [#uses=1]
95 %tmp39 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum68 ; <ptr> [#uses=1]
96 store i8 %tmp37, ptr %tmp39
97 %p_addr.076.0.sum88 = add i32 %p_addr.076.0.rec, 6 ; <i32> [#uses=1]
98 %tmp41 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum88 ; <ptr> [#uses=1]
99 %tmp43 = load i8, ptr %tmp41 ; <i8> [#uses=1]
100 store i8 %tmp43, ptr %tmp33
101 %p_addr.076.0.sum87 = add i32 %p_addr.076.0.rec, 7 ; <i32> [#uses=1]
102 %tmp47 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum87 ; <ptr> [#uses=1]
103 %tmp49 = load i8, ptr %tmp47 ; <i8> [#uses=1]
104 %tmp51 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum66 ; <ptr> [#uses=1]
105 store i8 %tmp49, ptr %tmp51
106 %p_addr.076.0.sum = add i32 %p_addr.076.0.rec, 8 ; <i32> [#uses=1]
107 %tmp53 = getelementptr i8, ptr %p, i32 %p_addr.076.0.sum ; <ptr> [#uses=1]
108 %tmp55 = load i8, ptr %tmp53 ; <i8> [#uses=1]
109 %tmp57 = getelementptr i8, ptr %tmp3, i32 %tmp5.sum ; <ptr> [#uses=1]
110 store i8 %tmp55, ptr %tmp57
111 %indvar.next = add i32 %i.073.0, 1 ; <i32> [#uses=2]
112 icmp eq i32 %indvar.next, %size ; <i1>:1 [#uses=1]
113 br i1 %1, label %return, label %bb
115 return: ; preds = %bb, %entry