@@ -172,14 +172,12 @@ class VPBuilder {
172
172
// / Information about vectorization costs
173
173
struct VectorizationFactor {
174
174
// Vector width with best cost
175
- ElementCount Width;
175
+ unsigned Width;
176
176
// Cost of the loop with that width
177
177
unsigned Cost;
178
178
179
179
// Width 1 means no vectorization, cost 0 means uncomputed cost.
180
- static VectorizationFactor Disabled () {
181
- return {ElementCount::getFixed (1 ), 0 };
182
- }
180
+ static VectorizationFactor Disabled () { return {1 , 0 }; }
183
181
184
182
bool operator ==(const VectorizationFactor &rhs) const {
185
183
return Width == rhs.Width && Cost == rhs.Cost ;
@@ -229,10 +227,7 @@ class LoopVectorizationPlanner {
229
227
// / A builder used to construct the current plan.
230
228
VPBuilder Builder;
231
229
232
- // / The best number of elements of the vector types used in the
233
- // / transformed loop. BestVF = None means that vectorization is
234
- // / disabled.
235
- Optional<ElementCount> BestVF = None;
230
+ unsigned BestVF = 0 ;
236
231
unsigned BestUF = 0 ;
237
232
238
233
public:
@@ -247,14 +242,14 @@ class LoopVectorizationPlanner {
247
242
248
243
// / Plan how to best vectorize, return the best VF and its cost, or None if
249
244
// / vectorization and interleaving should be avoided up front.
250
- Optional<VectorizationFactor> plan (ElementCount UserVF, unsigned UserIC);
245
+ Optional<VectorizationFactor> plan (unsigned UserVF, unsigned UserIC);
251
246
252
247
// / Use the VPlan-native path to plan how to best vectorize, return the best
253
248
// / VF and its cost.
254
- VectorizationFactor planInVPlanNativePath (ElementCount UserVF);
249
+ VectorizationFactor planInVPlanNativePath (unsigned UserVF);
255
250
256
251
// / Finalize the best decision and dispose of all other VPlans.
257
- void setBestPlan (ElementCount VF, unsigned UF);
252
+ void setBestPlan (unsigned VF, unsigned UF);
258
253
259
254
// / Generate the IR code for the body of the vectorized loop according to the
260
255
// / best selected VPlan.
@@ -269,7 +264,7 @@ class LoopVectorizationPlanner {
269
264
// / \p Predicate on Range.Start, possibly decreasing Range.End such that the
270
265
// / returned value holds for the entire \p Range.
271
266
static bool
272
- getDecisionAndClampRange (const std::function<bool (ElementCount )> &Predicate,
267
+ getDecisionAndClampRange (const std::function<bool (unsigned )> &Predicate,
273
268
VFRange &Range);
274
269
275
270
protected:
0 commit comments