Lines Matching full: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
96 std::vector<Cluster> clusters;
119 auto res = secToCluster.try_emplace(isec, clusters.size());
122 clusters.emplace_back(clusters.size(), isec->getSize());
134 // sections. This is done because otherwise we would end up with clusters
145 clusters[to].weight += weight;
151 Cluster &toC = clusters[to];
157 for (Cluster &c : clusters)
161 // It's bad to merge clusters which would degrade the density too much.
191 // Group InputSections into clusters using the Call-Chain Clustering heuristic
192 // then sort the clusters by density.
194 std::vector<int> sorted(clusters.size());
195 std::unique_ptr<int[]> leaders(new int[clusters.size()]);
197 std::iota(leaders.get(), leaders.get() + clusters.size(), 0);
200 return clusters[a].getDensity() > clusters[b].getDensity();
205 // clusters[L] has not been merged into another cluster yet.
206 Cluster &c = clusters[l];
216 Cluster *predC = &clusters[predL];
224 mergeClusters(clusters, *predC, predL, c, l);
227 // Sort remaining non-empty clusters by density.
229 for (int i = 0, e = (int)clusters.size(); i != e; ++i)
230 if (clusters[i].size > 0)
233 return clusters[a].getDensity() > clusters[b].getDensity();
241 i = clusters[i].next;
265 i = clusters[i].next;