tejohnson added a comment.

I just noticed that generateParamAccessSummary is taking a bit over 5% of the 
ThinLTO thin link step in an internal build (and will soon be more than 5% as I 
found another analysis that is hogging compile time that I'm going to work on 
fixing). This is currently the second hottest analysis in the thin link. Is the 
stack safety analysis meant to be always on with ThinLTO?

I have a theory on what is causing it to incur so much overhead, see below.



================
Comment at: llvm/lib/Analysis/StackSafetyAnalysis.cpp:913
+            FunctionSummary *S = resolveCallee(
+                Index.findSummaryInModule(Call.Callee, FS->modulePath()));
+            if (!S) {
----------------
This is doing a hash table lookup by GUID in the combined index. Can the Callee 
field be changed to hold the ValueInfo instead of the GUID? Calling 
findSummaryInModule on a ValueInfo avoids the hash table lookup. E.g. see how 
we compute the Ref edges in ModuleSummaryAnalysis.cpp (i.e. via 
getOrInsertValueInfo), and then propagate that through the bitcode.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81242/new/

https://reviews.llvm.org/D81242

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to