liberty/lib/Orchestration/DSWPCritic.cpp
// find the one with largest weight and free-standing node
// FIXME: this is super inefficient
find the one with largest weight and free-standing node
FIXME: this is super inefficient
find the one with largest weight and free - standing node FIXME : this is super inefficient
SCC *DSWPCritic::getNextLargestFreeStandingSCC(
    SCCDAG &sccdag, std::map<unsigned, unsigned> &incomingCountMap) {
  double largestWeight = -1;
  auto largestIdx = -1;
  SCC *largestSCC = nullptr;
  LLVM_DEBUG(printIncomingCountMap(incomingCountMap));
  for (auto *scc : sccdag.getSCCs()) {
    auto idx = sccdag.getSCCIndex(scc);
    if (incomingCountMap[idx] != 0)
      continue;
    auto weight = getWeight(scc);
    if (weight > largestWeight) {
      largestWeight = weight;
      largestIdx = idx;
      largestSCC = scc;
    }
  }
  return largestSCC;
}
SCC * DSWPCritic :: getNextLargestFreeStandingSCC ( SCCDAG & sccdag , std :: map < unsigned , unsigned > & incomingCountMap ) { double largestWeight = -1 ; auto largestIdx = -1 ; SCC * largestSCC = nullptr ; LLVM_DEBUG ( printIncomingCountMap ( incomingCountMap ) ) ; for ( auto * scc : sccdag . getSCCs ( ) ) { auto idx = sccdag . getSCCIndex ( scc ) ; if ( incomingCountMap [ idx ] != 0 ) continue ; auto weight = getWeight ( scc ) ; if ( weight > largestWeight ) { largestWeight = weight ; largestIdx = idx ; largestSCC = scc ; } } return largestSCC ; }
find the one with largest weight and free-standing node
FIXME: this is super inefficient
find the one with largest weight and free - standing node FIXME : this is super inefficient
// free-standing node // get largest weight