1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
4 ; void foo(ptr data, float d) {
6 ; for (i = 0; i < 8000; i++)
10 ; This loop will be unrolled by 96 and vectorized on power9.
11 ; icmp for loop iteration index and loop trip count(384) has LSRUse for 'reg({0,+,384})'.
12 ; Make sure above icmp does not impact LSR choose best formulae sets based on 'reg({(192 + %0),+,384})'
14 define void @foo(ptr nocapture %data, float %d) {
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: xscvdpspn 0, 1
18 ; CHECK-NEXT: li 5, 83
19 ; CHECK-NEXT: addi 4, 3, 192
21 ; CHECK-NEXT: xxspltw 0, 0, 0
22 ; CHECK-NEXT: .p2align 4
23 ; CHECK-NEXT: .LBB0_1: # %vector.body
25 ; CHECK-NEXT: stxv 0, -192(4)
26 ; CHECK-NEXT: stxv 0, -176(4)
27 ; CHECK-NEXT: stxv 0, -160(4)
28 ; CHECK-NEXT: stxv 0, -144(4)
29 ; CHECK-NEXT: stxv 0, -128(4)
30 ; CHECK-NEXT: stxv 0, -112(4)
31 ; CHECK-NEXT: stxv 0, -96(4)
32 ; CHECK-NEXT: stxv 0, -80(4)
33 ; CHECK-NEXT: stxv 0, -64(4)
34 ; CHECK-NEXT: stxv 0, -48(4)
35 ; CHECK-NEXT: stxv 0, -32(4)
36 ; CHECK-NEXT: stxv 0, -16(4)
37 ; CHECK-NEXT: stxv 0, 0(4)
38 ; CHECK-NEXT: stxv 0, 16(4)
39 ; CHECK-NEXT: stxv 0, 32(4)
40 ; CHECK-NEXT: stxv 0, 48(4)
41 ; CHECK-NEXT: stxv 0, 64(4)
42 ; CHECK-NEXT: stxv 0, 80(4)
43 ; CHECK-NEXT: stxv 0, 96(4)
44 ; CHECK-NEXT: stxv 0, 112(4)
45 ; CHECK-NEXT: stxv 0, 128(4)
46 ; CHECK-NEXT: stxv 0, 144(4)
47 ; CHECK-NEXT: stxv 0, 160(4)
48 ; CHECK-NEXT: stxv 0, 176(4)
49 ; CHECK-NEXT: addi 4, 4, 384
50 ; CHECK-NEXT: bdnz .LBB0_1
51 ; CHECK-NEXT: # %bb.2: # %for.body
52 ; CHECK-NEXT: stfs 1, 31872(3)
53 ; CHECK-NEXT: stfs 1, 31876(3)
54 ; CHECK-NEXT: stfs 1, 31880(3)
55 ; CHECK-NEXT: stfs 1, 31884(3)
56 ; CHECK-NEXT: stfs 1, 31888(3)
57 ; CHECK-NEXT: stfs 1, 31892(3)
58 ; CHECK-NEXT: stfs 1, 31896(3)
59 ; CHECK-NEXT: stfs 1, 31900(3)
60 ; CHECK-NEXT: stfs 1, 31904(3)
61 ; CHECK-NEXT: stfs 1, 31908(3)
62 ; CHECK-NEXT: stfs 1, 31912(3)
63 ; CHECK-NEXT: stfs 1, 31916(3)
64 ; CHECK-NEXT: stfs 1, 31920(3)
65 ; CHECK-NEXT: stfs 1, 31924(3)
66 ; CHECK-NEXT: stfs 1, 31928(3)
67 ; CHECK-NEXT: stfs 1, 31932(3)
68 ; CHECK-NEXT: stfs 1, 31936(3)
69 ; CHECK-NEXT: stfs 1, 31940(3)
70 ; CHECK-NEXT: stfs 1, 31944(3)
71 ; CHECK-NEXT: stfs 1, 31948(3)
72 ; CHECK-NEXT: stfs 1, 31952(3)
73 ; CHECK-NEXT: stfs 1, 31956(3)
74 ; CHECK-NEXT: stfs 1, 31960(3)
75 ; CHECK-NEXT: stfs 1, 31964(3)
76 ; CHECK-NEXT: stfs 1, 31968(3)
77 ; CHECK-NEXT: stfs 1, 31972(3)
78 ; CHECK-NEXT: stfs 1, 31976(3)
79 ; CHECK-NEXT: stfs 1, 31980(3)
80 ; CHECK-NEXT: stfs 1, 31984(3)
81 ; CHECK-NEXT: stfs 1, 31988(3)
82 ; CHECK-NEXT: stfs 1, 31992(3)
83 ; CHECK-NEXT: stfs 1, 31996(3)
87 %broadcast.splatinsert16 = insertelement <4 x float> undef, float %d, i32 0
88 %broadcast.splat17 = shufflevector <4 x float> %broadcast.splatinsert16, <4 x float> undef, <4 x i32> zeroinitializer
89 %broadcast.splatinsert18 = insertelement <4 x float> undef, float %d, i32 0
90 %broadcast.splat19 = shufflevector <4 x float> %broadcast.splatinsert18, <4 x float> undef, <4 x i32> zeroinitializer
91 %broadcast.splatinsert20 = insertelement <4 x float> undef, float %d, i32 0
92 %broadcast.splat21 = shufflevector <4 x float> %broadcast.splatinsert20, <4 x float> undef, <4 x i32> zeroinitializer
93 %broadcast.splatinsert22 = insertelement <4 x float> undef, float %d, i32 0
94 %broadcast.splat23 = shufflevector <4 x float> %broadcast.splatinsert22, <4 x float> undef, <4 x i32> zeroinitializer
95 %broadcast.splatinsert24 = insertelement <4 x float> undef, float %d, i32 0
96 %broadcast.splat25 = shufflevector <4 x float> %broadcast.splatinsert24, <4 x float> undef, <4 x i32> zeroinitializer
97 %broadcast.splatinsert26 = insertelement <4 x float> undef, float %d, i32 0
98 %broadcast.splat27 = shufflevector <4 x float> %broadcast.splatinsert26, <4 x float> undef, <4 x i32> zeroinitializer
99 %broadcast.splatinsert28 = insertelement <4 x float> undef, float %d, i32 0
100 %broadcast.splat29 = shufflevector <4 x float> %broadcast.splatinsert28, <4 x float> undef, <4 x i32> zeroinitializer
101 %broadcast.splatinsert30 = insertelement <4 x float> undef, float %d, i32 0
102 %broadcast.splat31 = shufflevector <4 x float> %broadcast.splatinsert30, <4 x float> undef, <4 x i32> zeroinitializer
103 %broadcast.splatinsert32 = insertelement <4 x float> undef, float %d, i32 0
104 %broadcast.splat33 = shufflevector <4 x float> %broadcast.splatinsert32, <4 x float> undef, <4 x i32> zeroinitializer
105 %broadcast.splatinsert34 = insertelement <4 x float> undef, float %d, i32 0
106 %broadcast.splat35 = shufflevector <4 x float> %broadcast.splatinsert34, <4 x float> undef, <4 x i32> zeroinitializer
107 %broadcast.splatinsert36 = insertelement <4 x float> undef, float %d, i32 0
108 %broadcast.splat37 = shufflevector <4 x float> %broadcast.splatinsert36, <4 x float> undef, <4 x i32> zeroinitializer
109 %broadcast.splatinsert38 = insertelement <4 x float> undef, float %d, i32 0
110 %broadcast.splat39 = shufflevector <4 x float> %broadcast.splatinsert38, <4 x float> undef, <4 x i32> zeroinitializer
111 br label %vector.body
113 vector.body: ; preds = %vector.body, %entry
114 %index = phi i64 [ 0, %entry ], [ %index.next.1, %vector.body ]
115 %0 = getelementptr inbounds float, ptr %data, i64 %index
116 store <4 x float> %broadcast.splat17, ptr %0, align 4
117 %1 = getelementptr inbounds float, ptr %0, i64 4
118 store <4 x float> %broadcast.splat19, ptr %1, align 4
119 %2 = getelementptr inbounds float, ptr %0, i64 8
120 store <4 x float> %broadcast.splat21, ptr %2, align 4
121 %3 = getelementptr inbounds float, ptr %0, i64 12
122 store <4 x float> %broadcast.splat23, ptr %3, align 4
123 %4 = getelementptr inbounds float, ptr %0, i64 16
124 store <4 x float> %broadcast.splat25, ptr %4, align 4
125 %5 = getelementptr inbounds float, ptr %0, i64 20
126 store <4 x float> %broadcast.splat27, ptr %5, align 4
127 %6 = getelementptr inbounds float, ptr %0, i64 24
128 store <4 x float> %broadcast.splat29, ptr %6, align 4
129 %7 = getelementptr inbounds float, ptr %0, i64 28
130 store <4 x float> %broadcast.splat31, ptr %7, align 4
131 %8 = getelementptr inbounds float, ptr %0, i64 32
132 store <4 x float> %broadcast.splat33, ptr %8, align 4
133 %9 = getelementptr inbounds float, ptr %0, i64 36
134 store <4 x float> %broadcast.splat35, ptr %9, align 4
135 %10 = getelementptr inbounds float, ptr %0, i64 40
136 store <4 x float> %broadcast.splat37, ptr %10, align 4
137 %11 = getelementptr inbounds float, ptr %0, i64 44
138 store <4 x float> %broadcast.splat39, ptr %11, align 4
139 %index.next = add nuw nsw i64 %index, 48
140 %12 = getelementptr inbounds float, ptr %data, i64 %index.next
141 store <4 x float> %broadcast.splat17, ptr %12, align 4
142 %13 = getelementptr inbounds float, ptr %12, i64 4
143 store <4 x float> %broadcast.splat19, ptr %13, align 4
144 %14 = getelementptr inbounds float, ptr %12, i64 8
145 store <4 x float> %broadcast.splat21, ptr %14, align 4
146 %15 = getelementptr inbounds float, ptr %12, i64 12
147 store <4 x float> %broadcast.splat23, ptr %15, align 4
148 %16 = getelementptr inbounds float, ptr %12, i64 16
149 store <4 x float> %broadcast.splat25, ptr %16, align 4
150 %17 = getelementptr inbounds float, ptr %12, i64 20
151 store <4 x float> %broadcast.splat27, ptr %17, align 4
152 %18 = getelementptr inbounds float, ptr %12, i64 24
153 store <4 x float> %broadcast.splat29, ptr %18, align 4
154 %19 = getelementptr inbounds float, ptr %12, i64 28
155 store <4 x float> %broadcast.splat31, ptr %19, align 4
156 %20 = getelementptr inbounds float, ptr %12, i64 32
157 store <4 x float> %broadcast.splat33, ptr %20, align 4
158 %21 = getelementptr inbounds float, ptr %12, i64 36
159 store <4 x float> %broadcast.splat35, ptr %21, align 4
160 %22 = getelementptr inbounds float, ptr %12, i64 40
161 store <4 x float> %broadcast.splat37, ptr %22, align 4
162 %23 = getelementptr inbounds float, ptr %12, i64 44
163 store <4 x float> %broadcast.splat39, ptr %23, align 4
164 %index.next.1 = add nuw nsw i64 %index, 96
165 %24 = icmp eq i64 %index.next.1, 7968
166 br i1 %24, label %for.body, label %vector.body
168 for.body: ; preds = %vector.body
169 %arrayidx = getelementptr inbounds float, ptr %data, i64 7968
170 store float %d, ptr %arrayidx, align 4
171 %arrayidx.1 = getelementptr inbounds float, ptr %data, i64 7969
172 store float %d, ptr %arrayidx.1, align 4
173 %arrayidx.2 = getelementptr inbounds float, ptr %data, i64 7970
174 store float %d, ptr %arrayidx.2, align 4
175 %arrayidx.3 = getelementptr inbounds float, ptr %data, i64 7971
176 store float %d, ptr %arrayidx.3, align 4
177 %arrayidx.4 = getelementptr inbounds float, ptr %data, i64 7972
178 store float %d, ptr %arrayidx.4, align 4
179 %arrayidx.5 = getelementptr inbounds float, ptr %data, i64 7973
180 store float %d, ptr %arrayidx.5, align 4
181 %arrayidx.6 = getelementptr inbounds float, ptr %data, i64 7974
182 store float %d, ptr %arrayidx.6, align 4
183 %arrayidx.7 = getelementptr inbounds float, ptr %data, i64 7975
184 store float %d, ptr %arrayidx.7, align 4
185 %arrayidx.8 = getelementptr inbounds float, ptr %data, i64 7976
186 store float %d, ptr %arrayidx.8, align 4
187 %arrayidx.9 = getelementptr inbounds float, ptr %data, i64 7977
188 store float %d, ptr %arrayidx.9, align 4
189 %arrayidx.10 = getelementptr inbounds float, ptr %data, i64 7978
190 store float %d, ptr %arrayidx.10, align 4
191 %arrayidx.11 = getelementptr inbounds float, ptr %data, i64 7979
192 store float %d, ptr %arrayidx.11, align 4
193 %arrayidx.12 = getelementptr inbounds float, ptr %data, i64 7980
194 store float %d, ptr %arrayidx.12, align 4
195 %arrayidx.13 = getelementptr inbounds float, ptr %data, i64 7981
196 store float %d, ptr %arrayidx.13, align 4
197 %arrayidx.14 = getelementptr inbounds float, ptr %data, i64 7982
198 store float %d, ptr %arrayidx.14, align 4
199 %arrayidx.15 = getelementptr inbounds float, ptr %data, i64 7983
200 store float %d, ptr %arrayidx.15, align 4
201 %arrayidx.16 = getelementptr inbounds float, ptr %data, i64 7984
202 store float %d, ptr %arrayidx.16, align 4
203 %arrayidx.17 = getelementptr inbounds float, ptr %data, i64 7985
204 store float %d, ptr %arrayidx.17, align 4
205 %arrayidx.18 = getelementptr inbounds float, ptr %data, i64 7986
206 store float %d, ptr %arrayidx.18, align 4
207 %arrayidx.19 = getelementptr inbounds float, ptr %data, i64 7987
208 store float %d, ptr %arrayidx.19, align 4
209 %arrayidx.20 = getelementptr inbounds float, ptr %data, i64 7988
210 store float %d, ptr %arrayidx.20, align 4
211 %arrayidx.21 = getelementptr inbounds float, ptr %data, i64 7989
212 store float %d, ptr %arrayidx.21, align 4
213 %arrayidx.22 = getelementptr inbounds float, ptr %data, i64 7990
214 store float %d, ptr %arrayidx.22, align 4
215 %arrayidx.23 = getelementptr inbounds float, ptr %data, i64 7991
216 store float %d, ptr %arrayidx.23, align 4
217 %arrayidx.24 = getelementptr inbounds float, ptr %data, i64 7992
218 store float %d, ptr %arrayidx.24, align 4
219 %arrayidx.25 = getelementptr inbounds float, ptr %data, i64 7993
220 store float %d, ptr %arrayidx.25, align 4
221 %arrayidx.26 = getelementptr inbounds float, ptr %data, i64 7994
222 store float %d, ptr %arrayidx.26, align 4
223 %arrayidx.27 = getelementptr inbounds float, ptr %data, i64 7995
224 store float %d, ptr %arrayidx.27, align 4
225 %arrayidx.28 = getelementptr inbounds float, ptr %data, i64 7996
226 store float %d, ptr %arrayidx.28, align 4
227 %arrayidx.29 = getelementptr inbounds float, ptr %data, i64 7997
228 store float %d, ptr %arrayidx.29, align 4
229 %arrayidx.30 = getelementptr inbounds float, ptr %data, i64 7998
230 store float %d, ptr %arrayidx.30, align 4
231 %arrayidx.31 = getelementptr inbounds float, ptr %data, i64 7999
232 store float %d, ptr %arrayidx.31, align 4