[PATCH] D36311: [ThinLTO] Add GraphTraits for FunctionSummaries

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 12:07:55 PDT 2017


tejohnson added a comment.

In https://reviews.llvm.org/D36311#834662, @ncharlie wrote:

> How should I test this and ensure it's working properly?


Maybe add an scc dumper facility for the module summary graph, which creates an scc_iterator from the module summary and just dumps the nodes in each scc, that can be checked using a Lit based test



================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:838
+    // (since scc_iterator doesn't accept nullptrs)
+    auto F = llvm::make_unique<FunctionSummary>(
+        FunctionSummary::GVFlags(
----------------
ncharlie wrote:
> This is causing problems. The scc_iterator gets stuck on these functionsummaries since they're not in the original graph, which causes it to terminate before going through all the SCCs in the summary callgraph.
In what way does it get stuck? The CallGraph.h has a dedicated CallsExternalNode for calls to external functions, but it seems like you are doing something similar here with a static ExternalFunction.


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:28
 #include "llvm/IR/Module.h"
+#include "llvm/Transforms/IPO/FunctionAttrs.h"
 #include <algorithm>
----------------
Not needed in this patch?


https://reviews.llvm.org/D36311





More information about the llvm-commits mailing list