@@ -1022,12 +1022,6 @@ class LoopVectorizationCostModel {
1022
1022
SmallMapVector<unsigned , unsigned , 4 > MaxLocalUsers;
1023
1023
};
1024
1024
1025
- // / \return Returns information about the register usages of the loop for the
1026
- // / given plan and vectorization factors.
1027
- SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
1028
- calculateRegisterUsage (VPlan &Plan, ArrayRef<ElementCount> VFs,
1029
- const TargetTransformInfo &TTI);
1030
-
1031
1025
// / Collect values we want to ignore in the cost model.
1032
1026
void collectValuesToIgnore ();
1033
1027
@@ -4870,9 +4864,9 @@ void LoopVectorizationCostModel::collectElementTypesForWidening() {
4870
4864
4871
4865
// / Estimate the register usage for \p Plan and vectorization factors in \p VFs.
4872
4866
// / Returns the register usage for each VF in \p VFs.
4873
- SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4874
- LoopVectorizationCostModel:: calculateRegisterUsage (
4875
- VPlan &Plan, ArrayRef<ElementCount> VFs, const TargetTransformInfo &TTI) {
4867
+ static SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4868
+ calculateRegisterUsage (VPlan &Plan, ArrayRef<ElementCount> VFs,
4869
+ const TargetTransformInfo &TTI) {
4876
4870
// This function calculates the register usage by measuring the highest number
4877
4871
// of values that are alive at a single location. Obviously, this is a very
4878
4872
// rough estimation. We scan the loop in a topological order in order and
@@ -5159,7 +5153,7 @@ LoopVectorizationCostModel::selectInterleaveCount(VPlan &Plan, ElementCount VF,
5159
5153
return 1 ;
5160
5154
}
5161
5155
5162
- RegisterUsage R = calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5156
+ RegisterUsage R = :: calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5163
5157
// We divide by these constants so assume that we have at least one
5164
5158
// instruction that uses at least one register.
5165
5159
for (auto &Pair : R.MaxLocalUsers ) {
@@ -7558,7 +7552,7 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7558
7552
7559
7553
for (auto &P : VPlans) {
7560
7554
SmallVector<ElementCount, 1 > VFs (P->vectorFactors ());
7561
- auto RUs = CM. calculateRegisterUsage (*P, VFs, TTI);
7555
+ auto RUs = :: calculateRegisterUsage (*P, VFs, TTI);
7562
7556
for (unsigned I = 0 ; I < VFs.size (); I++) {
7563
7557
auto VF = VFs[I];
7564
7558
if (VF.isScalar ())
@@ -7609,8 +7603,8 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7609
7603
SmallVector<ElementCount, 1 > VFs = {BestFactor.Width };
7610
7604
7611
7605
auto LegacyRUs =
7612
- CM. calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7613
- auto RUs = CM. calculateRegisterUsage (BestPlan, VFs, TTI);
7606
+ calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7607
+ auto RUs = calculateRegisterUsage (BestPlan, VFs, TTI);
7614
7608
7615
7609
auto GetMaxUsage = [](SmallMapVector<unsigned , unsigned , 4 > MaxLocalUsers) {
7616
7610
unsigned Max = 0 ;
0 commit comments