liberty/lib/Orchestration/DSWPCritic.cpp
// cached implementation of get SCC weight
cached implementation of get SCC weight
cached implementation of get SCC weight
double DSWPCritic::getWeight(SCC *scc) {
  if (weightCache.find(scc) != weightCache.end())
    return weightCache[scc];
  double sumWeight = 0.0;
  for (auto instPair : scc->internalNodePairs()) {
    Instruction *inst = dyn_cast<Instruction>(instPair.first);
    assert(inst);
    sumWeight += perf->estimate_weight(inst);
  }
  sumWeight *= FIXED_POINT;
  weightCache[scc] = sumWeight;
  return sumWeight;
}
double DSWPCritic :: getWeight ( SCC * scc ) { if ( weightCache . find ( scc ) != weightCache . end ( ) ) return weightCache [ scc ] ; double sumWeight = 0.0 ; for ( auto instPair : scc -> internalNodePairs ( ) ) { Instruction * inst = dyn_cast < Instruction > ( instPair . first ) ; assert ( inst ) ; sumWeight += perf -> estimate_weight ( inst ) ; } sumWeight *= FIXED_POINT ; weightCache [ scc ] = sumWeight ; return sumWeight ; }
cached implementation of get SCC weight
cached implementation of get SCC weight