@@ -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
@@ -4867,9 +4861,9 @@ void LoopVectorizationCostModel::collectElementTypesForWidening() {
4867
4861
4868
4862
// / Estimate the register usage for \p Plan and vectorization factors in \p VFs.
4869
4863
// / Returns the register usage for each VF in \p VFs.
4870
- SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4871
- LoopVectorizationCostModel:: calculateRegisterUsage (
4872
- VPlan &Plan, ArrayRef<ElementCount> VFs, const TargetTransformInfo &TTI) {
4864
+ static SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4865
+ calculateRegisterUsage (VPlan &Plan, ArrayRef<ElementCount> VFs,
4866
+ const TargetTransformInfo &TTI) {
4873
4867
// This function calculates the register usage by measuring the highest number
4874
4868
// of values that are alive at a single location. Obviously, this is a very
4875
4869
// rough estimation. We scan the loop in a topological order in order and
@@ -5156,7 +5150,7 @@ LoopVectorizationCostModel::selectInterleaveCount(VPlan &Plan, ElementCount VF,
5156
5150
return 1 ;
5157
5151
}
5158
5152
5159
- RegisterUsage R = calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5153
+ RegisterUsage R = :: calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5160
5154
// We divide by these constants so assume that we have at least one
5161
5155
// instruction that uses at least one register.
5162
5156
for (auto &Pair : R.MaxLocalUsers ) {
@@ -7555,7 +7549,7 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7555
7549
7556
7550
for (auto &P : VPlans) {
7557
7551
SmallVector<ElementCount, 1 > VFs (P->vectorFactors ());
7558
- auto RUs = CM. calculateRegisterUsage (*P, VFs, TTI);
7552
+ auto RUs = :: calculateRegisterUsage (*P, VFs, TTI);
7559
7553
for (unsigned I = 0 ; I < VFs.size (); I++) {
7560
7554
auto VF = VFs[I];
7561
7555
if (VF.isScalar ())
@@ -7606,8 +7600,8 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7606
7600
SmallVector<ElementCount, 1 > VFs = {BestFactor.Width };
7607
7601
7608
7602
auto LegacyRUs =
7609
- CM. calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7610
- auto RUs = CM. calculateRegisterUsage (BestPlan, VFs, TTI);
7603
+ calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7604
+ auto RUs = calculateRegisterUsage (BestPlan, VFs, TTI);
7611
7605
7612
7606
auto GetMaxUsage = [](SmallMapVector<unsigned , unsigned , 4 > MaxLocalUsers) {
7613
7607
unsigned Max = 0 ;
0 commit comments