[llvm] [ThinLTO]Record import type in GlobalValueSummary::GVFlags (PR #87597)

Jan Voung via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 10:08:44 PDT 2024


================
@@ -737,6 +737,7 @@ lltok::Kind LLLexer::LexIdentifier() {
   KEYWORD(live);
   KEYWORD(dsoLocal);
   KEYWORD(canAutoHide);
+  KEYWORD(importAsDec);
----------------
jvoung wrote:

For the summary import case, I'm mostly looking at direct call cases, so the importing module does have a declaration already, but the declaration doesn't have the attributes that the source module has (inferred from the definition and possibly transitively from callees definitions), so the summary helps update the decl [e.g., in thinLTOFinalizeInModule](https://github.com/llvm/llvm-project/blob/3009228a09dbfe04e0911fc19813ec72d389bc45/llvm/lib/Transforms/IPO/FunctionImport.cpp#L1415)

One could also mark it as a declaration import, but we'd want it to overwrite instead of no-op.

Other pros / cons for import summary vs import decl in earlier comment but happy to elaborate more or if more data is needed. Thanks!



https://github.com/llvm/llvm-project/pull/87597


More information about the llvm-commits mailing list