Lines Matching defs:clusters
73 /// * Defines when and how clusters are combined. Pick the highest weighted
87 /// * If not, then combine the clusters.
88 /// * Sort non-empty clusters by density
97 std::vector<Cluster> clusters;
120 auto res = secToCluster.try_emplace(isec, clusters.size());
123 clusters.emplace_back(clusters.size(), isec->getSize());
135 // sections. This is done because otherwise we would end up with clusters
146 clusters[to].weight += weight;
152 Cluster &toC = clusters[to];
158 for (Cluster &c : clusters)
162 // It's bad to merge clusters which would degrade the density too much.
192 // Group InputSections into clusters using the Call-Chain Clustering heuristic
193 // then sort the clusters by density.
195 std::vector<int> sorted(clusters.size());
196 std::unique_ptr<int[]> leaders(new int[clusters.size()]);
198 std::iota(leaders.get(), leaders.get() + clusters.size(), 0);
201 return clusters[a].getDensity() > clusters[b].getDensity();
206 // clusters[L] has not been merged into another cluster yet.
207 Cluster &c = clusters[l];
217 Cluster *predC = &clusters[predL];
225 mergeClusters(clusters, *predC, predL, c, l);
228 // Sort remaining non-empty clusters by density.
230 for (int i = 0, e = (int)clusters.size(); i != e; ++i)
231 if (clusters[i].size > 0)
234 return clusters[a].getDensity() > clusters[b].getDensity();
238 int curOrder = -clusters.size();
242 i = clusters[i].next;
267 i = clusters[i].next;