1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=indvars -mtriple=thumbv8m.base -S %s -o - | FileCheck %s --check-prefix=CHECK-T1
3 ; RUN: opt -passes=indvars -mtriple=thumbv8m.main -S %s -o - | FileCheck %s --check-prefix=CHECK-T2
5 define dso_local arm_aapcscc void @arm_conv_fast_q15(ptr %pSrcA, i32 %srcALen, ptr %pSrcB, i32 %srcBLen, ptr %pDst, ptr %store.px, ptr %store.py, ptr %store.res) local_unnamed_addr {
6 ; CHECK-T1-LABEL: @arm_conv_fast_q15(
7 ; CHECK-T1-NEXT: entry:
8 ; CHECK-T1-NEXT: [[CMP:%.*]] = icmp ult i32 [[SRCALEN:%.*]], [[SRCBLEN:%.*]]
9 ; CHECK-T1-NEXT: [[SRCALEN_SRCBLEN:%.*]] = select i1 [[CMP]], i32 [[SRCALEN]], i32 [[SRCBLEN]]
10 ; CHECK-T1-NEXT: [[PSRCB_PSRCA:%.*]] = select i1 [[CMP]], ptr [[PSRCB:%.*]], ptr [[PSRCA:%.*]]
11 ; CHECK-T1-NEXT: [[PSRCA_PSRCB:%.*]] = select i1 [[CMP]], ptr [[PSRCA]], ptr [[PSRCB]]
12 ; CHECK-T1-NEXT: [[SUB:%.*]] = add i32 [[SRCALEN_SRCBLEN]], -1
13 ; CHECK-T1-NEXT: [[CMP41080:%.*]] = icmp eq i32 [[SUB]], 0
14 ; CHECK-T1-NEXT: br i1 [[CMP41080]], label [[WHILE_END13:%.*]], label [[WHILE_COND5_PREHEADER_PREHEADER:%.*]]
15 ; CHECK-T1: while.cond5.preheader.preheader:
16 ; CHECK-T1-NEXT: [[TMP0:%.*]] = add i32 [[SRCALEN_SRCBLEN]], -2
17 ; CHECK-T1-NEXT: [[UMIN:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 2)
18 ; CHECK-T1-NEXT: [[TMP1:%.*]] = add nuw nsw i32 [[UMIN]], 2
19 ; CHECK-T1-NEXT: br label [[WHILE_COND5_PREHEADER:%.*]]
20 ; CHECK-T1: while.cond5.preheader:
21 ; CHECK-T1-NEXT: [[COUNT_01084:%.*]] = phi i32 [ [[INC:%.*]], [[WHILE_END:%.*]] ], [ 1, [[WHILE_COND5_PREHEADER_PREHEADER]] ]
22 ; CHECK-T1-NEXT: [[BLOCKSIZE1_01083:%.*]] = phi i32 [ [[DEC12:%.*]], [[WHILE_END]] ], [ [[SUB]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
23 ; CHECK-T1-NEXT: [[PY_01082:%.*]] = phi ptr [ [[ADD_PTR:%.*]], [[WHILE_END]] ], [ [[PSRCA_PSRCB]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
24 ; CHECK-T1-NEXT: [[POUT_01081:%.*]] = phi ptr [ [[INCDEC_PTR11:%.*]], [[WHILE_END]] ], [ [[PDST:%.*]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
25 ; CHECK-T1-NEXT: br label [[WHILE_BODY7:%.*]]
26 ; CHECK-T1: while.body7:
27 ; CHECK-T1-NEXT: [[K_01078:%.*]] = phi i32 [ [[DEC:%.*]], [[WHILE_BODY7]] ], [ [[COUNT_01084]], [[WHILE_COND5_PREHEADER]] ]
28 ; CHECK-T1-NEXT: [[SUM_01077:%.*]] = phi i32 [ [[ADD6_I:%.*]], [[WHILE_BODY7]] ], [ 0, [[WHILE_COND5_PREHEADER]] ]
29 ; CHECK-T1-NEXT: [[PY_11076:%.*]] = phi ptr [ [[INCDEC_PTR8:%.*]], [[WHILE_BODY7]] ], [ [[PY_01082]], [[WHILE_COND5_PREHEADER]] ]
30 ; CHECK-T1-NEXT: [[PX_11075:%.*]] = phi ptr [ [[INCDEC_PTR:%.*]], [[WHILE_BODY7]] ], [ [[PSRCB_PSRCA]], [[WHILE_COND5_PREHEADER]] ]
31 ; CHECK-T1-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i16, ptr [[PX_11075]], i32 1
32 ; CHECK-T1-NEXT: [[TMP2:%.*]] = load i16, ptr [[PX_11075]], align 2
33 ; CHECK-T1-NEXT: [[CONV:%.*]] = sext i16 [[TMP2]] to i32
34 ; CHECK-T1-NEXT: [[INCDEC_PTR8]] = getelementptr inbounds i16, ptr [[PY_11076]], i32 -1
35 ; CHECK-T1-NEXT: [[TMP3:%.*]] = load i16, ptr [[PY_11076]], align 2
36 ; CHECK-T1-NEXT: [[CONV9:%.*]] = sext i16 [[TMP3]] to i32
37 ; CHECK-T1-NEXT: [[MUL_I:%.*]] = mul nsw i32 [[CONV9]], [[CONV]]
38 ; CHECK-T1-NEXT: [[SHR3_I:%.*]] = ashr i32 [[CONV]], 16
39 ; CHECK-T1-NEXT: [[SHR4_I:%.*]] = ashr i32 [[CONV9]], 16
40 ; CHECK-T1-NEXT: [[MUL5_I:%.*]] = mul nsw i32 [[SHR4_I]], [[SHR3_I]]
41 ; CHECK-T1-NEXT: [[ADD_I:%.*]] = add i32 [[MUL_I]], [[SUM_01077]]
42 ; CHECK-T1-NEXT: [[ADD6_I]] = add i32 [[ADD_I]], [[MUL5_I]]
43 ; CHECK-T1-NEXT: [[DEC]] = add nsw i32 [[K_01078]], -1
44 ; CHECK-T1-NEXT: [[CMP6:%.*]] = icmp eq i32 [[DEC]], 0
45 ; CHECK-T1-NEXT: br i1 [[CMP6]], label [[WHILE_END]], label [[WHILE_BODY7]]
46 ; CHECK-T1: while.end:
47 ; CHECK-T1-NEXT: [[ADD6_I_LCSSA:%.*]] = phi i32 [ [[ADD6_I]], [[WHILE_BODY7]] ]
48 ; CHECK-T1-NEXT: [[TMP4:%.*]] = lshr i32 [[ADD6_I_LCSSA]], 15
49 ; CHECK-T1-NEXT: [[CONV10:%.*]] = trunc i32 [[TMP4]] to i16
50 ; CHECK-T1-NEXT: [[INCDEC_PTR11]] = getelementptr inbounds i16, ptr [[POUT_01081]], i32 1
51 ; CHECK-T1-NEXT: store i16 [[CONV10]], ptr [[POUT_01081]], align 2
52 ; CHECK-T1-NEXT: [[ADD_PTR]] = getelementptr inbounds i16, ptr [[PSRCA_PSRCB]], i32 [[COUNT_01084]]
53 ; CHECK-T1-NEXT: [[INC]] = add nuw nsw i32 [[COUNT_01084]], 1
54 ; CHECK-T1-NEXT: [[DEC12]] = add i32 [[BLOCKSIZE1_01083]], -1
55 ; CHECK-T1-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[INC]], [[TMP1]]
56 ; CHECK-T1-NEXT: br i1 [[EXITCOND]], label [[WHILE_COND5_PREHEADER]], label [[WHILE_END13_LOOPEXIT:%.*]]
57 ; CHECK-T1: while.end13.loopexit:
58 ; CHECK-T1-NEXT: [[INCDEC_PTR11_LCSSA:%.*]] = phi ptr [ [[INCDEC_PTR11]], [[WHILE_END]] ]
59 ; CHECK-T1-NEXT: [[ADD_PTR_LCSSA:%.*]] = phi ptr [ [[ADD_PTR]], [[WHILE_END]] ]
60 ; CHECK-T1-NEXT: [[INC_LCSSA:%.*]] = phi i32 [ [[INC]], [[WHILE_END]] ]
61 ; CHECK-T1-NEXT: [[DEC12_LCSSA:%.*]] = phi i32 [ [[DEC12]], [[WHILE_END]] ]
62 ; CHECK-T1-NEXT: br label [[WHILE_END13]]
63 ; CHECK-T1: while.end13:
64 ; CHECK-T1-NEXT: [[POUT_0_LCSSA:%.*]] = phi ptr [ [[PDST]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR11_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
65 ; CHECK-T1-NEXT: [[PY_0_LCSSA:%.*]] = phi ptr [ [[PSRCA_PSRCB]], [[ENTRY]] ], [ [[ADD_PTR_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
66 ; CHECK-T1-NEXT: [[BLOCKSIZE1_0_LCSSA:%.*]] = phi i32 [ [[SUB]], [[ENTRY]] ], [ [[DEC12_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
67 ; CHECK-T1-NEXT: [[COUNT_0_LCSSA:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[INC_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
68 ; CHECK-T1-NEXT: [[CMP161068:%.*]] = icmp eq i32 [[BLOCKSIZE1_0_LCSSA]], 0
69 ; CHECK-T1-NEXT: br i1 [[CMP161068]], label [[EXIT:%.*]], label [[WHILE_BODY18_PREHEADER:%.*]]
70 ; CHECK-T1: while.body18.preheader:
71 ; CHECK-T1-NEXT: [[ADD_PTR14:%.*]] = getelementptr inbounds i16, ptr [[PY_0_LCSSA]], i32 -1
72 ; CHECK-T1-NEXT: br label [[WHILE_BODY18:%.*]]
73 ; CHECK-T1: while.body18:
74 ; CHECK-T1-NEXT: [[COUNT_11072:%.*]] = phi i32 [ [[INC49:%.*]], [[WHILE_END43:%.*]] ], [ [[COUNT_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
75 ; CHECK-T1-NEXT: [[BLOCKSIZE1_11071:%.*]] = phi i32 [ [[DEC50:%.*]], [[WHILE_END43]] ], [ [[BLOCKSIZE1_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
76 ; CHECK-T1-NEXT: [[PY_21070:%.*]] = phi ptr [ [[ADD_PTR48:%.*]], [[WHILE_END43]] ], [ [[ADD_PTR14]], [[WHILE_BODY18_PREHEADER]] ]
77 ; CHECK-T1-NEXT: [[POUT_11069:%.*]] = phi ptr [ [[INCDEC_PTR46:%.*]], [[WHILE_END43]] ], [ [[POUT_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
78 ; CHECK-T1-NEXT: [[SHR19:%.*]] = lshr i32 [[COUNT_11072]], 2
79 ; CHECK-T1-NEXT: [[CMP211054:%.*]] = icmp eq i32 [[SHR19]], 0
80 ; CHECK-T1-NEXT: br i1 [[CMP211054]], label [[WHILE_END31:%.*]], label [[WHILE_BODY23_PREHEADER:%.*]]
81 ; CHECK-T1: while.body23.preheader:
82 ; CHECK-T1-NEXT: br label [[WHILE_BODY23:%.*]]
83 ; CHECK-T1: while.body23:
84 ; CHECK-T1-NEXT: [[K_11058:%.*]] = phi i32 [ [[DEC30:%.*]], [[WHILE_BODY23]] ], [ [[SHR19]], [[WHILE_BODY23_PREHEADER]] ]
85 ; CHECK-T1-NEXT: [[SUM_11057:%.*]] = phi i32 [ [[ADD6_I878:%.*]], [[WHILE_BODY23]] ], [ 0, [[WHILE_BODY23_PREHEADER]] ]
86 ; CHECK-T1-NEXT: [[PY_31056:%.*]] = phi ptr [ [[ADD_PTR_I884:%.*]], [[WHILE_BODY23]] ], [ [[PY_21070]], [[WHILE_BODY23_PREHEADER]] ]
87 ; CHECK-T1-NEXT: [[PX_31055:%.*]] = phi ptr [ [[ADD_PTR_I890:%.*]], [[WHILE_BODY23]] ], [ [[PSRCB_PSRCA]], [[WHILE_BODY23_PREHEADER]] ]
88 ; CHECK-T1-NEXT: [[ARRAYIDX_I907:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 1
89 ; CHECK-T1-NEXT: [[TMP5:%.*]] = load i16, ptr [[ARRAYIDX_I907]], align 2
90 ; CHECK-T1-NEXT: [[TMP6:%.*]] = load i16, ptr [[PX_31055]], align 2
91 ; CHECK-T1-NEXT: [[ADD_PTR_I912:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 2
92 ; CHECK-T1-NEXT: [[ARRAYIDX_I901:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 1
93 ; CHECK-T1-NEXT: [[TMP7:%.*]] = load i16, ptr [[ARRAYIDX_I901]], align 2
94 ; CHECK-T1-NEXT: [[TMP8:%.*]] = load i16, ptr [[PY_31056]], align 2
95 ; CHECK-T1-NEXT: [[ADD_PTR_I906:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -2
96 ; CHECK-T1-NEXT: [[SHR_I892:%.*]] = sext i16 [[TMP6]] to i32
97 ; CHECK-T1-NEXT: [[SHR1_I893:%.*]] = sext i16 [[TMP7]] to i32
98 ; CHECK-T1-NEXT: [[MUL_I894:%.*]] = mul nsw i32 [[SHR1_I893]], [[SHR_I892]]
99 ; CHECK-T1-NEXT: [[SHR2_I895:%.*]] = sext i16 [[TMP5]] to i32
100 ; CHECK-T1-NEXT: [[SHR4_I897:%.*]] = sext i16 [[TMP8]] to i32
101 ; CHECK-T1-NEXT: [[MUL5_I898:%.*]] = mul nsw i32 [[SHR4_I897]], [[SHR2_I895]]
102 ; CHECK-T1-NEXT: [[ADD_I899:%.*]] = add i32 [[MUL_I894]], [[SUM_11057]]
103 ; CHECK-T1-NEXT: [[ADD6_I900:%.*]] = add i32 [[ADD_I899]], [[MUL5_I898]]
104 ; CHECK-T1-NEXT: [[ARRAYIDX_I885:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 3
105 ; CHECK-T1-NEXT: [[TMP9:%.*]] = load i16, ptr [[ARRAYIDX_I885]], align 2
106 ; CHECK-T1-NEXT: [[TMP10:%.*]] = load i16, ptr [[ADD_PTR_I912]], align 2
107 ; CHECK-T1-NEXT: [[ADD_PTR_I890]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 4
108 ; CHECK-T1-NEXT: [[ARRAYIDX_I879:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -1
109 ; CHECK-T1-NEXT: [[TMP11:%.*]] = load i16, ptr [[ARRAYIDX_I879]], align 2
110 ; CHECK-T1-NEXT: [[TMP12:%.*]] = load i16, ptr [[ADD_PTR_I906]], align 2
111 ; CHECK-T1-NEXT: [[ADD_PTR_I884]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -4
112 ; CHECK-T1-NEXT: [[SHR_I870:%.*]] = sext i16 [[TMP10]] to i32
113 ; CHECK-T1-NEXT: [[SHR1_I871:%.*]] = sext i16 [[TMP11]] to i32
114 ; CHECK-T1-NEXT: [[MUL_I872:%.*]] = mul nsw i32 [[SHR1_I871]], [[SHR_I870]]
115 ; CHECK-T1-NEXT: [[SHR2_I873:%.*]] = sext i16 [[TMP9]] to i32
116 ; CHECK-T1-NEXT: [[SHR4_I875:%.*]] = sext i16 [[TMP12]] to i32
117 ; CHECK-T1-NEXT: [[MUL5_I876:%.*]] = mul nsw i32 [[SHR4_I875]], [[SHR2_I873]]
118 ; CHECK-T1-NEXT: [[ADD_I877:%.*]] = add i32 [[ADD6_I900]], [[MUL_I872]]
119 ; CHECK-T1-NEXT: [[ADD6_I878]] = add i32 [[ADD_I877]], [[MUL5_I876]]
120 ; CHECK-T1-NEXT: [[DEC30]] = add nsw i32 [[K_11058]], -1
121 ; CHECK-T1-NEXT: [[CMP21:%.*]] = icmp eq i32 [[DEC30]], 0
122 ; CHECK-T1-NEXT: br i1 [[CMP21]], label [[WHILE_END31_LOOPEXIT:%.*]], label [[WHILE_BODY23]]
123 ; CHECK-T1: while.end31.loopexit:
124 ; CHECK-T1-NEXT: [[ADD_PTR_I890_LCSSA:%.*]] = phi ptr [ [[ADD_PTR_I890]], [[WHILE_BODY23]] ]
125 ; CHECK-T1-NEXT: [[ADD_PTR_I884_LCSSA:%.*]] = phi ptr [ [[ADD_PTR_I884]], [[WHILE_BODY23]] ]
126 ; CHECK-T1-NEXT: [[ADD6_I878_LCSSA:%.*]] = phi i32 [ [[ADD6_I878]], [[WHILE_BODY23]] ]
127 ; CHECK-T1-NEXT: br label [[WHILE_END31]]
128 ; CHECK-T1: while.end31:
129 ; CHECK-T1-NEXT: [[PX_3_LCSSA:%.*]] = phi ptr [ [[PSRCB_PSRCA]], [[WHILE_BODY18]] ], [ [[ADD_PTR_I890_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
130 ; CHECK-T1-NEXT: [[PY_3_LCSSA:%.*]] = phi ptr [ [[PY_21070]], [[WHILE_BODY18]] ], [ [[ADD_PTR_I884_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
131 ; CHECK-T1-NEXT: [[SUM_1_LCSSA:%.*]] = phi i32 [ 0, [[WHILE_BODY18]] ], [ [[ADD6_I878_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
132 ; CHECK-T1-NEXT: [[REM:%.*]] = and i32 [[COUNT_11072]], 3
133 ; CHECK-T1-NEXT: [[CMP341062:%.*]] = icmp eq i32 [[REM]], 0
134 ; CHECK-T1-NEXT: br i1 [[CMP341062]], label [[WHILE_END43]], label [[WHILE_BODY36_PREHEADER:%.*]]
135 ; CHECK-T1: while.body36.preheader:
136 ; CHECK-T1-NEXT: [[ADD_PTR32:%.*]] = getelementptr inbounds i16, ptr [[PY_3_LCSSA]], i32 1
137 ; CHECK-T1-NEXT: br label [[WHILE_BODY36:%.*]]
138 ; CHECK-T1: while.body36:
139 ; CHECK-T1-NEXT: [[K_21066:%.*]] = phi i32 [ [[DEC42:%.*]], [[WHILE_BODY36]] ], [ [[REM]], [[WHILE_BODY36_PREHEADER]] ]
140 ; CHECK-T1-NEXT: [[SUM_21065:%.*]] = phi i32 [ [[ADD6_I868:%.*]], [[WHILE_BODY36]] ], [ [[SUM_1_LCSSA]], [[WHILE_BODY36_PREHEADER]] ]
141 ; CHECK-T1-NEXT: [[PY_41064:%.*]] = phi ptr [ [[INCDEC_PTR39:%.*]], [[WHILE_BODY36]] ], [ [[ADD_PTR32]], [[WHILE_BODY36_PREHEADER]] ]
142 ; CHECK-T1-NEXT: [[PX_41063:%.*]] = phi ptr [ [[INCDEC_PTR37:%.*]], [[WHILE_BODY36]] ], [ [[PX_3_LCSSA]], [[WHILE_BODY36_PREHEADER]] ]
143 ; CHECK-T1-NEXT: [[INCDEC_PTR37]] = getelementptr inbounds i16, ptr [[PX_41063]], i32 1
144 ; CHECK-T1-NEXT: [[TMP13:%.*]] = load i16, ptr [[PX_41063]], align 2
145 ; CHECK-T1-NEXT: [[CONV38:%.*]] = sext i16 [[TMP13]] to i32
146 ; CHECK-T1-NEXT: [[INCDEC_PTR39]] = getelementptr inbounds i16, ptr [[PY_41064]], i32 -1
147 ; CHECK-T1-NEXT: [[TMP14:%.*]] = load i16, ptr [[PY_41064]], align 2
148 ; CHECK-T1-NEXT: [[CONV40:%.*]] = sext i16 [[TMP14]] to i32
149 ; CHECK-T1-NEXT: [[MUL_I863:%.*]] = mul nsw i32 [[CONV40]], [[CONV38]]
150 ; CHECK-T1-NEXT: [[SHR3_I864:%.*]] = ashr i32 [[CONV38]], 16
151 ; CHECK-T1-NEXT: [[SHR4_I865:%.*]] = ashr i32 [[CONV40]], 16
152 ; CHECK-T1-NEXT: [[MUL5_I866:%.*]] = mul nsw i32 [[SHR4_I865]], [[SHR3_I864]]
153 ; CHECK-T1-NEXT: [[ADD_I867:%.*]] = add i32 [[MUL_I863]], [[SUM_21065]]
154 ; CHECK-T1-NEXT: [[ADD6_I868]] = add i32 [[ADD_I867]], [[MUL5_I866]]
155 ; CHECK-T1-NEXT: [[DEC42]] = add nsw i32 [[K_21066]], -1
156 ; CHECK-T1-NEXT: [[CMP34:%.*]] = icmp eq i32 [[DEC42]], 0
157 ; CHECK-T1-NEXT: br i1 [[CMP34]], label [[WHILE_END43_LOOPEXIT:%.*]], label [[WHILE_BODY36]]
158 ; CHECK-T1: while.end43.loopexit:
159 ; CHECK-T1-NEXT: [[ADD6_I868_LCSSA:%.*]] = phi i32 [ [[ADD6_I868]], [[WHILE_BODY36]] ]
160 ; CHECK-T1-NEXT: br label [[WHILE_END43]]
161 ; CHECK-T1: while.end43:
162 ; CHECK-T1-NEXT: [[SUM_2_LCSSA:%.*]] = phi i32 [ [[SUM_1_LCSSA]], [[WHILE_END31]] ], [ [[ADD6_I868_LCSSA]], [[WHILE_END43_LOOPEXIT]] ]
163 ; CHECK-T1-NEXT: [[TMP15:%.*]] = lshr i32 [[SUM_2_LCSSA]], 15
164 ; CHECK-T1-NEXT: [[CONV45:%.*]] = trunc i32 [[TMP15]] to i16
165 ; CHECK-T1-NEXT: [[INCDEC_PTR46]] = getelementptr inbounds i16, ptr [[POUT_11069]], i32 1
166 ; CHECK-T1-NEXT: store i16 [[CONV45]], ptr [[POUT_11069]], align 2
167 ; CHECK-T1-NEXT: [[SUB47:%.*]] = add i32 [[COUNT_11072]], -1
168 ; CHECK-T1-NEXT: [[ADD_PTR48]] = getelementptr inbounds i16, ptr [[PSRCA_PSRCB]], i32 [[SUB47]]
169 ; CHECK-T1-NEXT: [[INC49]] = add i32 [[COUNT_11072]], 1
170 ; CHECK-T1-NEXT: [[DEC50]] = add i32 [[BLOCKSIZE1_11071]], -1
171 ; CHECK-T1-NEXT: [[CMP16:%.*]] = icmp eq i32 [[DEC50]], 0
172 ; CHECK-T1-NEXT: br i1 [[CMP16]], label [[EXIT_LOOPEXIT:%.*]], label [[WHILE_BODY18]]
173 ; CHECK-T1: exit.loopexit:
174 ; CHECK-T1-NEXT: br label [[EXIT]]
176 ; CHECK-T1-NEXT: ret void
178 ; CHECK-T2-LABEL: @arm_conv_fast_q15(
179 ; CHECK-T2-NEXT: entry:
180 ; CHECK-T2-NEXT: [[CMP:%.*]] = icmp ult i32 [[SRCALEN:%.*]], [[SRCBLEN:%.*]]
181 ; CHECK-T2-NEXT: [[SRCALEN_SRCBLEN:%.*]] = select i1 [[CMP]], i32 [[SRCALEN]], i32 [[SRCBLEN]]
182 ; CHECK-T2-NEXT: [[PSRCB_PSRCA:%.*]] = select i1 [[CMP]], ptr [[PSRCB:%.*]], ptr [[PSRCA:%.*]]
183 ; CHECK-T2-NEXT: [[PSRCA_PSRCB:%.*]] = select i1 [[CMP]], ptr [[PSRCA]], ptr [[PSRCB]]
184 ; CHECK-T2-NEXT: [[SUB:%.*]] = add i32 [[SRCALEN_SRCBLEN]], -1
185 ; CHECK-T2-NEXT: [[CMP41080:%.*]] = icmp eq i32 [[SUB]], 0
186 ; CHECK-T2-NEXT: br i1 [[CMP41080]], label [[WHILE_END13:%.*]], label [[WHILE_COND5_PREHEADER_PREHEADER:%.*]]
187 ; CHECK-T2: while.cond5.preheader.preheader:
188 ; CHECK-T2-NEXT: [[TMP0:%.*]] = add i32 [[SRCALEN_SRCBLEN]], -2
189 ; CHECK-T2-NEXT: [[UMIN:%.*]] = call i32 @llvm.umin.i32(i32 [[TMP0]], i32 2)
190 ; CHECK-T2-NEXT: [[TMP1:%.*]] = add nuw nsw i32 [[UMIN]], 2
191 ; CHECK-T2-NEXT: br label [[WHILE_COND5_PREHEADER:%.*]]
192 ; CHECK-T2: while.cond5.preheader:
193 ; CHECK-T2-NEXT: [[COUNT_01084:%.*]] = phi i32 [ [[INC:%.*]], [[WHILE_END:%.*]] ], [ 1, [[WHILE_COND5_PREHEADER_PREHEADER]] ]
194 ; CHECK-T2-NEXT: [[BLOCKSIZE1_01083:%.*]] = phi i32 [ [[DEC12:%.*]], [[WHILE_END]] ], [ [[SUB]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
195 ; CHECK-T2-NEXT: [[PY_01082:%.*]] = phi ptr [ [[ADD_PTR:%.*]], [[WHILE_END]] ], [ [[PSRCA_PSRCB]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
196 ; CHECK-T2-NEXT: [[POUT_01081:%.*]] = phi ptr [ [[INCDEC_PTR11:%.*]], [[WHILE_END]] ], [ [[PDST:%.*]], [[WHILE_COND5_PREHEADER_PREHEADER]] ]
197 ; CHECK-T2-NEXT: br label [[WHILE_BODY7:%.*]]
198 ; CHECK-T2: while.body7:
199 ; CHECK-T2-NEXT: [[K_01078:%.*]] = phi i32 [ [[DEC:%.*]], [[WHILE_BODY7]] ], [ [[COUNT_01084]], [[WHILE_COND5_PREHEADER]] ]
200 ; CHECK-T2-NEXT: [[SUM_01077:%.*]] = phi i32 [ [[ADD6_I:%.*]], [[WHILE_BODY7]] ], [ 0, [[WHILE_COND5_PREHEADER]] ]
201 ; CHECK-T2-NEXT: [[PY_11076:%.*]] = phi ptr [ [[INCDEC_PTR8:%.*]], [[WHILE_BODY7]] ], [ [[PY_01082]], [[WHILE_COND5_PREHEADER]] ]
202 ; CHECK-T2-NEXT: [[PX_11075:%.*]] = phi ptr [ [[INCDEC_PTR:%.*]], [[WHILE_BODY7]] ], [ [[PSRCB_PSRCA]], [[WHILE_COND5_PREHEADER]] ]
203 ; CHECK-T2-NEXT: [[INCDEC_PTR]] = getelementptr inbounds i16, ptr [[PX_11075]], i32 1
204 ; CHECK-T2-NEXT: [[TMP2:%.*]] = load i16, ptr [[PX_11075]], align 2
205 ; CHECK-T2-NEXT: [[CONV:%.*]] = sext i16 [[TMP2]] to i32
206 ; CHECK-T2-NEXT: [[INCDEC_PTR8]] = getelementptr inbounds i16, ptr [[PY_11076]], i32 -1
207 ; CHECK-T2-NEXT: [[TMP3:%.*]] = load i16, ptr [[PY_11076]], align 2
208 ; CHECK-T2-NEXT: [[CONV9:%.*]] = sext i16 [[TMP3]] to i32
209 ; CHECK-T2-NEXT: [[MUL_I:%.*]] = mul nsw i32 [[CONV9]], [[CONV]]
210 ; CHECK-T2-NEXT: [[SHR3_I:%.*]] = ashr i32 [[CONV]], 16
211 ; CHECK-T2-NEXT: [[SHR4_I:%.*]] = ashr i32 [[CONV9]], 16
212 ; CHECK-T2-NEXT: [[MUL5_I:%.*]] = mul nsw i32 [[SHR4_I]], [[SHR3_I]]
213 ; CHECK-T2-NEXT: [[ADD_I:%.*]] = add i32 [[MUL_I]], [[SUM_01077]]
214 ; CHECK-T2-NEXT: [[ADD6_I]] = add i32 [[ADD_I]], [[MUL5_I]]
215 ; CHECK-T2-NEXT: [[DEC]] = add nsw i32 [[K_01078]], -1
216 ; CHECK-T2-NEXT: [[CMP6:%.*]] = icmp eq i32 [[DEC]], 0
217 ; CHECK-T2-NEXT: br i1 [[CMP6]], label [[WHILE_END]], label [[WHILE_BODY7]]
218 ; CHECK-T2: while.end:
219 ; CHECK-T2-NEXT: [[ADD6_I_LCSSA:%.*]] = phi i32 [ [[ADD6_I]], [[WHILE_BODY7]] ]
220 ; CHECK-T2-NEXT: [[TMP4:%.*]] = lshr i32 [[ADD6_I_LCSSA]], 15
221 ; CHECK-T2-NEXT: [[CONV10:%.*]] = trunc i32 [[TMP4]] to i16
222 ; CHECK-T2-NEXT: [[INCDEC_PTR11]] = getelementptr inbounds i16, ptr [[POUT_01081]], i32 1
223 ; CHECK-T2-NEXT: store i16 [[CONV10]], ptr [[POUT_01081]], align 2
224 ; CHECK-T2-NEXT: [[ADD_PTR]] = getelementptr inbounds i16, ptr [[PSRCA_PSRCB]], i32 [[COUNT_01084]]
225 ; CHECK-T2-NEXT: [[INC]] = add nuw nsw i32 [[COUNT_01084]], 1
226 ; CHECK-T2-NEXT: [[DEC12]] = add i32 [[BLOCKSIZE1_01083]], -1
227 ; CHECK-T2-NEXT: [[EXITCOND:%.*]] = icmp ne i32 [[INC]], [[TMP1]]
228 ; CHECK-T2-NEXT: br i1 [[EXITCOND]], label [[WHILE_COND5_PREHEADER]], label [[WHILE_END13_LOOPEXIT:%.*]]
229 ; CHECK-T2: while.end13.loopexit:
230 ; CHECK-T2-NEXT: [[INCDEC_PTR11_LCSSA:%.*]] = phi ptr [ [[INCDEC_PTR11]], [[WHILE_END]] ]
231 ; CHECK-T2-NEXT: [[ADD_PTR_LCSSA:%.*]] = phi ptr [ [[ADD_PTR]], [[WHILE_END]] ]
232 ; CHECK-T2-NEXT: [[INC_LCSSA:%.*]] = phi i32 [ [[INC]], [[WHILE_END]] ]
233 ; CHECK-T2-NEXT: [[DEC12_LCSSA:%.*]] = phi i32 [ [[DEC12]], [[WHILE_END]] ]
234 ; CHECK-T2-NEXT: br label [[WHILE_END13]]
235 ; CHECK-T2: while.end13:
236 ; CHECK-T2-NEXT: [[POUT_0_LCSSA:%.*]] = phi ptr [ [[PDST]], [[ENTRY:%.*]] ], [ [[INCDEC_PTR11_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
237 ; CHECK-T2-NEXT: [[PY_0_LCSSA:%.*]] = phi ptr [ [[PSRCA_PSRCB]], [[ENTRY]] ], [ [[ADD_PTR_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
238 ; CHECK-T2-NEXT: [[BLOCKSIZE1_0_LCSSA:%.*]] = phi i32 [ [[SUB]], [[ENTRY]] ], [ [[DEC12_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
239 ; CHECK-T2-NEXT: [[COUNT_0_LCSSA:%.*]] = phi i32 [ 1, [[ENTRY]] ], [ [[INC_LCSSA]], [[WHILE_END13_LOOPEXIT]] ]
240 ; CHECK-T2-NEXT: [[CMP161068:%.*]] = icmp eq i32 [[BLOCKSIZE1_0_LCSSA]], 0
241 ; CHECK-T2-NEXT: br i1 [[CMP161068]], label [[EXIT:%.*]], label [[WHILE_BODY18_PREHEADER:%.*]]
242 ; CHECK-T2: while.body18.preheader:
243 ; CHECK-T2-NEXT: [[ADD_PTR14:%.*]] = getelementptr inbounds i16, ptr [[PY_0_LCSSA]], i32 -1
244 ; CHECK-T2-NEXT: br label [[WHILE_BODY18:%.*]]
245 ; CHECK-T2: while.body18:
246 ; CHECK-T2-NEXT: [[COUNT_11072:%.*]] = phi i32 [ [[INC49:%.*]], [[WHILE_END43:%.*]] ], [ [[COUNT_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
247 ; CHECK-T2-NEXT: [[BLOCKSIZE1_11071:%.*]] = phi i32 [ [[DEC50:%.*]], [[WHILE_END43]] ], [ [[BLOCKSIZE1_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
248 ; CHECK-T2-NEXT: [[PY_21070:%.*]] = phi ptr [ [[ADD_PTR48:%.*]], [[WHILE_END43]] ], [ [[ADD_PTR14]], [[WHILE_BODY18_PREHEADER]] ]
249 ; CHECK-T2-NEXT: [[POUT_11069:%.*]] = phi ptr [ [[INCDEC_PTR46:%.*]], [[WHILE_END43]] ], [ [[POUT_0_LCSSA]], [[WHILE_BODY18_PREHEADER]] ]
250 ; CHECK-T2-NEXT: [[SHR19:%.*]] = lshr i32 [[COUNT_11072]], 2
251 ; CHECK-T2-NEXT: [[CMP211054:%.*]] = icmp eq i32 [[SHR19]], 0
252 ; CHECK-T2-NEXT: br i1 [[CMP211054]], label [[WHILE_END31:%.*]], label [[WHILE_BODY23_PREHEADER:%.*]]
253 ; CHECK-T2: while.body23.preheader:
254 ; CHECK-T2-NEXT: br label [[WHILE_BODY23:%.*]]
255 ; CHECK-T2: while.body23:
256 ; CHECK-T2-NEXT: [[K_11058:%.*]] = phi i32 [ [[DEC30:%.*]], [[WHILE_BODY23]] ], [ [[SHR19]], [[WHILE_BODY23_PREHEADER]] ]
257 ; CHECK-T2-NEXT: [[SUM_11057:%.*]] = phi i32 [ [[ADD6_I878:%.*]], [[WHILE_BODY23]] ], [ 0, [[WHILE_BODY23_PREHEADER]] ]
258 ; CHECK-T2-NEXT: [[PY_31056:%.*]] = phi ptr [ [[ADD_PTR_I884:%.*]], [[WHILE_BODY23]] ], [ [[PY_21070]], [[WHILE_BODY23_PREHEADER]] ]
259 ; CHECK-T2-NEXT: [[PX_31055:%.*]] = phi ptr [ [[ADD_PTR_I890:%.*]], [[WHILE_BODY23]] ], [ [[PSRCB_PSRCA]], [[WHILE_BODY23_PREHEADER]] ]
260 ; CHECK-T2-NEXT: [[ARRAYIDX_I907:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 1
261 ; CHECK-T2-NEXT: [[TMP5:%.*]] = load i16, ptr [[ARRAYIDX_I907]], align 2
262 ; CHECK-T2-NEXT: [[TMP6:%.*]] = load i16, ptr [[PX_31055]], align 2
263 ; CHECK-T2-NEXT: [[ADD_PTR_I912:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 2
264 ; CHECK-T2-NEXT: [[ARRAYIDX_I901:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 1
265 ; CHECK-T2-NEXT: [[TMP7:%.*]] = load i16, ptr [[ARRAYIDX_I901]], align 2
266 ; CHECK-T2-NEXT: [[TMP8:%.*]] = load i16, ptr [[PY_31056]], align 2
267 ; CHECK-T2-NEXT: [[ADD_PTR_I906:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -2
268 ; CHECK-T2-NEXT: [[SHR_I892:%.*]] = sext i16 [[TMP6]] to i32
269 ; CHECK-T2-NEXT: [[SHR1_I893:%.*]] = sext i16 [[TMP7]] to i32
270 ; CHECK-T2-NEXT: [[MUL_I894:%.*]] = mul nsw i32 [[SHR1_I893]], [[SHR_I892]]
271 ; CHECK-T2-NEXT: [[SHR2_I895:%.*]] = sext i16 [[TMP5]] to i32
272 ; CHECK-T2-NEXT: [[SHR4_I897:%.*]] = sext i16 [[TMP8]] to i32
273 ; CHECK-T2-NEXT: [[MUL5_I898:%.*]] = mul nsw i32 [[SHR4_I897]], [[SHR2_I895]]
274 ; CHECK-T2-NEXT: [[ADD_I899:%.*]] = add i32 [[MUL_I894]], [[SUM_11057]]
275 ; CHECK-T2-NEXT: [[ADD6_I900:%.*]] = add i32 [[ADD_I899]], [[MUL5_I898]]
276 ; CHECK-T2-NEXT: [[ARRAYIDX_I885:%.*]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 3
277 ; CHECK-T2-NEXT: [[TMP9:%.*]] = load i16, ptr [[ARRAYIDX_I885]], align 2
278 ; CHECK-T2-NEXT: [[TMP10:%.*]] = load i16, ptr [[ADD_PTR_I912]], align 2
279 ; CHECK-T2-NEXT: [[ADD_PTR_I890]] = getelementptr inbounds i16, ptr [[PX_31055]], i32 4
280 ; CHECK-T2-NEXT: [[ARRAYIDX_I879:%.*]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -1
281 ; CHECK-T2-NEXT: [[TMP11:%.*]] = load i16, ptr [[ARRAYIDX_I879]], align 2
282 ; CHECK-T2-NEXT: [[TMP12:%.*]] = load i16, ptr [[ADD_PTR_I906]], align 2
283 ; CHECK-T2-NEXT: [[ADD_PTR_I884]] = getelementptr inbounds i16, ptr [[PY_31056]], i32 -4
284 ; CHECK-T2-NEXT: [[SHR_I870:%.*]] = sext i16 [[TMP10]] to i32
285 ; CHECK-T2-NEXT: [[SHR1_I871:%.*]] = sext i16 [[TMP11]] to i32
286 ; CHECK-T2-NEXT: [[MUL_I872:%.*]] = mul nsw i32 [[SHR1_I871]], [[SHR_I870]]
287 ; CHECK-T2-NEXT: [[SHR2_I873:%.*]] = sext i16 [[TMP9]] to i32
288 ; CHECK-T2-NEXT: [[SHR4_I875:%.*]] = sext i16 [[TMP12]] to i32
289 ; CHECK-T2-NEXT: [[MUL5_I876:%.*]] = mul nsw i32 [[SHR4_I875]], [[SHR2_I873]]
290 ; CHECK-T2-NEXT: [[ADD_I877:%.*]] = add i32 [[ADD6_I900]], [[MUL_I872]]
291 ; CHECK-T2-NEXT: [[ADD6_I878]] = add i32 [[ADD_I877]], [[MUL5_I876]]
292 ; CHECK-T2-NEXT: [[DEC30]] = add nsw i32 [[K_11058]], -1
293 ; CHECK-T2-NEXT: [[CMP21:%.*]] = icmp eq i32 [[DEC30]], 0
294 ; CHECK-T2-NEXT: br i1 [[CMP21]], label [[WHILE_END31_LOOPEXIT:%.*]], label [[WHILE_BODY23]]
295 ; CHECK-T2: while.end31.loopexit:
296 ; CHECK-T2-NEXT: [[ADD_PTR_I890_LCSSA:%.*]] = phi ptr [ [[ADD_PTR_I890]], [[WHILE_BODY23]] ]
297 ; CHECK-T2-NEXT: [[ADD_PTR_I884_LCSSA:%.*]] = phi ptr [ [[ADD_PTR_I884]], [[WHILE_BODY23]] ]
298 ; CHECK-T2-NEXT: [[ADD6_I878_LCSSA:%.*]] = phi i32 [ [[ADD6_I878]], [[WHILE_BODY23]] ]
299 ; CHECK-T2-NEXT: br label [[WHILE_END31]]
300 ; CHECK-T2: while.end31:
301 ; CHECK-T2-NEXT: [[PX_3_LCSSA:%.*]] = phi ptr [ [[PSRCB_PSRCA]], [[WHILE_BODY18]] ], [ [[ADD_PTR_I890_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
302 ; CHECK-T2-NEXT: [[PY_3_LCSSA:%.*]] = phi ptr [ [[PY_21070]], [[WHILE_BODY18]] ], [ [[ADD_PTR_I884_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
303 ; CHECK-T2-NEXT: [[SUM_1_LCSSA:%.*]] = phi i32 [ 0, [[WHILE_BODY18]] ], [ [[ADD6_I878_LCSSA]], [[WHILE_END31_LOOPEXIT]] ]
304 ; CHECK-T2-NEXT: [[REM:%.*]] = and i32 [[COUNT_11072]], 3
305 ; CHECK-T2-NEXT: [[CMP341062:%.*]] = icmp eq i32 [[REM]], 0
306 ; CHECK-T2-NEXT: br i1 [[CMP341062]], label [[WHILE_END43]], label [[WHILE_BODY36_PREHEADER:%.*]]
307 ; CHECK-T2: while.body36.preheader:
308 ; CHECK-T2-NEXT: [[ADD_PTR32:%.*]] = getelementptr inbounds i16, ptr [[PY_3_LCSSA]], i32 1
309 ; CHECK-T2-NEXT: br label [[WHILE_BODY36:%.*]]
310 ; CHECK-T2: while.body36:
311 ; CHECK-T2-NEXT: [[K_21066:%.*]] = phi i32 [ [[DEC42:%.*]], [[WHILE_BODY36]] ], [ [[REM]], [[WHILE_BODY36_PREHEADER]] ]
312 ; CHECK-T2-NEXT: [[SUM_21065:%.*]] = phi i32 [ [[ADD6_I868:%.*]], [[WHILE_BODY36]] ], [ [[SUM_1_LCSSA]], [[WHILE_BODY36_PREHEADER]] ]
313 ; CHECK-T2-NEXT: [[PY_41064:%.*]] = phi ptr [ [[INCDEC_PTR39:%.*]], [[WHILE_BODY36]] ], [ [[ADD_PTR32]], [[WHILE_BODY36_PREHEADER]] ]
314 ; CHECK-T2-NEXT: [[PX_41063:%.*]] = phi ptr [ [[INCDEC_PTR37:%.*]], [[WHILE_BODY36]] ], [ [[PX_3_LCSSA]], [[WHILE_BODY36_PREHEADER]] ]
315 ; CHECK-T2-NEXT: [[INCDEC_PTR37]] = getelementptr inbounds i16, ptr [[PX_41063]], i32 1
316 ; CHECK-T2-NEXT: [[TMP13:%.*]] = load i16, ptr [[PX_41063]], align 2
317 ; CHECK-T2-NEXT: [[CONV38:%.*]] = sext i16 [[TMP13]] to i32
318 ; CHECK-T2-NEXT: [[INCDEC_PTR39]] = getelementptr inbounds i16, ptr [[PY_41064]], i32 -1
319 ; CHECK-T2-NEXT: [[TMP14:%.*]] = load i16, ptr [[PY_41064]], align 2
320 ; CHECK-T2-NEXT: [[CONV40:%.*]] = sext i16 [[TMP14]] to i32
321 ; CHECK-T2-NEXT: [[MUL_I863:%.*]] = mul nsw i32 [[CONV40]], [[CONV38]]
322 ; CHECK-T2-NEXT: [[SHR3_I864:%.*]] = ashr i32 [[CONV38]], 16
323 ; CHECK-T2-NEXT: [[SHR4_I865:%.*]] = ashr i32 [[CONV40]], 16
324 ; CHECK-T2-NEXT: [[MUL5_I866:%.*]] = mul nsw i32 [[SHR4_I865]], [[SHR3_I864]]
325 ; CHECK-T2-NEXT: [[ADD_I867:%.*]] = add i32 [[MUL_I863]], [[SUM_21065]]
326 ; CHECK-T2-NEXT: [[ADD6_I868]] = add i32 [[ADD_I867]], [[MUL5_I866]]
327 ; CHECK-T2-NEXT: [[DEC42]] = add nsw i32 [[K_21066]], -1
328 ; CHECK-T2-NEXT: [[CMP34:%.*]] = icmp eq i32 [[DEC42]], 0
329 ; CHECK-T2-NEXT: br i1 [[CMP34]], label [[WHILE_END43_LOOPEXIT:%.*]], label [[WHILE_BODY36]]
330 ; CHECK-T2: while.end43.loopexit:
331 ; CHECK-T2-NEXT: [[ADD6_I868_LCSSA:%.*]] = phi i32 [ [[ADD6_I868]], [[WHILE_BODY36]] ]
332 ; CHECK-T2-NEXT: br label [[WHILE_END43]]
333 ; CHECK-T2: while.end43:
334 ; CHECK-T2-NEXT: [[SUM_2_LCSSA:%.*]] = phi i32 [ [[SUM_1_LCSSA]], [[WHILE_END31]] ], [ [[ADD6_I868_LCSSA]], [[WHILE_END43_LOOPEXIT]] ]
335 ; CHECK-T2-NEXT: [[TMP15:%.*]] = lshr i32 [[SUM_2_LCSSA]], 15
336 ; CHECK-T2-NEXT: [[CONV45:%.*]] = trunc i32 [[TMP15]] to i16
337 ; CHECK-T2-NEXT: [[INCDEC_PTR46]] = getelementptr inbounds i16, ptr [[POUT_11069]], i32 1
338 ; CHECK-T2-NEXT: store i16 [[CONV45]], ptr [[POUT_11069]], align 2
339 ; CHECK-T2-NEXT: [[SUB47:%.*]] = add i32 [[COUNT_11072]], -1
340 ; CHECK-T2-NEXT: [[ADD_PTR48]] = getelementptr inbounds i16, ptr [[PSRCA_PSRCB]], i32 [[SUB47]]
341 ; CHECK-T2-NEXT: [[INC49]] = add i32 [[COUNT_11072]], 1
342 ; CHECK-T2-NEXT: [[DEC50]] = add i32 [[BLOCKSIZE1_11071]], -1
343 ; CHECK-T2-NEXT: [[CMP16:%.*]] = icmp eq i32 [[DEC50]], 0
344 ; CHECK-T2-NEXT: br i1 [[CMP16]], label [[EXIT_LOOPEXIT:%.*]], label [[WHILE_BODY18]]
345 ; CHECK-T2: exit.loopexit:
346 ; CHECK-T2-NEXT: br label [[EXIT]]
348 ; CHECK-T2-NEXT: ret void
351 %cmp = icmp ult i32 %srcALen, %srcBLen
352 %srcALen.srcBLen = select i1 %cmp, i32 %srcALen, i32 %srcBLen
353 %pSrcB.pSrcA = select i1 %cmp, ptr %pSrcB, ptr %pSrcA
354 %pSrcA.pSrcB = select i1 %cmp, ptr %pSrcA, ptr %pSrcB
355 %sub = add i32 %srcALen.srcBLen, -1
356 %cmp41080 = icmp eq i32 %sub, 0
357 br i1 %cmp41080, label %while.end13, label %while.cond5.preheader
359 while.cond5.preheader: ; preds = %while.end, %entry
360 %count.01084 = phi i32 [ %inc, %while.end ], [ 1, %entry ]
361 %blockSize1.01083 = phi i32 [ %dec12, %while.end ], [ %sub, %entry ]
362 %py.01082 = phi ptr [ %add.ptr, %while.end ], [ %pSrcA.pSrcB, %entry ]
363 %pOut.01081 = phi ptr [ %incdec.ptr11, %while.end ], [ %pDst, %entry ]
364 br label %while.body7
366 while.body7: ; preds = %while.body7, %while.cond5.preheader
367 %k.01078 = phi i32 [ %dec, %while.body7 ], [ %count.01084, %while.cond5.preheader ]
368 %sum.01077 = phi i32 [ %add6.i, %while.body7 ], [ 0, %while.cond5.preheader ]
369 %py.11076 = phi ptr [ %incdec.ptr8, %while.body7 ], [ %py.01082, %while.cond5.preheader ]
370 %px.11075 = phi ptr [ %incdec.ptr, %while.body7 ], [ %pSrcB.pSrcA, %while.cond5.preheader ]
371 %incdec.ptr = getelementptr inbounds i16, ptr %px.11075, i32 1
372 %0 = load i16, ptr %px.11075, align 2
373 %conv = sext i16 %0 to i32
374 %incdec.ptr8 = getelementptr inbounds i16, ptr %py.11076, i32 -1
375 %1 = load i16, ptr %py.11076, align 2
376 %conv9 = sext i16 %1 to i32
377 %mul.i = mul nsw i32 %conv9, %conv
378 %shr3.i = ashr i32 %conv, 16
379 %shr4.i = ashr i32 %conv9, 16
380 %mul5.i = mul nsw i32 %shr4.i, %shr3.i
381 %add.i = add i32 %mul.i, %sum.01077
382 %add6.i = add i32 %add.i, %mul5.i
383 %dec = add nsw i32 %k.01078, -1
384 %cmp6 = icmp eq i32 %dec, 0
385 br i1 %cmp6, label %while.end, label %while.body7
387 while.end: ; preds = %while.body7
388 %2 = lshr i32 %add6.i, 15
389 %conv10 = trunc i32 %2 to i16
390 %incdec.ptr11 = getelementptr inbounds i16, ptr %pOut.01081, i32 1
391 store i16 %conv10, ptr %pOut.01081, align 2
392 %add.ptr = getelementptr inbounds i16, ptr %pSrcA.pSrcB, i32 %count.01084
393 %inc = add nuw nsw i32 %count.01084, 1
394 %dec12 = add i32 %blockSize1.01083, -1
395 %cmp3 = icmp ult i32 %count.01084, 3
396 %cmp4 = icmp ne i32 %dec12, 0
397 %3 = and i1 %cmp4, %cmp3
398 br i1 %3, label %while.cond5.preheader, label %while.end13
400 while.end13: ; preds = %while.end, %entry
401 %pOut.0.lcssa = phi ptr [ %pDst, %entry ], [ %incdec.ptr11, %while.end ]
402 %py.0.lcssa = phi ptr [ %pSrcA.pSrcB, %entry ], [ %add.ptr, %while.end ]
403 %blockSize1.0.lcssa = phi i32 [ %sub, %entry ], [ %dec12, %while.end ]
404 %count.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.end ]
405 %cmp161068 = icmp eq i32 %blockSize1.0.lcssa, 0
406 br i1 %cmp161068, label %exit, label %while.body18.preheader
408 while.body18.preheader: ; preds = %while.end13
409 %add.ptr14 = getelementptr inbounds i16, ptr %py.0.lcssa, i32 -1
410 br label %while.body18
412 while.body18: ; preds = %while.end43, %while.body18.preheader
413 %count.11072 = phi i32 [ %inc49, %while.end43 ], [ %count.0.lcssa, %while.body18.preheader ]
414 %blockSize1.11071 = phi i32 [ %dec50, %while.end43 ], [ %blockSize1.0.lcssa, %while.body18.preheader ]
415 %py.21070 = phi ptr [ %add.ptr48, %while.end43 ], [ %add.ptr14, %while.body18.preheader ]
416 %pOut.11069 = phi ptr [ %incdec.ptr46, %while.end43 ], [ %pOut.0.lcssa, %while.body18.preheader ]
417 %shr19 = lshr i32 %count.11072, 2
418 %cmp211054 = icmp eq i32 %shr19, 0
419 br i1 %cmp211054, label %while.end31, label %while.body23
421 while.body23: ; preds = %while.body23, %while.body18
422 %k.11058 = phi i32 [ %dec30, %while.body23 ], [ %shr19, %while.body18 ]
423 %sum.11057 = phi i32 [ %add6.i878, %while.body23 ], [ 0, %while.body18 ]
424 %py.31056 = phi ptr [ %add.ptr.i884, %while.body23 ], [ %py.21070, %while.body18 ]
425 %px.31055 = phi ptr [ %add.ptr.i890, %while.body23 ], [ %pSrcB.pSrcA, %while.body18 ]
426 %arrayidx.i907 = getelementptr inbounds i16, ptr %px.31055, i32 1
427 %4 = load i16, ptr %arrayidx.i907, align 2
428 %5 = load i16, ptr %px.31055, align 2
429 %add.ptr.i912 = getelementptr inbounds i16, ptr %px.31055, i32 2
430 %arrayidx.i901 = getelementptr inbounds i16, ptr %py.31056, i32 1
431 %6 = load i16, ptr %arrayidx.i901, align 2
432 %7 = load i16, ptr %py.31056, align 2
433 %add.ptr.i906 = getelementptr inbounds i16, ptr %py.31056, i32 -2
434 %shr.i892 = sext i16 %5 to i32
435 %shr1.i893 = sext i16 %6 to i32
436 %mul.i894 = mul nsw i32 %shr1.i893, %shr.i892
437 %shr2.i895 = sext i16 %4 to i32
438 %shr4.i897 = sext i16 %7 to i32
439 %mul5.i898 = mul nsw i32 %shr4.i897, %shr2.i895
440 %add.i899 = add i32 %mul.i894, %sum.11057
441 %add6.i900 = add i32 %add.i899, %mul5.i898
442 %arrayidx.i885 = getelementptr inbounds i16, ptr %px.31055, i32 3
443 %8 = load i16, ptr %arrayidx.i885, align 2
444 %9 = load i16, ptr %add.ptr.i912, align 2
445 %add.ptr.i890 = getelementptr inbounds i16, ptr %px.31055, i32 4
446 %arrayidx.i879 = getelementptr inbounds i16, ptr %py.31056, i32 -1
447 %10 = load i16, ptr %arrayidx.i879, align 2
448 %11 = load i16, ptr %add.ptr.i906, align 2
449 %add.ptr.i884 = getelementptr inbounds i16, ptr %py.31056, i32 -4
450 %shr.i870 = sext i16 %9 to i32
451 %shr1.i871 = sext i16 %10 to i32
452 %mul.i872 = mul nsw i32 %shr1.i871, %shr.i870
453 %shr2.i873 = sext i16 %8 to i32
454 %shr4.i875 = sext i16 %11 to i32
455 %mul5.i876 = mul nsw i32 %shr4.i875, %shr2.i873
456 %add.i877 = add i32 %add6.i900, %mul.i872
457 %add6.i878 = add i32 %add.i877, %mul5.i876
458 %dec30 = add nsw i32 %k.11058, -1
459 %cmp21 = icmp eq i32 %dec30, 0
460 br i1 %cmp21, label %while.end31, label %while.body23
462 while.end31: ; preds = %while.body23, %while.body18
463 %px.3.lcssa = phi ptr [ %pSrcB.pSrcA, %while.body18 ], [ %add.ptr.i890, %while.body23 ]
464 %py.3.lcssa = phi ptr [ %py.21070, %while.body18 ], [ %add.ptr.i884, %while.body23 ]
465 %sum.1.lcssa = phi i32 [ 0, %while.body18 ], [ %add6.i878, %while.body23 ]
466 %rem = and i32 %count.11072, 3
467 %cmp341062 = icmp eq i32 %rem, 0
468 br i1 %cmp341062, label %while.end43, label %while.body36.preheader
470 while.body36.preheader: ; preds = %while.end31
471 %add.ptr32 = getelementptr inbounds i16, ptr %py.3.lcssa, i32 1
472 br label %while.body36
474 while.body36: ; preds = %while.body36, %while.body36.preheader
475 %k.21066 = phi i32 [ %dec42, %while.body36 ], [ %rem, %while.body36.preheader ]
476 %sum.21065 = phi i32 [ %add6.i868, %while.body36 ], [ %sum.1.lcssa, %while.body36.preheader ]
477 %py.41064 = phi ptr [ %incdec.ptr39, %while.body36 ], [ %add.ptr32, %while.body36.preheader ]
478 %px.41063 = phi ptr [ %incdec.ptr37, %while.body36 ], [ %px.3.lcssa, %while.body36.preheader ]
479 %incdec.ptr37 = getelementptr inbounds i16, ptr %px.41063, i32 1
480 %12 = load i16, ptr %px.41063, align 2
481 %conv38 = sext i16 %12 to i32
482 %incdec.ptr39 = getelementptr inbounds i16, ptr %py.41064, i32 -1
483 %13 = load i16, ptr %py.41064, align 2
484 %conv40 = sext i16 %13 to i32
485 %mul.i863 = mul nsw i32 %conv40, %conv38
486 %shr3.i864 = ashr i32 %conv38, 16
487 %shr4.i865 = ashr i32 %conv40, 16
488 %mul5.i866 = mul nsw i32 %shr4.i865, %shr3.i864
489 %add.i867 = add i32 %mul.i863, %sum.21065
490 %add6.i868 = add i32 %add.i867, %mul5.i866
491 %dec42 = add nsw i32 %k.21066, -1
492 %cmp34 = icmp eq i32 %dec42, 0
493 br i1 %cmp34, label %while.end43, label %while.body36
495 while.end43: ; preds = %while.body36, %while.end31
496 %sum.2.lcssa = phi i32 [ %sum.1.lcssa, %while.end31 ], [ %add6.i868, %while.body36 ]
497 %14 = lshr i32 %sum.2.lcssa, 15
498 %conv45 = trunc i32 %14 to i16
499 %incdec.ptr46 = getelementptr inbounds i16, ptr %pOut.11069, i32 1
500 store i16 %conv45, ptr %pOut.11069, align 2
501 %sub47 = add i32 %count.11072, -1
502 %add.ptr48 = getelementptr inbounds i16, ptr %pSrcA.pSrcB, i32 %sub47
503 %inc49 = add i32 %count.11072, 1
504 %dec50 = add i32 %blockSize1.11071, -1
505 %cmp16 = icmp eq i32 %dec50, 0
506 br i1 %cmp16, label %exit, label %while.body18
508 exit: ; preds = %while.end43, %while.end13