[PATCH] D44399: [ThinLTO] Add funtions in callees metadata to CallGraphEdges

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 12 14:17:14 PDT 2018


tejohnson added a comment.

> Without this patch, importing !callees metadata would only add promoted declarations of  @f1 and @f2 to the bar.o, but still the optimizer will assume that the function is available and perform the promotion.

I guess we end up with the declarations in the importing module (bar.o) because of the references from the callee metadata itself? Normally, we would only end up with the declarations if there was an exported reference, which would cause the exporting module (foo.o) to promote as well. So this is essentially an export of these symbols that foo.o doesn't know about. But in any case, this fix is good because we want these available for not only promotion, but inlining.

One other question below.



================
Comment at: lib/Analysis/ModuleSummaryAnalysis.cpp:300
+            if (Callee)
+              CallGraphEdges[Index.getOrInsertValueInfo(Callee)];
+          }
----------------
Do we want to give the calls a hotness other than unknown (which is the default)?


Repository:
  rL LLVM

https://reviews.llvm.org/D44399





More information about the llvm-commits mailing list