Skip to content

Commit 54cc882

Browse files
committed
fix the test
1 parent 483e157 commit 54cc882

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

llvm/lib/Transforms/IPO/FunctionImport.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ class WorkloadImportsManager : public ModuleImportsManager {
468468
llvm::make_filter_range(
469469
Candidates,
470470
[&](const auto &Candidate) {
471+
LLVM_DEBUG(dbgs() << "[Workflow] Candidate for " << VI.name()
472+
<< " from " << Candidate.second->modulePath()
473+
<< " ImportFailureReason: "
474+
<< getFailureName(Candidate.first) << "\n");
471475
return Candidate.first ==
472476
FunctionImporter::ImportFailureReason::None;
473477
}),

llvm/test/ThinLTO/X86/workload.ll

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ define dso_local void @m2_f1() {
4444

4545
@m2_f1_alias = alias void (...), ptr @m2_f1
4646

47-
define linkonce void @interposable_f() {
47+
define weak void @interposable_f() {
4848
call void @m2_variant()
4949
ret void
5050
}
5151

52-
define external void @noninterposable_f() {
52+
define linkonce_odr void @noninterposable_f() {
5353
call void @m2_variant()
5454
ret void
5555
}
@@ -94,15 +94,17 @@ define dso_local void @m3_f1() {
9494
;
9595
; The run with workload definitions - same other options.
9696
;
97-
; RUN: echo '{"m1_f1":["m1_f1", "m2_f1", "m2_f1_alias", "interposable_f", "noninterposable_f"], \
98-
; RUN: "m2_f1":["m1_f1", "m1_f2", "interposable_f"]}' > %t_exp/workload_defs.json
97+
; RUN: echo '{ \
98+
; RUN: "m1_f1": ["m1_f1", "m2_f1", "m2_f1_alias", "interposable_f", "noninterposable_f"], \
99+
; RUN: "m2_f1": ["m1_f1", "m1_f2", "interposable_f"] \
100+
; RUN: }' > %t_exp/workload_defs.json
99101
;
100102
; RUN: llvm-lto2 run %t/m1.bc %t/m2.bc %t/m3.bc \
101103
; RUN: -o %t_exp/result.o -save-temps \
102104
; RUN: -thinlto-workload-def=%t_exp/workload_defs.json \
103105
; RUN: -r %t/m1.bc,m1_f1,plx \
104106
; RUN: -r %t/m1.bc,interposable_f,p \
105-
; RUN: -r %t/m1.bc,noninterposable_f,p \
107+
; RUN: -r %t/m1.bc,noninterposable_f \
106108
; RUN: -r %t/m1.bc,m1_variant \
107109
; RUN: -r %t/m1.bc,m2_f1_alias \
108110
; RUN: -r %t/m2.bc,m2_f1,plx \
@@ -126,15 +128,26 @@ define dso_local void @m3_f1() {
126128
;
127129
; FIRST-LABEL: @m1_f1
128130
; FIRST-LABEL: @m1_f2.llvm.0
131+
;
132+
; @interposable_f is prevailing in m1, so it won't be imported
129133
; FIRST-LABEL: define void @interposable_f
130134
; FIRST-NEXT: call void @m1_variant
135+
;
131136
; FIRST-LABEL: @m2_f1
137+
;
138+
; @noninterposable_f is prevailing in m2 so it will be imported from there.
132139
; FIRST-LABEL: define available_externally void @noninterposable_f
133140
; FIRST-NEXT: call void @m2_variant
141+
;
134142
; FIRST-LABEL: define available_externally void @m2_f1_alias
135143
; SECOND-LABEL: @m2_f1
144+
;
145+
; SECOND-LABEL: define weak_odr void @noninterposable_f
146+
; SECOND-NEXT: call void @m2_variant()
136147
; SECOND-LABEL: @m1_f1
137148
; SECOND-LABEL: define available_externally hidden void @m1_f2.llvm.0
149+
;
150+
; we import @interposable_f from m1, the prevailing variant.
138151
; SECOND-LABEL: define available_externally void @interposable_f
139152
; SECOND-NEXT: call void @m1_variant
140153
; THIRD-LABEL: define available_externally void @m1_f1

0 commit comments

Comments
 (0)