@@ -172,14 +172,12 @@ class VPBuilder {
172172// / Information about vectorization costs
173173struct VectorizationFactor {
174174 // Vector width with best cost
175- ElementCount Width;
175+ unsigned Width;
176176 // Cost of the loop with that width
177177 unsigned Cost;
178178
179179 // 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 }; }
183181
184182 bool operator ==(const VectorizationFactor &rhs) const {
185183 return Width == rhs.Width && Cost == rhs.Cost ;
@@ -229,10 +227,7 @@ class LoopVectorizationPlanner {
229227 // / A builder used to construct the current plan.
230228 VPBuilder Builder;
231229
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 ;
236231 unsigned BestUF = 0 ;
237232
238233public:
@@ -247,14 +242,14 @@ class LoopVectorizationPlanner {
247242
248243 // / Plan how to best vectorize, return the best VF and its cost, or None if
249244 // / vectorization and interleaving should be avoided up front.
250- Optional<VectorizationFactor> plan (ElementCount UserVF, unsigned UserIC);
245+ Optional<VectorizationFactor> plan (unsigned UserVF, unsigned UserIC);
251246
252247 // / Use the VPlan-native path to plan how to best vectorize, return the best
253248 // / VF and its cost.
254- VectorizationFactor planInVPlanNativePath (ElementCount UserVF);
249+ VectorizationFactor planInVPlanNativePath (unsigned UserVF);
255250
256251 // / Finalize the best decision and dispose of all other VPlans.
257- void setBestPlan (ElementCount VF , unsigned UF );
252+ void setBestPlan (unsigned VF , unsigned UF );
258253
259254 // / Generate the IR code for the body of the vectorized loop according to the
260255 // / best selected VPlan.
@@ -269,7 +264,7 @@ class LoopVectorizationPlanner {
269264 // / \p Predicate on Range.Start, possibly decreasing Range.End such that the
270265 // / returned value holds for the entire \p Range.
271266 static bool
272- getDecisionAndClampRange (const std::function<bool (ElementCount )> &Predicate,
267+ getDecisionAndClampRange (const std::function<bool (unsigned )> &Predicate,
273268 VFRange &Range);
274269
275270protected:
0 commit comments