[llvm-dev] [ThinLTO] Suggestions on how to traverse SCCs in the Module Summary Index bottom up

Charles Saternos via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 9 07:21:48 PDT 2017


Hey all,

I'm working on adding function attribute propagation to function summaries
in the ThinLTO index, and have run into some trouble with ensuring
bottom-up traversal when finding the SCCs in the call graph.

I'm basing my implementation for the GraphTraits for the ModuleSummaryIndex
off the GraphTraits<CallGraph *> implementation (
http://llvm-cs.pcc.me.uk/include/llvm/Analysis/CallGraph.h#407). In the
GraphTrait<CallGraph *> definition, the getEntryNode function returns the
external calling node (
http://llvm-cs.pcc.me.uk/include/llvm/Analysis/CallGraph.h#450), which I
assume is supposed to be at the bottom of the callgraph. Would doing same
for the ModuleSummaryIndex ensure the scc_iterator traverses bottom up (if
that even makes sense)?

Rather than returning a dummy FunctionSummary that's empty for external
functions (which is what I'm doing right now), would it make more sense to
have one node that represents all external FunctionSummaries? If I used
this FunctionSummary as the entry point for the scc_iterator traversal of
the ModuleSummaryIndex callgraph would the traversal be bottom up?

Here's my patch in its current state: https://reviews.llvm.org/D36311

Thanks,
Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170809/df55c67a/attachment.html>


More information about the llvm-dev mailing list