Lines Matching +full:un +full:-

1 //===- BalancedPartitioning.cpp -------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
21 #define DEBUG_TYPE "balanced-partitioning"
38 if (--NumActiveThreads == 0) {
72 // Pre-computing log2 values
99 TP->async(std::move(BisectTask));
100 TP->wait();
157 TP->async(std::move(LeftRecTask));
158 TP->async(std::move(RightRecTask));
172 for (auto &UN : N.UtilityNodes)
173 ++UtilityNodeIndex[UN];
177 llvm::erase_if(N.UtilityNodes, [&](auto &UN) {
178 return UtilityNodeIndex[UN] == 1 || UtilityNodeIndex[UN] == NumNodes;
184 for (auto &UN : N.UtilityNodes)
185 UN = UtilityNodeIndex.insert({UN, UtilityNodeIndex.size()}).first->second;
190 for (auto &UN : N.UtilityNodes) {
191 assert(UN < Signatures.size());
193 Signatures[UN].LeftCount++;
195 Signatures[UN].RightCount++;
224 Signature.CachedGainLR = Cost - logCost(L - 1, R + 1);
226 Signature.CachedGainRL = Cost - logCost(L + 1, R - 1);
241 Gains, [&](const auto &GP) { return GP.second->Bucket == LeftBucket; });
284 for (auto &UN : N.UtilityNodes) {
285 auto &Signature = Signatures[UN];
286 Signature.LeftCount--;
291 for (auto &UN : N.UtilityNodes) {
292 auto &Signature = Signatures[UN];
294 Signature.RightCount--;
320 for (auto &UN : N.UtilityNodes)
321 Gain += (FromLeftToRight ? Signatures[UN].CachedGainLR
322 : Signatures[UN].CachedGainRL);
327 return -(X * log2Cached(X + 1) + Y * log2Cached(Y + 1));