[PATCH] D42311: [SyntheticCounts] Rewrite the code using only graph traits.
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 10:00:28 PST 2018
davidxl added inline comments.
================
Comment at: include/llvm/Analysis/CallGraph.h:541
+
+ static CallEdgeIteratorType call_edge_begin(NodeRef N) { return N->begin(); }
+ static CallEdgeIteratorType call_edge_end(NodeRef N) { return N->end(); }
----------------
use 'child_begin()/child_end()'?
================
Comment at: include/llvm/Analysis/CallGraph.h:546
+
+ static bool has_function_def(NodeRef N) {
+ return N->getFunction() != nullptr && !N->getFunction()->isDeclaration();
----------------
Is it better to push this method into the base class ( template<> GraphTraits<Callgraph*> )?
================
Comment at: include/llvm/Analysis/SyntheticCountsUtils.h:31
+/// ThinLTO. This contains only static methods and alias templates.
+template <typename CallGraphType> class SyntheticCountsUtils {
+public:
----------------
nit: I suggest not using 'Utils' in the name. Also the profile propagation engine will be used for partial profile case as well, so it is not completely Synthetic. May be just call it 'ProfileCountProp' or ProfCountPropagator'
Repository:
rL LLVM
https://reviews.llvm.org/D42311
More information about the llvm-commits
mailing list