[llvm] [ThinLTO]Supports declaration import for global variables in distributed ThinLTO (PR #117616)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 12:26:03 PST 2024


================
@@ -67,17 +71,26 @@
 ; MAIN-DIS: gv: (guid: 2418497564662708935, summaries: (function: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), insts: 8, {{.*}})))
 ; When alias is imported as a copy of the aliasee, but the aliasee is not being
 ; imported by itself, the aliasee should be null.
-; MAIN-DIS: gv: (guid: 13590951773474913315, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: null)))
+; MAIN-DIS-NOT: gv: (guid: 13590951773474913315, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: null)))
 ; MAIN-DIS: [[LARGEINDIRECT:\^[0-9]+]] = gv: (guid: 14343440786664691134, summaries: (function: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), insts: 8, {{.*}})))
 ; MAIN-DIS: gv: (guid: 16730173943625350469, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: [[LARGEINDIRECT]])))
 
+; RUN: opt -passes=function-import -summary-file=main.bc.thinlto.bc main.bc -o main-after-import.bc
----------------
teresajohnson wrote:

Are you trying to simulate a distributed ThinLTO backend? Add "-import-all-index" to the invocation, so that we don't try to recompute the import decisions which isn't what you want to do. This should fix the alias issue mentioned further below.

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


More information about the llvm-commits mailing list