1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -slp-vectorizer -dce -instcombine < %s | FileCheck %s --check-prefix=GENERIC
3 ; RUN: opt -S -mcpu=kryo -slp-vectorizer -dce -instcombine < %s | FileCheck %s --check-prefix=KRYO
5 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
6 target triple = "aarch64--linux-gnu"
8 ; These tests check that we vectorize the index calculations in the
9 ; gather-reduce pattern shown below. We check cases having i32 and i64
12 ; int gather_reduce_8x16(short *a, short *b, short *g, int n) {
14 ; for (int i = 0; i < n ; ++i) {
15 ; sum += g[*a++ - b[0]]; sum += g[*a++ - b[1]];
16 ; sum += g[*a++ - b[2]]; sum += g[*a++ - b[3]];
17 ; sum += g[*a++ - b[4]]; sum += g[*a++ - b[5]];
18 ; sum += g[*a++ - b[6]]; sum += g[*a++ - b[7]];
23 define i32 @gather_reduce_8x16_i32(i16* nocapture readonly %a, i16* nocapture readonly %b, i16* nocapture readonly %g, i32 %n) {
24 ; GENERIC-LABEL: @gather_reduce_8x16_i32(
25 ; GENERIC-NEXT: entry:
26 ; GENERIC-NEXT: [[CMP_99:%.*]] = icmp sgt i32 [[N:%.*]], 0
27 ; GENERIC-NEXT: br i1 [[CMP_99]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
28 ; GENERIC: for.body.preheader:
29 ; GENERIC-NEXT: br label [[FOR_BODY:%.*]]
30 ; GENERIC: for.cond.cleanup.loopexit:
31 ; GENERIC-NEXT: br label [[FOR_COND_CLEANUP]]
32 ; GENERIC: for.cond.cleanup:
33 ; GENERIC-NEXT: [[SUM_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD66:%.*]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]
34 ; GENERIC-NEXT: ret i32 [[SUM_0_LCSSA]]
36 ; GENERIC-NEXT: [[I_0103:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
37 ; GENERIC-NEXT: [[SUM_0102:%.*]] = phi i32 [ [[ADD66]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
38 ; GENERIC-NEXT: [[A_ADDR_0101:%.*]] = phi i16* [ [[INCDEC_PTR58:%.*]], [[FOR_BODY]] ], [ [[A:%.*]], [[FOR_BODY_PREHEADER]] ]
39 ; GENERIC-NEXT: [[TMP0:%.*]] = bitcast i16* [[A_ADDR_0101]] to <8 x i16>*
40 ; GENERIC-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
41 ; GENERIC-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[TMP1]] to <8 x i32>
42 ; GENERIC-NEXT: [[TMP3:%.*]] = bitcast i16* [[B:%.*]] to <8 x i16>*
43 ; GENERIC-NEXT: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 2
44 ; GENERIC-NEXT: [[TMP5:%.*]] = zext <8 x i16> [[TMP4]] to <8 x i32>
45 ; GENERIC-NEXT: [[TMP6:%.*]] = sub nsw <8 x i32> [[TMP2]], [[TMP5]]
46 ; GENERIC-NEXT: [[TMP7:%.*]] = extractelement <8 x i32> [[TMP6]], i32 0
47 ; GENERIC-NEXT: [[TMP8:%.*]] = sext i32 [[TMP7]] to i64
48 ; GENERIC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, i16* [[G:%.*]], i64 [[TMP8]]
49 ; GENERIC-NEXT: [[TMP9:%.*]] = load i16, i16* [[ARRAYIDX]], align 2
50 ; GENERIC-NEXT: [[CONV3:%.*]] = zext i16 [[TMP9]] to i32
51 ; GENERIC-NEXT: [[ADD:%.*]] = add nsw i32 [[SUM_0102]], [[CONV3]]
52 ; GENERIC-NEXT: [[TMP10:%.*]] = extractelement <8 x i32> [[TMP6]], i32 1
53 ; GENERIC-NEXT: [[TMP11:%.*]] = sext i32 [[TMP10]] to i64
54 ; GENERIC-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP11]]
55 ; GENERIC-NEXT: [[TMP12:%.*]] = load i16, i16* [[ARRAYIDX10]], align 2
56 ; GENERIC-NEXT: [[CONV11:%.*]] = zext i16 [[TMP12]] to i32
57 ; GENERIC-NEXT: [[ADD12:%.*]] = add nsw i32 [[ADD]], [[CONV11]]
58 ; GENERIC-NEXT: [[TMP13:%.*]] = extractelement <8 x i32> [[TMP6]], i32 2
59 ; GENERIC-NEXT: [[TMP14:%.*]] = sext i32 [[TMP13]] to i64
60 ; GENERIC-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP14]]
61 ; GENERIC-NEXT: [[TMP15:%.*]] = load i16, i16* [[ARRAYIDX19]], align 2
62 ; GENERIC-NEXT: [[CONV20:%.*]] = zext i16 [[TMP15]] to i32
63 ; GENERIC-NEXT: [[ADD21:%.*]] = add nsw i32 [[ADD12]], [[CONV20]]
64 ; GENERIC-NEXT: [[TMP16:%.*]] = extractelement <8 x i32> [[TMP6]], i32 3
65 ; GENERIC-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64
66 ; GENERIC-NEXT: [[ARRAYIDX28:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP17]]
67 ; GENERIC-NEXT: [[TMP18:%.*]] = load i16, i16* [[ARRAYIDX28]], align 2
68 ; GENERIC-NEXT: [[CONV29:%.*]] = zext i16 [[TMP18]] to i32
69 ; GENERIC-NEXT: [[ADD30:%.*]] = add nsw i32 [[ADD21]], [[CONV29]]
70 ; GENERIC-NEXT: [[TMP19:%.*]] = extractelement <8 x i32> [[TMP6]], i32 4
71 ; GENERIC-NEXT: [[TMP20:%.*]] = sext i32 [[TMP19]] to i64
72 ; GENERIC-NEXT: [[ARRAYIDX37:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP20]]
73 ; GENERIC-NEXT: [[TMP21:%.*]] = load i16, i16* [[ARRAYIDX37]], align 2
74 ; GENERIC-NEXT: [[CONV38:%.*]] = zext i16 [[TMP21]] to i32
75 ; GENERIC-NEXT: [[ADD39:%.*]] = add nsw i32 [[ADD30]], [[CONV38]]
76 ; GENERIC-NEXT: [[TMP22:%.*]] = extractelement <8 x i32> [[TMP6]], i32 5
77 ; GENERIC-NEXT: [[TMP23:%.*]] = sext i32 [[TMP22]] to i64
78 ; GENERIC-NEXT: [[ARRAYIDX46:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP23]]
79 ; GENERIC-NEXT: [[TMP24:%.*]] = load i16, i16* [[ARRAYIDX46]], align 2
80 ; GENERIC-NEXT: [[CONV47:%.*]] = zext i16 [[TMP24]] to i32
81 ; GENERIC-NEXT: [[ADD48:%.*]] = add nsw i32 [[ADD39]], [[CONV47]]
82 ; GENERIC-NEXT: [[TMP25:%.*]] = extractelement <8 x i32> [[TMP6]], i32 6
83 ; GENERIC-NEXT: [[TMP26:%.*]] = sext i32 [[TMP25]] to i64
84 ; GENERIC-NEXT: [[ARRAYIDX55:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP26]]
85 ; GENERIC-NEXT: [[TMP27:%.*]] = load i16, i16* [[ARRAYIDX55]], align 2
86 ; GENERIC-NEXT: [[CONV56:%.*]] = zext i16 [[TMP27]] to i32
87 ; GENERIC-NEXT: [[ADD57:%.*]] = add nsw i32 [[ADD48]], [[CONV56]]
88 ; GENERIC-NEXT: [[INCDEC_PTR58]] = getelementptr inbounds i16, i16* [[A_ADDR_0101]], i64 8
89 ; GENERIC-NEXT: [[TMP28:%.*]] = extractelement <8 x i32> [[TMP6]], i32 7
90 ; GENERIC-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
91 ; GENERIC-NEXT: [[ARRAYIDX64:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP29]]
92 ; GENERIC-NEXT: [[TMP30:%.*]] = load i16, i16* [[ARRAYIDX64]], align 2
93 ; GENERIC-NEXT: [[CONV65:%.*]] = zext i16 [[TMP30]] to i32
94 ; GENERIC-NEXT: [[ADD66]] = add nsw i32 [[ADD57]], [[CONV65]]
95 ; GENERIC-NEXT: [[INC]] = add nuw nsw i32 [[I_0103]], 1
96 ; GENERIC-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], [[N]]
97 ; GENERIC-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]]
99 ; KRYO-LABEL: @gather_reduce_8x16_i32(
101 ; KRYO-NEXT: [[CMP_99:%.*]] = icmp sgt i32 [[N:%.*]], 0
102 ; KRYO-NEXT: br i1 [[CMP_99]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
103 ; KRYO: for.body.preheader:
104 ; KRYO-NEXT: br label [[FOR_BODY:%.*]]
105 ; KRYO: for.cond.cleanup.loopexit:
106 ; KRYO-NEXT: br label [[FOR_COND_CLEANUP]]
107 ; KRYO: for.cond.cleanup:
108 ; KRYO-NEXT: [[SUM_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD66:%.*]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]
109 ; KRYO-NEXT: ret i32 [[SUM_0_LCSSA]]
111 ; KRYO-NEXT: [[I_0103:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
112 ; KRYO-NEXT: [[SUM_0102:%.*]] = phi i32 [ [[ADD66]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
113 ; KRYO-NEXT: [[A_ADDR_0101:%.*]] = phi i16* [ [[INCDEC_PTR58:%.*]], [[FOR_BODY]] ], [ [[A:%.*]], [[FOR_BODY_PREHEADER]] ]
114 ; KRYO-NEXT: [[TMP0:%.*]] = bitcast i16* [[A_ADDR_0101]] to <8 x i16>*
115 ; KRYO-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
116 ; KRYO-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[TMP1]] to <8 x i32>
117 ; KRYO-NEXT: [[TMP3:%.*]] = bitcast i16* [[B:%.*]] to <8 x i16>*
118 ; KRYO-NEXT: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 2
119 ; KRYO-NEXT: [[TMP5:%.*]] = zext <8 x i16> [[TMP4]] to <8 x i32>
120 ; KRYO-NEXT: [[TMP6:%.*]] = sub nsw <8 x i32> [[TMP2]], [[TMP5]]
121 ; KRYO-NEXT: [[TMP7:%.*]] = extractelement <8 x i32> [[TMP6]], i32 0
122 ; KRYO-NEXT: [[TMP8:%.*]] = sext i32 [[TMP7]] to i64
123 ; KRYO-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, i16* [[G:%.*]], i64 [[TMP8]]
124 ; KRYO-NEXT: [[TMP9:%.*]] = load i16, i16* [[ARRAYIDX]], align 2
125 ; KRYO-NEXT: [[CONV3:%.*]] = zext i16 [[TMP9]] to i32
126 ; KRYO-NEXT: [[ADD:%.*]] = add nsw i32 [[SUM_0102]], [[CONV3]]
127 ; KRYO-NEXT: [[TMP10:%.*]] = extractelement <8 x i32> [[TMP6]], i32 1
128 ; KRYO-NEXT: [[TMP11:%.*]] = sext i32 [[TMP10]] to i64
129 ; KRYO-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP11]]
130 ; KRYO-NEXT: [[TMP12:%.*]] = load i16, i16* [[ARRAYIDX10]], align 2
131 ; KRYO-NEXT: [[CONV11:%.*]] = zext i16 [[TMP12]] to i32
132 ; KRYO-NEXT: [[ADD12:%.*]] = add nsw i32 [[ADD]], [[CONV11]]
133 ; KRYO-NEXT: [[TMP13:%.*]] = extractelement <8 x i32> [[TMP6]], i32 2
134 ; KRYO-NEXT: [[TMP14:%.*]] = sext i32 [[TMP13]] to i64
135 ; KRYO-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP14]]
136 ; KRYO-NEXT: [[TMP15:%.*]] = load i16, i16* [[ARRAYIDX19]], align 2
137 ; KRYO-NEXT: [[CONV20:%.*]] = zext i16 [[TMP15]] to i32
138 ; KRYO-NEXT: [[ADD21:%.*]] = add nsw i32 [[ADD12]], [[CONV20]]
139 ; KRYO-NEXT: [[TMP16:%.*]] = extractelement <8 x i32> [[TMP6]], i32 3
140 ; KRYO-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64
141 ; KRYO-NEXT: [[ARRAYIDX28:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP17]]
142 ; KRYO-NEXT: [[TMP18:%.*]] = load i16, i16* [[ARRAYIDX28]], align 2
143 ; KRYO-NEXT: [[CONV29:%.*]] = zext i16 [[TMP18]] to i32
144 ; KRYO-NEXT: [[ADD30:%.*]] = add nsw i32 [[ADD21]], [[CONV29]]
145 ; KRYO-NEXT: [[TMP19:%.*]] = extractelement <8 x i32> [[TMP6]], i32 4
146 ; KRYO-NEXT: [[TMP20:%.*]] = sext i32 [[TMP19]] to i64
147 ; KRYO-NEXT: [[ARRAYIDX37:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP20]]
148 ; KRYO-NEXT: [[TMP21:%.*]] = load i16, i16* [[ARRAYIDX37]], align 2
149 ; KRYO-NEXT: [[CONV38:%.*]] = zext i16 [[TMP21]] to i32
150 ; KRYO-NEXT: [[ADD39:%.*]] = add nsw i32 [[ADD30]], [[CONV38]]
151 ; KRYO-NEXT: [[TMP22:%.*]] = extractelement <8 x i32> [[TMP6]], i32 5
152 ; KRYO-NEXT: [[TMP23:%.*]] = sext i32 [[TMP22]] to i64
153 ; KRYO-NEXT: [[ARRAYIDX46:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP23]]
154 ; KRYO-NEXT: [[TMP24:%.*]] = load i16, i16* [[ARRAYIDX46]], align 2
155 ; KRYO-NEXT: [[CONV47:%.*]] = zext i16 [[TMP24]] to i32
156 ; KRYO-NEXT: [[ADD48:%.*]] = add nsw i32 [[ADD39]], [[CONV47]]
157 ; KRYO-NEXT: [[TMP25:%.*]] = extractelement <8 x i32> [[TMP6]], i32 6
158 ; KRYO-NEXT: [[TMP26:%.*]] = sext i32 [[TMP25]] to i64
159 ; KRYO-NEXT: [[ARRAYIDX55:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP26]]
160 ; KRYO-NEXT: [[TMP27:%.*]] = load i16, i16* [[ARRAYIDX55]], align 2
161 ; KRYO-NEXT: [[CONV56:%.*]] = zext i16 [[TMP27]] to i32
162 ; KRYO-NEXT: [[ADD57:%.*]] = add nsw i32 [[ADD48]], [[CONV56]]
163 ; KRYO-NEXT: [[INCDEC_PTR58]] = getelementptr inbounds i16, i16* [[A_ADDR_0101]], i64 8
164 ; KRYO-NEXT: [[TMP28:%.*]] = extractelement <8 x i32> [[TMP6]], i32 7
165 ; KRYO-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
166 ; KRYO-NEXT: [[ARRAYIDX64:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP29]]
167 ; KRYO-NEXT: [[TMP30:%.*]] = load i16, i16* [[ARRAYIDX64]], align 2
168 ; KRYO-NEXT: [[CONV65:%.*]] = zext i16 [[TMP30]] to i32
169 ; KRYO-NEXT: [[ADD66]] = add nsw i32 [[ADD57]], [[CONV65]]
170 ; KRYO-NEXT: [[INC]] = add nuw nsw i32 [[I_0103]], 1
171 ; KRYO-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], [[N]]
172 ; KRYO-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]]
175 %cmp.99 = icmp sgt i32 %n, 0
176 br i1 %cmp.99, label %for.body.preheader, label %for.cond.cleanup
181 for.cond.cleanup.loopexit:
182 br label %for.cond.cleanup
185 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add66, %for.cond.cleanup.loopexit ]
189 %i.0103 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
190 %sum.0102 = phi i32 [ %add66, %for.body ], [ 0, %for.body.preheader ]
191 %a.addr.0101 = phi i16* [ %incdec.ptr58, %for.body ], [ %a, %for.body.preheader ]
192 %incdec.ptr = getelementptr inbounds i16, i16* %a.addr.0101, i64 1
193 %0 = load i16, i16* %a.addr.0101, align 2
194 %conv = zext i16 %0 to i32
195 %incdec.ptr1 = getelementptr inbounds i16, i16* %b, i64 1
196 %1 = load i16, i16* %b, align 2
197 %conv2 = zext i16 %1 to i32
198 %sub = sub nsw i32 %conv, %conv2
199 %arrayidx = getelementptr inbounds i16, i16* %g, i32 %sub
200 %2 = load i16, i16* %arrayidx, align 2
201 %conv3 = zext i16 %2 to i32
202 %add = add nsw i32 %conv3, %sum.0102
203 %incdec.ptr4 = getelementptr inbounds i16, i16* %a.addr.0101, i64 2
204 %3 = load i16, i16* %incdec.ptr, align 2
205 %conv5 = zext i16 %3 to i32
206 %incdec.ptr6 = getelementptr inbounds i16, i16* %b, i64 2
207 %4 = load i16, i16* %incdec.ptr1, align 2
208 %conv7 = zext i16 %4 to i32
209 %sub8 = sub nsw i32 %conv5, %conv7
210 %arrayidx10 = getelementptr inbounds i16, i16* %g, i32 %sub8
211 %5 = load i16, i16* %arrayidx10, align 2
212 %conv11 = zext i16 %5 to i32
213 %add12 = add nsw i32 %add, %conv11
214 %incdec.ptr13 = getelementptr inbounds i16, i16* %a.addr.0101, i64 3
215 %6 = load i16, i16* %incdec.ptr4, align 2
216 %conv14 = zext i16 %6 to i32
217 %incdec.ptr15 = getelementptr inbounds i16, i16* %b, i64 3
218 %7 = load i16, i16* %incdec.ptr6, align 2
219 %conv16 = zext i16 %7 to i32
220 %sub17 = sub nsw i32 %conv14, %conv16
221 %arrayidx19 = getelementptr inbounds i16, i16* %g, i32 %sub17
222 %8 = load i16, i16* %arrayidx19, align 2
223 %conv20 = zext i16 %8 to i32
224 %add21 = add nsw i32 %add12, %conv20
225 %incdec.ptr22 = getelementptr inbounds i16, i16* %a.addr.0101, i64 4
226 %9 = load i16, i16* %incdec.ptr13, align 2
227 %conv23 = zext i16 %9 to i32
228 %incdec.ptr24 = getelementptr inbounds i16, i16* %b, i64 4
229 %10 = load i16, i16* %incdec.ptr15, align 2
230 %conv25 = zext i16 %10 to i32
231 %sub26 = sub nsw i32 %conv23, %conv25
232 %arrayidx28 = getelementptr inbounds i16, i16* %g, i32 %sub26
233 %11 = load i16, i16* %arrayidx28, align 2
234 %conv29 = zext i16 %11 to i32
235 %add30 = add nsw i32 %add21, %conv29
236 %incdec.ptr31 = getelementptr inbounds i16, i16* %a.addr.0101, i64 5
237 %12 = load i16, i16* %incdec.ptr22, align 2
238 %conv32 = zext i16 %12 to i32
239 %incdec.ptr33 = getelementptr inbounds i16, i16* %b, i64 5
240 %13 = load i16, i16* %incdec.ptr24, align 2
241 %conv34 = zext i16 %13 to i32
242 %sub35 = sub nsw i32 %conv32, %conv34
243 %arrayidx37 = getelementptr inbounds i16, i16* %g, i32 %sub35
244 %14 = load i16, i16* %arrayidx37, align 2
245 %conv38 = zext i16 %14 to i32
246 %add39 = add nsw i32 %add30, %conv38
247 %incdec.ptr40 = getelementptr inbounds i16, i16* %a.addr.0101, i64 6
248 %15 = load i16, i16* %incdec.ptr31, align 2
249 %conv41 = zext i16 %15 to i32
250 %incdec.ptr42 = getelementptr inbounds i16, i16* %b, i64 6
251 %16 = load i16, i16* %incdec.ptr33, align 2
252 %conv43 = zext i16 %16 to i32
253 %sub44 = sub nsw i32 %conv41, %conv43
254 %arrayidx46 = getelementptr inbounds i16, i16* %g, i32 %sub44
255 %17 = load i16, i16* %arrayidx46, align 2
256 %conv47 = zext i16 %17 to i32
257 %add48 = add nsw i32 %add39, %conv47
258 %incdec.ptr49 = getelementptr inbounds i16, i16* %a.addr.0101, i64 7
259 %18 = load i16, i16* %incdec.ptr40, align 2
260 %conv50 = zext i16 %18 to i32
261 %incdec.ptr51 = getelementptr inbounds i16, i16* %b, i64 7
262 %19 = load i16, i16* %incdec.ptr42, align 2
263 %conv52 = zext i16 %19 to i32
264 %sub53 = sub nsw i32 %conv50, %conv52
265 %arrayidx55 = getelementptr inbounds i16, i16* %g, i32 %sub53
266 %20 = load i16, i16* %arrayidx55, align 2
267 %conv56 = zext i16 %20 to i32
268 %add57 = add nsw i32 %add48, %conv56
269 %incdec.ptr58 = getelementptr inbounds i16, i16* %a.addr.0101, i64 8
270 %21 = load i16, i16* %incdec.ptr49, align 2
271 %conv59 = zext i16 %21 to i32
272 %22 = load i16, i16* %incdec.ptr51, align 2
273 %conv61 = zext i16 %22 to i32
274 %sub62 = sub nsw i32 %conv59, %conv61
275 %arrayidx64 = getelementptr inbounds i16, i16* %g, i32 %sub62
276 %23 = load i16, i16* %arrayidx64, align 2
277 %conv65 = zext i16 %23 to i32
278 %add66 = add nsw i32 %add57, %conv65
279 %inc = add nuw nsw i32 %i.0103, 1
280 %exitcond = icmp eq i32 %inc, %n
281 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body
284 define i32 @gather_reduce_8x16_i64(i16* nocapture readonly %a, i16* nocapture readonly %b, i16* nocapture readonly %g, i32 %n) {
285 ; GENERIC-LABEL: @gather_reduce_8x16_i64(
286 ; GENERIC-NEXT: entry:
287 ; GENERIC-NEXT: [[CMP_99:%.*]] = icmp sgt i32 [[N:%.*]], 0
288 ; GENERIC-NEXT: br i1 [[CMP_99]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
289 ; GENERIC: for.body.preheader:
290 ; GENERIC-NEXT: br label [[FOR_BODY:%.*]]
291 ; GENERIC: for.cond.cleanup.loopexit:
292 ; GENERIC-NEXT: br label [[FOR_COND_CLEANUP]]
293 ; GENERIC: for.cond.cleanup:
294 ; GENERIC-NEXT: [[SUM_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD66:%.*]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]
295 ; GENERIC-NEXT: ret i32 [[SUM_0_LCSSA]]
297 ; GENERIC-NEXT: [[I_0103:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
298 ; GENERIC-NEXT: [[SUM_0102:%.*]] = phi i32 [ [[ADD66]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
299 ; GENERIC-NEXT: [[A_ADDR_0101:%.*]] = phi i16* [ [[INCDEC_PTR58:%.*]], [[FOR_BODY]] ], [ [[A:%.*]], [[FOR_BODY_PREHEADER]] ]
300 ; GENERIC-NEXT: [[TMP0:%.*]] = bitcast i16* [[A_ADDR_0101]] to <8 x i16>*
301 ; GENERIC-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
302 ; GENERIC-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[TMP1]] to <8 x i32>
303 ; GENERIC-NEXT: [[TMP3:%.*]] = bitcast i16* [[B:%.*]] to <8 x i16>*
304 ; GENERIC-NEXT: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 2
305 ; GENERIC-NEXT: [[TMP5:%.*]] = zext <8 x i16> [[TMP4]] to <8 x i32>
306 ; GENERIC-NEXT: [[TMP6:%.*]] = sub nsw <8 x i32> [[TMP2]], [[TMP5]]
307 ; GENERIC-NEXT: [[TMP7:%.*]] = extractelement <8 x i32> [[TMP6]], i32 0
308 ; GENERIC-NEXT: [[TMP8:%.*]] = sext i32 [[TMP7]] to i64
309 ; GENERIC-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, i16* [[G:%.*]], i64 [[TMP8]]
310 ; GENERIC-NEXT: [[TMP9:%.*]] = load i16, i16* [[ARRAYIDX]], align 2
311 ; GENERIC-NEXT: [[CONV3:%.*]] = zext i16 [[TMP9]] to i32
312 ; GENERIC-NEXT: [[ADD:%.*]] = add nsw i32 [[SUM_0102]], [[CONV3]]
313 ; GENERIC-NEXT: [[TMP10:%.*]] = extractelement <8 x i32> [[TMP6]], i32 1
314 ; GENERIC-NEXT: [[TMP11:%.*]] = sext i32 [[TMP10]] to i64
315 ; GENERIC-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP11]]
316 ; GENERIC-NEXT: [[TMP12:%.*]] = load i16, i16* [[ARRAYIDX10]], align 2
317 ; GENERIC-NEXT: [[CONV11:%.*]] = zext i16 [[TMP12]] to i32
318 ; GENERIC-NEXT: [[ADD12:%.*]] = add nsw i32 [[ADD]], [[CONV11]]
319 ; GENERIC-NEXT: [[TMP13:%.*]] = extractelement <8 x i32> [[TMP6]], i32 2
320 ; GENERIC-NEXT: [[TMP14:%.*]] = sext i32 [[TMP13]] to i64
321 ; GENERIC-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP14]]
322 ; GENERIC-NEXT: [[TMP15:%.*]] = load i16, i16* [[ARRAYIDX19]], align 2
323 ; GENERIC-NEXT: [[CONV20:%.*]] = zext i16 [[TMP15]] to i32
324 ; GENERIC-NEXT: [[ADD21:%.*]] = add nsw i32 [[ADD12]], [[CONV20]]
325 ; GENERIC-NEXT: [[TMP16:%.*]] = extractelement <8 x i32> [[TMP6]], i32 3
326 ; GENERIC-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64
327 ; GENERIC-NEXT: [[ARRAYIDX28:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP17]]
328 ; GENERIC-NEXT: [[TMP18:%.*]] = load i16, i16* [[ARRAYIDX28]], align 2
329 ; GENERIC-NEXT: [[CONV29:%.*]] = zext i16 [[TMP18]] to i32
330 ; GENERIC-NEXT: [[ADD30:%.*]] = add nsw i32 [[ADD21]], [[CONV29]]
331 ; GENERIC-NEXT: [[TMP19:%.*]] = extractelement <8 x i32> [[TMP6]], i32 4
332 ; GENERIC-NEXT: [[TMP20:%.*]] = sext i32 [[TMP19]] to i64
333 ; GENERIC-NEXT: [[ARRAYIDX37:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP20]]
334 ; GENERIC-NEXT: [[TMP21:%.*]] = load i16, i16* [[ARRAYIDX37]], align 2
335 ; GENERIC-NEXT: [[CONV38:%.*]] = zext i16 [[TMP21]] to i32
336 ; GENERIC-NEXT: [[ADD39:%.*]] = add nsw i32 [[ADD30]], [[CONV38]]
337 ; GENERIC-NEXT: [[TMP22:%.*]] = extractelement <8 x i32> [[TMP6]], i32 5
338 ; GENERIC-NEXT: [[TMP23:%.*]] = sext i32 [[TMP22]] to i64
339 ; GENERIC-NEXT: [[ARRAYIDX46:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP23]]
340 ; GENERIC-NEXT: [[TMP24:%.*]] = load i16, i16* [[ARRAYIDX46]], align 2
341 ; GENERIC-NEXT: [[CONV47:%.*]] = zext i16 [[TMP24]] to i32
342 ; GENERIC-NEXT: [[ADD48:%.*]] = add nsw i32 [[ADD39]], [[CONV47]]
343 ; GENERIC-NEXT: [[TMP25:%.*]] = extractelement <8 x i32> [[TMP6]], i32 6
344 ; GENERIC-NEXT: [[TMP26:%.*]] = sext i32 [[TMP25]] to i64
345 ; GENERIC-NEXT: [[ARRAYIDX55:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP26]]
346 ; GENERIC-NEXT: [[TMP27:%.*]] = load i16, i16* [[ARRAYIDX55]], align 2
347 ; GENERIC-NEXT: [[CONV56:%.*]] = zext i16 [[TMP27]] to i32
348 ; GENERIC-NEXT: [[ADD57:%.*]] = add nsw i32 [[ADD48]], [[CONV56]]
349 ; GENERIC-NEXT: [[INCDEC_PTR58]] = getelementptr inbounds i16, i16* [[A_ADDR_0101]], i64 8
350 ; GENERIC-NEXT: [[TMP28:%.*]] = extractelement <8 x i32> [[TMP6]], i32 7
351 ; GENERIC-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
352 ; GENERIC-NEXT: [[ARRAYIDX64:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP29]]
353 ; GENERIC-NEXT: [[TMP30:%.*]] = load i16, i16* [[ARRAYIDX64]], align 2
354 ; GENERIC-NEXT: [[CONV65:%.*]] = zext i16 [[TMP30]] to i32
355 ; GENERIC-NEXT: [[ADD66]] = add nsw i32 [[ADD57]], [[CONV65]]
356 ; GENERIC-NEXT: [[INC]] = add nuw nsw i32 [[I_0103]], 1
357 ; GENERIC-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], [[N]]
358 ; GENERIC-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]]
360 ; KRYO-LABEL: @gather_reduce_8x16_i64(
362 ; KRYO-NEXT: [[CMP_99:%.*]] = icmp sgt i32 [[N:%.*]], 0
363 ; KRYO-NEXT: br i1 [[CMP_99]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
364 ; KRYO: for.body.preheader:
365 ; KRYO-NEXT: br label [[FOR_BODY:%.*]]
366 ; KRYO: for.cond.cleanup.loopexit:
367 ; KRYO-NEXT: br label [[FOR_COND_CLEANUP]]
368 ; KRYO: for.cond.cleanup:
369 ; KRYO-NEXT: [[SUM_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[ADD66:%.*]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]
370 ; KRYO-NEXT: ret i32 [[SUM_0_LCSSA]]
372 ; KRYO-NEXT: [[I_0103:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
373 ; KRYO-NEXT: [[SUM_0102:%.*]] = phi i32 [ [[ADD66]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
374 ; KRYO-NEXT: [[A_ADDR_0101:%.*]] = phi i16* [ [[INCDEC_PTR58:%.*]], [[FOR_BODY]] ], [ [[A:%.*]], [[FOR_BODY_PREHEADER]] ]
375 ; KRYO-NEXT: [[TMP0:%.*]] = bitcast i16* [[A_ADDR_0101]] to <8 x i16>*
376 ; KRYO-NEXT: [[TMP1:%.*]] = load <8 x i16>, <8 x i16>* [[TMP0]], align 2
377 ; KRYO-NEXT: [[TMP2:%.*]] = zext <8 x i16> [[TMP1]] to <8 x i32>
378 ; KRYO-NEXT: [[TMP3:%.*]] = bitcast i16* [[B:%.*]] to <8 x i16>*
379 ; KRYO-NEXT: [[TMP4:%.*]] = load <8 x i16>, <8 x i16>* [[TMP3]], align 2
380 ; KRYO-NEXT: [[TMP5:%.*]] = zext <8 x i16> [[TMP4]] to <8 x i32>
381 ; KRYO-NEXT: [[TMP6:%.*]] = sub nsw <8 x i32> [[TMP2]], [[TMP5]]
382 ; KRYO-NEXT: [[TMP7:%.*]] = extractelement <8 x i32> [[TMP6]], i32 0
383 ; KRYO-NEXT: [[TMP8:%.*]] = sext i32 [[TMP7]] to i64
384 ; KRYO-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i16, i16* [[G:%.*]], i64 [[TMP8]]
385 ; KRYO-NEXT: [[TMP9:%.*]] = load i16, i16* [[ARRAYIDX]], align 2
386 ; KRYO-NEXT: [[CONV3:%.*]] = zext i16 [[TMP9]] to i32
387 ; KRYO-NEXT: [[ADD:%.*]] = add nsw i32 [[SUM_0102]], [[CONV3]]
388 ; KRYO-NEXT: [[TMP10:%.*]] = extractelement <8 x i32> [[TMP6]], i32 1
389 ; KRYO-NEXT: [[TMP11:%.*]] = sext i32 [[TMP10]] to i64
390 ; KRYO-NEXT: [[ARRAYIDX10:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP11]]
391 ; KRYO-NEXT: [[TMP12:%.*]] = load i16, i16* [[ARRAYIDX10]], align 2
392 ; KRYO-NEXT: [[CONV11:%.*]] = zext i16 [[TMP12]] to i32
393 ; KRYO-NEXT: [[ADD12:%.*]] = add nsw i32 [[ADD]], [[CONV11]]
394 ; KRYO-NEXT: [[TMP13:%.*]] = extractelement <8 x i32> [[TMP6]], i32 2
395 ; KRYO-NEXT: [[TMP14:%.*]] = sext i32 [[TMP13]] to i64
396 ; KRYO-NEXT: [[ARRAYIDX19:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP14]]
397 ; KRYO-NEXT: [[TMP15:%.*]] = load i16, i16* [[ARRAYIDX19]], align 2
398 ; KRYO-NEXT: [[CONV20:%.*]] = zext i16 [[TMP15]] to i32
399 ; KRYO-NEXT: [[ADD21:%.*]] = add nsw i32 [[ADD12]], [[CONV20]]
400 ; KRYO-NEXT: [[TMP16:%.*]] = extractelement <8 x i32> [[TMP6]], i32 3
401 ; KRYO-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64
402 ; KRYO-NEXT: [[ARRAYIDX28:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP17]]
403 ; KRYO-NEXT: [[TMP18:%.*]] = load i16, i16* [[ARRAYIDX28]], align 2
404 ; KRYO-NEXT: [[CONV29:%.*]] = zext i16 [[TMP18]] to i32
405 ; KRYO-NEXT: [[ADD30:%.*]] = add nsw i32 [[ADD21]], [[CONV29]]
406 ; KRYO-NEXT: [[TMP19:%.*]] = extractelement <8 x i32> [[TMP6]], i32 4
407 ; KRYO-NEXT: [[TMP20:%.*]] = sext i32 [[TMP19]] to i64
408 ; KRYO-NEXT: [[ARRAYIDX37:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP20]]
409 ; KRYO-NEXT: [[TMP21:%.*]] = load i16, i16* [[ARRAYIDX37]], align 2
410 ; KRYO-NEXT: [[CONV38:%.*]] = zext i16 [[TMP21]] to i32
411 ; KRYO-NEXT: [[ADD39:%.*]] = add nsw i32 [[ADD30]], [[CONV38]]
412 ; KRYO-NEXT: [[TMP22:%.*]] = extractelement <8 x i32> [[TMP6]], i32 5
413 ; KRYO-NEXT: [[TMP23:%.*]] = sext i32 [[TMP22]] to i64
414 ; KRYO-NEXT: [[ARRAYIDX46:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP23]]
415 ; KRYO-NEXT: [[TMP24:%.*]] = load i16, i16* [[ARRAYIDX46]], align 2
416 ; KRYO-NEXT: [[CONV47:%.*]] = zext i16 [[TMP24]] to i32
417 ; KRYO-NEXT: [[ADD48:%.*]] = add nsw i32 [[ADD39]], [[CONV47]]
418 ; KRYO-NEXT: [[TMP25:%.*]] = extractelement <8 x i32> [[TMP6]], i32 6
419 ; KRYO-NEXT: [[TMP26:%.*]] = sext i32 [[TMP25]] to i64
420 ; KRYO-NEXT: [[ARRAYIDX55:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP26]]
421 ; KRYO-NEXT: [[TMP27:%.*]] = load i16, i16* [[ARRAYIDX55]], align 2
422 ; KRYO-NEXT: [[CONV56:%.*]] = zext i16 [[TMP27]] to i32
423 ; KRYO-NEXT: [[ADD57:%.*]] = add nsw i32 [[ADD48]], [[CONV56]]
424 ; KRYO-NEXT: [[INCDEC_PTR58]] = getelementptr inbounds i16, i16* [[A_ADDR_0101]], i64 8
425 ; KRYO-NEXT: [[TMP28:%.*]] = extractelement <8 x i32> [[TMP6]], i32 7
426 ; KRYO-NEXT: [[TMP29:%.*]] = sext i32 [[TMP28]] to i64
427 ; KRYO-NEXT: [[ARRAYIDX64:%.*]] = getelementptr inbounds i16, i16* [[G]], i64 [[TMP29]]
428 ; KRYO-NEXT: [[TMP30:%.*]] = load i16, i16* [[ARRAYIDX64]], align 2
429 ; KRYO-NEXT: [[CONV65:%.*]] = zext i16 [[TMP30]] to i32
430 ; KRYO-NEXT: [[ADD66]] = add nsw i32 [[ADD57]], [[CONV65]]
431 ; KRYO-NEXT: [[INC]] = add nuw nsw i32 [[I_0103]], 1
432 ; KRYO-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], [[N]]
433 ; KRYO-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY]]
436 %cmp.99 = icmp sgt i32 %n, 0
437 br i1 %cmp.99, label %for.body.preheader, label %for.cond.cleanup
442 for.cond.cleanup.loopexit:
443 br label %for.cond.cleanup
446 %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add66, %for.cond.cleanup.loopexit ]
450 %i.0103 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
451 %sum.0102 = phi i32 [ %add66, %for.body ], [ 0, %for.body.preheader ]
452 %a.addr.0101 = phi i16* [ %incdec.ptr58, %for.body ], [ %a, %for.body.preheader ]
453 %incdec.ptr = getelementptr inbounds i16, i16* %a.addr.0101, i64 1
454 %0 = load i16, i16* %a.addr.0101, align 2
455 %conv = zext i16 %0 to i64
456 %incdec.ptr1 = getelementptr inbounds i16, i16* %b, i64 1
457 %1 = load i16, i16* %b, align 2
458 %conv2 = zext i16 %1 to i64
459 %sub = sub nsw i64 %conv, %conv2
460 %arrayidx = getelementptr inbounds i16, i16* %g, i64 %sub
461 %2 = load i16, i16* %arrayidx, align 2
462 %conv3 = zext i16 %2 to i32
463 %add = add nsw i32 %conv3, %sum.0102
464 %incdec.ptr4 = getelementptr inbounds i16, i16* %a.addr.0101, i64 2
465 %3 = load i16, i16* %incdec.ptr, align 2
466 %conv5 = zext i16 %3 to i64
467 %incdec.ptr6 = getelementptr inbounds i16, i16* %b, i64 2
468 %4 = load i16, i16* %incdec.ptr1, align 2
469 %conv7 = zext i16 %4 to i64
470 %sub8 = sub nsw i64 %conv5, %conv7
471 %arrayidx10 = getelementptr inbounds i16, i16* %g, i64 %sub8
472 %5 = load i16, i16* %arrayidx10, align 2
473 %conv11 = zext i16 %5 to i32
474 %add12 = add nsw i32 %add, %conv11
475 %incdec.ptr13 = getelementptr inbounds i16, i16* %a.addr.0101, i64 3
476 %6 = load i16, i16* %incdec.ptr4, align 2
477 %conv14 = zext i16 %6 to i64
478 %incdec.ptr15 = getelementptr inbounds i16, i16* %b, i64 3
479 %7 = load i16, i16* %incdec.ptr6, align 2
480 %conv16 = zext i16 %7 to i64
481 %sub17 = sub nsw i64 %conv14, %conv16
482 %arrayidx19 = getelementptr inbounds i16, i16* %g, i64 %sub17
483 %8 = load i16, i16* %arrayidx19, align 2
484 %conv20 = zext i16 %8 to i32
485 %add21 = add nsw i32 %add12, %conv20
486 %incdec.ptr22 = getelementptr inbounds i16, i16* %a.addr.0101, i64 4
487 %9 = load i16, i16* %incdec.ptr13, align 2
488 %conv23 = zext i16 %9 to i64
489 %incdec.ptr24 = getelementptr inbounds i16, i16* %b, i64 4
490 %10 = load i16, i16* %incdec.ptr15, align 2
491 %conv25 = zext i16 %10 to i64
492 %sub26 = sub nsw i64 %conv23, %conv25
493 %arrayidx28 = getelementptr inbounds i16, i16* %g, i64 %sub26
494 %11 = load i16, i16* %arrayidx28, align 2
495 %conv29 = zext i16 %11 to i32
496 %add30 = add nsw i32 %add21, %conv29
497 %incdec.ptr31 = getelementptr inbounds i16, i16* %a.addr.0101, i64 5
498 %12 = load i16, i16* %incdec.ptr22, align 2
499 %conv32 = zext i16 %12 to i64
500 %incdec.ptr33 = getelementptr inbounds i16, i16* %b, i64 5
501 %13 = load i16, i16* %incdec.ptr24, align 2
502 %conv34 = zext i16 %13 to i64
503 %sub35 = sub nsw i64 %conv32, %conv34
504 %arrayidx37 = getelementptr inbounds i16, i16* %g, i64 %sub35
505 %14 = load i16, i16* %arrayidx37, align 2
506 %conv38 = zext i16 %14 to i32
507 %add39 = add nsw i32 %add30, %conv38
508 %incdec.ptr40 = getelementptr inbounds i16, i16* %a.addr.0101, i64 6
509 %15 = load i16, i16* %incdec.ptr31, align 2
510 %conv41 = zext i16 %15 to i64
511 %incdec.ptr42 = getelementptr inbounds i16, i16* %b, i64 6
512 %16 = load i16, i16* %incdec.ptr33, align 2
513 %conv43 = zext i16 %16 to i64
514 %sub44 = sub nsw i64 %conv41, %conv43
515 %arrayidx46 = getelementptr inbounds i16, i16* %g, i64 %sub44
516 %17 = load i16, i16* %arrayidx46, align 2
517 %conv47 = zext i16 %17 to i32
518 %add48 = add nsw i32 %add39, %conv47
519 %incdec.ptr49 = getelementptr inbounds i16, i16* %a.addr.0101, i64 7
520 %18 = load i16, i16* %incdec.ptr40, align 2
521 %conv50 = zext i16 %18 to i64
522 %incdec.ptr51 = getelementptr inbounds i16, i16* %b, i64 7
523 %19 = load i16, i16* %incdec.ptr42, align 2
524 %conv52 = zext i16 %19 to i64
525 %sub53 = sub nsw i64 %conv50, %conv52
526 %arrayidx55 = getelementptr inbounds i16, i16* %g, i64 %sub53
527 %20 = load i16, i16* %arrayidx55, align 2
528 %conv56 = zext i16 %20 to i32
529 %add57 = add nsw i32 %add48, %conv56
530 %incdec.ptr58 = getelementptr inbounds i16, i16* %a.addr.0101, i64 8
531 %21 = load i16, i16* %incdec.ptr49, align 2
532 %conv59 = zext i16 %21 to i64
533 %22 = load i16, i16* %incdec.ptr51, align 2
534 %conv61 = zext i16 %22 to i64
535 %sub62 = sub nsw i64 %conv59, %conv61
536 %arrayidx64 = getelementptr inbounds i16, i16* %g, i64 %sub62
537 %23 = load i16, i16* %arrayidx64, align 2
538 %conv65 = zext i16 %23 to i32
539 %add66 = add nsw i32 %add57, %conv65
540 %inc = add nuw nsw i32 %i.0103, 1
541 %exitcond = icmp eq i32 %inc, %n
542 br i1 %exitcond, label %for.cond.cleanup.loopexit, label %for.body