Skip to content

Commit 1482742

Browse files
Simulate backend function-import correctly by adding option -import-all-index and update test case import_callee_declaration
1 parent e658fde commit 1482742

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

llvm/test/ThinLTO/X86/import_callee_declaration.ll

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
; RUN: llvm-lto -thinlto-action=thinlink -import-declaration -import-instr-limit=7 -import-instr-evolution-factor=1.0 -o combined.index.bc main.bc lib.bc
5151
; RUN: llvm-lto -thinlto-action=distributedindexes -debug-only=function-import -import-declaration -import-instr-limit=7 -import-instr-evolution-factor=1.0 -thinlto-index combined.index.bc main.bc lib.bc 2>&1 | FileCheck %s --check-prefix=DUMP
5252

53-
; DUMP: - 2 function definitions and 3 function declarations imported from lib.bc
53+
; DUMP: - 2 function definitions and 4 function declarations imported from lib.bc
5454

5555
; First disassemble per-module summary and find out the GUID for {large_func, large_indirect_callee}.
5656
;
@@ -71,11 +71,11 @@
7171
; MAIN-DIS: gv: (guid: 2418497564662708935, summaries: (function: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), insts: 8, {{.*}})))
7272
; When alias is imported as a copy of the aliasee, but the aliasee is not being
7373
; imported by itself, the aliasee should be null.
74-
; MAIN-DIS-NOT: gv: (guid: 13590951773474913315, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: null)))
74+
; MAIN-DIS: gv: (guid: 13590951773474913315, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: null)))
7575
; MAIN-DIS: [[LARGEINDIRECT:\^[0-9]+]] = gv: (guid: 14343440786664691134, summaries: (function: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), insts: 8, {{.*}})))
7676
; MAIN-DIS: gv: (guid: 16730173943625350469, summaries: (alias: (module: [[LIBMOD]], flags: ({{.*}} importType: declaration), aliasee: [[LARGEINDIRECT]])))
7777

78-
; RUN: opt -passes=function-import -summary-file=main.bc.thinlto.bc main.bc -o main-after-import.bc
78+
; RUN: opt -passes=function-import -import-all-index -summary-file=main.bc.thinlto.bc main.bc -o main-after-import.bc
7979
; RUN: llvm-dis -o - main-after-import.bc | FileCheck %s --check-prefix=MAIN-IMPORT
8080

8181
; Tests that dso_local attribute is applied on a global var from its summary.
@@ -122,7 +122,7 @@ MAIN-IMPORT: @read_write_global_vars = external dso_local global [1 x ptr]
122122
; IMPORTDUMP-DAG: Is importing function declaration 2418497564662708935 large_func from lib.cc
123123
; IMPORTDUMP-DAG: Is importing global declaration 7680325410415171624 calleeAddrs from lib.cc
124124
; IMPORTDUMP-DAG: Is importing alias declaration 16730173943625350469 large_indirect_callee_alias from lib.cc
125-
; IMPORTDUMP-DAG: Not importing alias 13590951773474913315 large_indirect_bar_alias from lib.cc
125+
; IMPORTDUMP-DAG: Is importing alias declaration 13590951773474913315 large_indirect_bar_alias from lib.cc
126126
; IMPORTDUMP-DAG: Not importing function 13770917885399536773 large_indirect_bar
127127

128128
; RUN: llvm-dis in-process.1.3.import.bc -o - | FileCheck %s --check-prefix=IMPORT
@@ -208,11 +208,7 @@ define void @large_indirect_bar()#2 {
208208
define internal void @small_indirect_callee() #0 {
209209
entry:
210210
%0 = load ptr, ptr @calleeAddrs
211-
; The function-import pass crash (see pr/117584) when alias is imported but
212-
; aliasee isn't.
213-
; TODO: Update !prof to !3 (for @large_indirect_bar_alias) after alias/aliasee
214-
; import issue is handled.
215-
call void %0(), !prof !0
211+
call void %0(), !prof !3
216212
ret void
217213
}
218214

0 commit comments

Comments
 (0)