@@ -1048,12 +1048,6 @@ class LoopVectorizationCostModel {
1048
1048
SmallMapVector<unsigned , unsigned , 4 > MaxLocalUsers;
1049
1049
};
1050
1050
1051
- // / \return Returns information about the register usages of the loop for the
1052
- // / given plan and vectorization factors.
1053
- SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
1054
- calculateRegisterUsage (VPlan &Plan, ArrayRef<ElementCount> VFs,
1055
- const TargetTransformInfo &TTI);
1056
-
1057
1051
// / Collect values we want to ignore in the cost model.
1058
1052
void collectValuesToIgnore ();
1059
1053
@@ -4874,9 +4868,9 @@ void LoopVectorizationCostModel::collectElementTypesForWidening() {
4874
4868
4875
4869
// / Estimate the register usage for \p Plan and vectorization factors in \p VFs.
4876
4870
// / Returns the register usage for each VF in \p VFs.
4877
- SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4878
- LoopVectorizationCostModel:: calculateRegisterUsage (
4879
- VPlan &Plan, ArrayRef<ElementCount> VFs, const TargetTransformInfo &TTI) {
4871
+ static SmallVector<LoopVectorizationCostModel::RegisterUsage, 8 >
4872
+ calculateRegisterUsage (VPlan &Plan, ArrayRef<ElementCount> VFs,
4873
+ const TargetTransformInfo &TTI) {
4880
4874
// This function calculates the register usage by measuring the highest number
4881
4875
// of values that are alive at a single location. Obviously, this is a very
4882
4876
// rough estimation. We scan the loop in a topological order in order and
@@ -5163,7 +5157,7 @@ LoopVectorizationCostModel::selectInterleaveCount(VPlan &Plan, ElementCount VF,
5163
5157
return 1 ;
5164
5158
}
5165
5159
5166
- RegisterUsage R = calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5160
+ RegisterUsage R = :: calculateRegisterUsage (Plan, {VF}, TTI)[0 ];
5167
5161
// We divide by these constants so assume that we have at least one
5168
5162
// instruction that uses at least one register.
5169
5163
for (auto &Pair : R.MaxLocalUsers ) {
@@ -7565,7 +7559,7 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7565
7559
7566
7560
for (auto &P : VPlans) {
7567
7561
SmallVector<ElementCount, 1 > VFs (P->vectorFactors ());
7568
- auto RUs = CM. calculateRegisterUsage (*P, VFs, TTI);
7562
+ auto RUs = :: calculateRegisterUsage (*P, VFs, TTI);
7569
7563
for (unsigned I = 0 ; I < VFs.size (); I++) {
7570
7564
auto VF = VFs[I];
7571
7565
if (VF.isScalar ())
@@ -7616,8 +7610,8 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
7616
7610
SmallVector<ElementCount, 1 > VFs = {BestFactor.Width };
7617
7611
7618
7612
auto LegacyRUs =
7619
- CM. calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7620
- auto RUs = CM. calculateRegisterUsage (BestPlan, VFs, TTI);
7613
+ calculateRegisterUsage (getPlanFor (LegacyVF.Width ), LegacyVFs, TTI);
7614
+ auto RUs = calculateRegisterUsage (BestPlan, VFs, TTI);
7621
7615
7622
7616
auto GetMaxUsage = [](SmallMapVector<unsigned , unsigned , 4 > MaxLocalUsers) {
7623
7617
unsigned Max = 0 ;
0 commit comments