Lines Matching full:nodes
78 void BalancedPartitioning::run(std::vector<BPFunctionNode> &Nodes) const { in run()
81 "Partitioning %d nodes using depth %d and %d iterations per split\n", in run()
82 Nodes.size(), Config.SplitDepth, Config.IterationsPerSplit)); in run()
91 for (unsigned I = 0; I < Nodes.size(); I++) in run()
92 Nodes[I].InputOrderIndex = I; in run()
94 auto NodesRange = llvm::make_range(Nodes.begin(), Nodes.end()); in run()
112 void BalancedPartitioning::bisect(const FunctionNodeRange Nodes, in bisect() argument
116 unsigned NumNodes = std::distance(Nodes.begin(), Nodes.end()); in bisect()
120 llvm::sort(Nodes, [](const auto &L, const auto &R) { in bisect()
123 for (auto &N : Nodes) in bisect()
128 LLVM_DEBUG(dbgs() << format("Bisect with %d nodes and root bucket %d\n", in bisect()
137 split(Nodes, LeftBucket); in bisect()
139 runIterations(Nodes, LeftBucket, RightBucket, RNG); in bisect()
141 // Split nodes wrt the resulting buckets in bisect()
143 llvm::partition(Nodes, [&](auto &N) { return N.Bucket == LeftBucket; }); in bisect()
144 unsigned MidOffset = Offset + std::distance(Nodes.begin(), NodesMid); in bisect()
146 auto LeftNodes = llvm::make_range(Nodes.begin(), NodesMid); in bisect()
147 auto RightNodes = llvm::make_range(NodesMid, Nodes.end()); in bisect()
165 void BalancedPartitioning::runIterations(const FunctionNodeRange Nodes, in runIterations() argument
169 unsigned NumNodes = std::distance(Nodes.begin(), Nodes.end()); in runIterations()
171 for (auto &N : Nodes) in runIterations()
174 // Remove utility nodes if they have just one edge or are connected to all in runIterations()
176 for (auto &N : Nodes) in runIterations()
181 // Renumber utility nodes so they can be used to index into Signatures in runIterations()
183 for (auto &N : Nodes) in runIterations()
189 for (auto &N : Nodes) { in runIterations()
202 runIteration(Nodes, LeftBucket, RightBucket, Signatures, RNG); in runIterations()
208 unsigned BalancedPartitioning::runIteration(const FunctionNodeRange Nodes, in runIteration() argument
233 for (auto &N : Nodes) { in runIteration()
259 // Try to exchange the nodes between buckets in runIteration()
301 void BalancedPartitioning::split(const FunctionNodeRange Nodes, in split() argument
303 unsigned NumNodes = std::distance(Nodes.begin(), Nodes.end()); in split()
304 auto NodesMid = Nodes.begin() + (NumNodes + 1) / 2; in split()
306 std::nth_element(Nodes.begin(), NodesMid, Nodes.end(), [](auto &L, auto &R) { in split()
310 for (auto &N : llvm::make_range(Nodes.begin(), NodesMid)) in split()
312 for (auto &N : llvm::make_range(NodesMid, Nodes.end())) in split()