[llvm] r320905 - [LTO] Make processing of combined module more consistent
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 15 18:10:01 PST 2017
Author: vitalybuka
Date: Fri Dec 15 18:10:00 2017
New Revision: 320905
URL: http://llvm.org/viewvc/llvm-project?rev=320905&view=rev
Log:
[LTO] Make processing of combined module more consistent
Summary:
1. Use stream 0 only for combined module. Previously if combined module was not
processes ThinLTO used the stream for own output. However small changes in input,
could trigger combined module and shuffle outputs making life of llvm::LTO harder.
2. Always process combined module and write output to stream 0. Processing empty
combined module is cheap and allows llvm::LTO users to avoid implementing processing
which is already done in llvm::LTO.
Subscribers: mehdi_amini, inglorion, eraman, hiraditya
Differential Revision: https://reviews.llvm.org/D41267
Added:
llvm/trunk/test/ThinLTO/X86/empty-module.ll
Modified:
llvm/trunk/include/llvm/LTO/LTO.h
llvm/trunk/lib/LTO/LTO.cpp
llvm/trunk/test/LTO/Resolution/X86/dead-strip-alias.ll
llvm/trunk/test/LTO/Resolution/X86/ifunc.ll
llvm/trunk/test/LTO/Resolution/X86/linker-redef-thin.ll
llvm/trunk/test/LTO/Resolution/X86/linkonce.ll
llvm/trunk/test/LTO/Resolution/X86/load-sample-prof-icp.ll
llvm/trunk/test/LTO/Resolution/X86/load-sample-prof.ll
llvm/trunk/test/LTO/Resolution/X86/mod-asm-used.ll
llvm/trunk/test/ThinLTO/X86/deadstrip.ll
llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll
llvm/trunk/test/ThinLTO/X86/distributed_import.ll
llvm/trunk/test/ThinLTO/X86/funcimport2.ll
llvm/trunk/test/ThinLTO/X86/internalize.ll
llvm/trunk/test/ThinLTO/X86/module_asm2.ll
llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll
llvm/trunk/test/ThinLTO/X86/personality-local.ll
llvm/trunk/test/ThinLTO/X86/personality.ll
llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll
llvm/trunk/test/Transforms/FunctionImport/funcimport_var.ll
llvm/trunk/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll
llvm/trunk/test/tools/gold/X86/thinlto.ll
Modified: llvm/trunk/include/llvm/LTO/LTO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/LTO/LTO.h?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/include/llvm/LTO/LTO.h (original)
+++ llvm/trunk/include/llvm/LTO/LTO.h Fri Dec 15 18:10:00 2017
@@ -371,8 +371,7 @@ private:
const SymbolResolution *&ResI, const SymbolResolution *ResE);
Error runRegularLTO(AddStreamFn AddStream);
- Error runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
- bool HasRegularLTO);
+ Error runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache);
mutable bool CalledGetMaxTasks = false;
};
Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Fri Dec 15 18:10:00 2017
@@ -385,7 +385,8 @@ StringRef InputFile::getName() const {
LTO::RegularLTOState::RegularLTOState(unsigned ParallelCodeGenParallelismLevel,
Config &Conf)
: ParallelCodeGenParallelismLevel(ParallelCodeGenParallelismLevel),
- Ctx(Conf) {}
+ Ctx(Conf), CombinedModule(llvm::make_unique<Module>("ld-temp.o", Ctx)),
+ Mover(llvm::make_unique<IRMover>(*CombinedModule)) {}
LTO::ThinLTOState::ThinLTOState(ThinBackend Backend) : Backend(Backend) {
if (!Backend)
@@ -472,6 +473,9 @@ Error LTO::add(std::unique_ptr<InputFile
if (Conf.ResolutionFile)
writeToResolutionFile(*Conf.ResolutionFile, Input.get(), Res);
+ if (RegularLTO.CombinedModule->getTargetTriple().empty())
+ RegularLTO.CombinedModule->setTargetTriple(Input->getTargetTriple());
+
const SymbolResolution *ResI = Res.begin();
for (unsigned I = 0; I != Input->Mods.size(); ++I)
if (Error Err = addModule(*Input, I, ResI, Res.end()))
@@ -659,12 +663,6 @@ LTO::addRegularLTO(BitcodeModule BM, Arr
Error LTO::linkRegularLTO(RegularLTOState::AddedModule Mod,
bool LivenessFromIndex) {
- if (!RegularLTO.CombinedModule) {
- RegularLTO.CombinedModule =
- llvm::make_unique<Module>("ld-temp.o", RegularLTO.Ctx);
- RegularLTO.Mover = llvm::make_unique<IRMover>(*RegularLTO.CombinedModule);
- }
-
std::vector<GlobalValue *> Keep;
for (GlobalValue *GV : Mod.Keep) {
if (LivenessFromIndex && !ThinLTO.CombinedIndex.isGUIDLive(GV->getGUID()))
@@ -757,16 +755,9 @@ Error LTO::run(AddStreamFn AddStream, Na
computeDeadSymbols(ThinLTO.CombinedIndex, GUIDPreservedSymbols);
- // Save the status of having a regularLTO combined module, as
- // this is needed for generating the ThinLTO Task ID, and
- // the CombinedModule will be moved at the end of runRegularLTO.
- bool HasRegularLTO = RegularLTO.CombinedModule != nullptr ||
- !RegularLTO.ModsWithSummaries.empty();
- // Invoke regular LTO if there was a regular LTO module to start with.
- if (HasRegularLTO)
- if (auto E = runRegularLTO(AddStream))
- return E;
- return runThinLTO(AddStream, Cache, HasRegularLTO);
+ if (auto E = runRegularLTO(AddStream))
+ return E;
+ return runThinLTO(AddStream, Cache);
}
Error LTO::runRegularLTO(AddStreamFn AddStream) {
@@ -1081,8 +1072,7 @@ ThinBackend lto::createWriteIndexesThinB
};
}
-Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache,
- bool HasRegularLTO) {
+Error LTO::runThinLTO(AddStreamFn AddStream, NativeObjectCache Cache) {
if (ThinLTO.ModuleMap.empty())
return Error::success();
@@ -1167,11 +1157,9 @@ Error LTO::runThinLTO(AddStreamFn AddStr
ThinLTO.Backend(Conf, ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
AddStream, Cache);
- // Task numbers start at ParallelCodeGenParallelismLevel if an LTO
- // module is present, as tasks 0 through ParallelCodeGenParallelismLevel-1
- // are reserved for parallel code generation partitions.
- unsigned Task =
- HasRegularLTO ? RegularLTO.ParallelCodeGenParallelismLevel : 0;
+ // Tasks 0 through ParallelCodeGenParallelismLevel-1 are reserved for combined
+ // module and parallel code generation partitions.
+ unsigned Task = RegularLTO.ParallelCodeGenParallelismLevel;
for (auto &Mod : ThinLTO.ModuleMap) {
if (Error E = BackendProc->start(Task, Mod.second, ImportLists[Mod.first],
ExportLists[Mod.first],
Modified: llvm/trunk/test/LTO/Resolution/X86/dead-strip-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/dead-strip-alias.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/dead-strip-alias.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/dead-strip-alias.ll Fri Dec 15 18:10:00 2017
@@ -3,7 +3,7 @@
; RUN: llvm-lto2 run %t -r %t,main,px -r %t,alias,p -r %t,external, \
; RUN: %t2 -r %t2,external,p \
; RUN: -save-temps -o %t3
-; RUN: llvm-nm %t3.1 | FileCheck %s
+; RUN: llvm-nm %t3.2 | FileCheck %s
; CHECK: D external
Modified: llvm/trunk/test/LTO/Resolution/X86/ifunc.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/ifunc.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/ifunc.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/ifunc.ll Fri Dec 15 18:10:00 2017
@@ -1,6 +1,6 @@
; RUN: opt -module-summary -o %t.bc %s
; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,pl -o %t2
-; RUN: llvm-nm %t2.0 | FileCheck %s
+; RUN: llvm-nm %t2.1 | FileCheck %s
; CHECK: T foo
; CHECK: t foo_ifunc
Modified: llvm/trunk/test/LTO/Resolution/X86/linker-redef-thin.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/linker-redef-thin.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/linker-redef-thin.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/linker-redef-thin.ll Fri Dec 15 18:10:00 2017
@@ -1,6 +1,6 @@
; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-lto2 run -o %t1.o %t.o -r %t.o,patatino,pr
-; RUN: llvm-readobj -t %t1.o.0 | FileCheck %s
+; RUN: llvm-readobj -t %t1.o.1 | FileCheck %s
; CHECK: Name: patatino
; CHECK-NEXT: Value:
Modified: llvm/trunk/test/LTO/Resolution/X86/linkonce.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/linkonce.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/linkonce.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/linkonce.ll Fri Dec 15 18:10:00 2017
@@ -1,6 +1,6 @@
; RUN: opt -module-summary -o %t %s
; RUN: llvm-lto2 run %t -O0 -r %t,foo,px -o %t2
-; RUN: llvm-nm %t2.0 | FileCheck %s
+; RUN: llvm-nm %t2.1 | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Modified: llvm/trunk/test/LTO/Resolution/X86/load-sample-prof-icp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/load-sample-prof-icp.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/load-sample-prof-icp.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/load-sample-prof-icp.ll Fri Dec 15 18:10:00 2017
@@ -5,11 +5,11 @@
; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \
; RUN: -r %t.bc,test,px -r %t.bc,bar,x \
; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof
-; RUN: llvm-dis %t.out.0.4.opt.bc -o - | FileCheck %s
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s
; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \
; RUN: -r %t.bc,test,px -r %t.bc,bar,x -use-new-pm \
; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof-icp.prof
-; RUN: llvm-dis %t.out.0.4.opt.bc -o - | FileCheck %s
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Modified: llvm/trunk/test/LTO/Resolution/X86/load-sample-prof.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/load-sample-prof.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/load-sample-prof.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/load-sample-prof.ll Fri Dec 15 18:10:00 2017
@@ -4,7 +4,7 @@
; RUN: llvm-lto2 run -o %t.out %t.bc -save-temps \
; RUN: -r %t.bc,foo,px -r %t.bc,bar,x \
; RUN: -lto-sample-profile-file=%S/Inputs/load-sample-prof.prof
-; RUN: llvm-dis %t.out.0.4.opt.bc -o - | FileCheck %s
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s
;
; CHECK: !prof
Modified: llvm/trunk/test/LTO/Resolution/X86/mod-asm-used.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/Resolution/X86/mod-asm-used.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/LTO/Resolution/X86/mod-asm-used.ll (original)
+++ llvm/trunk/test/LTO/Resolution/X86/mod-asm-used.ll Fri Dec 15 18:10:00 2017
@@ -1,7 +1,7 @@
; RUN: opt -module-summary -o %t.bc %s
; RUN: opt -module-summary -o %t2.bc %S/Inputs/mod-asm-used.ll
; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,l %t2.bc -r %t2.bc,foo,pl -o %t3
-; RUN: llvm-nm %t3.1 | FileCheck %s
+; RUN: llvm-nm %t3.* | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Modified: llvm/trunk/test/ThinLTO/X86/deadstrip.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/deadstrip.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/deadstrip.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/deadstrip.ll Fri Dec 15 18:10:00 2017
@@ -19,7 +19,7 @@
; RUN: -r %t2.bc,_dead_func,l \
; RUN: -r %t2.bc,_another_dead_func,pl
; RUN: llvm-dis < %t.out.0.3.import.bc | FileCheck %s --check-prefix=LTO2
-; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2
+; RUN: llvm-dis < %t.out.2.3.import.bc | FileCheck %s --check-prefix=LTO2-CHECK2
; RUN: llvm-nm %t.out.1 | FileCheck %s --check-prefix=CHECK2-NM
; RUN: llvm-bcanalyzer -dump %t.out.index.bc | FileCheck %s --check-prefix=COMBINED
Modified: llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/debuginfo-compositetype-import.ll Fri Dec 15 18:10:00 2017
@@ -11,7 +11,7 @@
; RUN: -r %t2.bc,main,plx \
; RUN: -r %t2.bc,foo,l \
; RUN: -r %t1.bc,foo,pl
-; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s
+; RUN: llvm-dis < %t.out.2.3.import.bc | FileCheck %s
; CHECK: distinct !DICompositeType(tag: DW_TAG_enumeration_type, name: "enum", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 50, size: 32, flags: DIFlagFwdDecl, identifier: "enum")
; CHECK: distinct !DICompositeType(tag: DW_TAG_class_type, name: "class", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 728, size: 448, flags: DIFlagFwdDecl, identifier: "class")
@@ -25,7 +25,7 @@
; RUN: -r %t2.bc,main,plx \
; RUN: -r %t2.bc,foo,l \
; RUN: -r %t1.bc,foo,pl
-; RUN: llvm-dis < %t.out.1.3.import.bc | FileCheck %s --check-prefix=FULL
+; RUN: llvm-dis < %t.out.2.3.import.bc | FileCheck %s --check-prefix=FULL
; FULL: distinct !DICompositeType(tag: DW_TAG_enumeration_type, name: "enum", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 50, size: 32, elements: !{{[0-9]+}}, identifier: "enum")
; FULL: distinct !DICompositeType(tag: DW_TAG_class_type, name: "class", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 728, size: 448, elements: !{{[0-9]+}}, identifier: "class")
Modified: llvm/trunk/test/ThinLTO/X86/distributed_import.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/distributed_import.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/distributed_import.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/distributed_import.ll Fri Dec 15 18:10:00 2017
@@ -58,6 +58,7 @@
; IMPORT: define available_externally void @analias() !thinlto_src_module
; EXPORT: @G.llvm.
+target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
declare i32 @g(...)
Added: llvm/trunk/test/ThinLTO/X86/empty-module.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/empty-module.ll?rev=320905&view=auto
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/empty-module.ll (added)
+++ llvm/trunk/test/ThinLTO/X86/empty-module.ll Fri Dec 15 18:10:00 2017
@@ -0,0 +1,18 @@
+; RUN: opt -module-summary -o %t.bc %s
+
+; RUN: rm -f %t2.0
+; RUN: llvm-lto2 run %t.bc -r %t.bc,foo,pl -o %t2 -thinlto-distributed-indexes
+; RUN: llvm-readobj -h %t2.0 | FileCheck %s
+; RUN: llvm-nm %t2.0 | count 0
+
+; CHECK: Format: ELF64-x86-64
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at foo = ifunc i32 (i32), i64 ()* @foo_ifunc
+
+define internal i64 @foo_ifunc() {
+entry:
+ ret i64 0
+}
Modified: llvm/trunk/test/ThinLTO/X86/funcimport2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/funcimport2.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/funcimport2.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/funcimport2.ll Fri Dec 15 18:10:00 2017
@@ -6,7 +6,7 @@
; RUN: -r=%t1.bc,_foo,plx \
; RUN: -r=%t2.bc,_main,plx \
; RUN: -r=%t2.bc,_foo,l
-; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s
+; RUN: llvm-dis %t.o.2.3.import.bc -o - | FileCheck %s
; CHECK: define available_externally dso_local void @foo()
; We shouldn't do any importing at -O0
@@ -16,7 +16,7 @@
; RUN: -r=%t1.bc,_foo,plx \
; RUN: -r=%t2.bc,_main,plx \
; RUN: -r=%t2.bc,_foo,l
-; RUN: llvm-dis %t.o.1.3.import.bc -o - | FileCheck %s --check-prefix=CHECKO0
+; RUN: llvm-dis %t.o.2.3.import.bc -o - | FileCheck %s --check-prefix=CHECKO0
; CHECKO0: declare dso_local void @foo(...)
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
Modified: llvm/trunk/test/ThinLTO/X86/internalize.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/internalize.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/internalize.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/internalize.ll Fri Dec 15 18:10:00 2017
@@ -7,7 +7,7 @@
; RUN: -r=%t1.bc,_foo,pxl \
; RUN: -r=%t1.bc,_bar,pl \
; RUN: -r=%t1.bc,_linkonce_func,pl
-; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE2
+; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE2
; REGULAR: define void @foo
Modified: llvm/trunk/test/ThinLTO/X86/module_asm2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/module_asm2.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/module_asm2.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/module_asm2.ll Fri Dec 15 18:10:00 2017
@@ -27,8 +27,8 @@
; RUN: -r=%t2.bc,func3,l \
; RUN: -r=%t2.bc,callglobalfunc,l \
; RUN: -r=%t2.bc,callweakfunc,l
-; RUN: llvm-nm %t.o.0 | FileCheck %s --check-prefix=NM0
-; RUN: llvm-nm %t.o.1 | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm %t.o.1 | FileCheck %s --check-prefix=NM0
+; RUN: llvm-nm %t.o.2 | FileCheck %s --check-prefix=NM1
; Check that local values b and x, which are referenced on
; llvm.used and llvm.compiler.used, respectively, are not promoted.
Modified: llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/module_asm_glob.ll Fri Dec 15 18:10:00 2017
@@ -11,8 +11,8 @@
; RUN: -r=%t1.bc,_simplefunction,pl \
; RUN: -r=%t2.bc,main,plx \
; RUN: -r=%t2.bc,_simplefunction,l
-; RUN: llvm-nm %t.o.0 | FileCheck %s --check-prefix=NM0
-; RUN: llvm-nm %t.o.1 | FileCheck %s --check-prefix=NM1
+; RUN: llvm-nm %t.o.1 | FileCheck %s --check-prefix=NM0
+; RUN: llvm-nm %t.o.2 | FileCheck %s --check-prefix=NM1
; NM0: T foo
; NM1-NOT: foo
Modified: llvm/trunk/test/ThinLTO/X86/personality-local.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/personality-local.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/personality-local.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/personality-local.ll Fri Dec 15 18:10:00 2017
@@ -6,7 +6,7 @@
; RUN: -r %t1.bc,foo,l \
; RUN: -r %t1.bc,bar,p \
; RUN: -r %t1.bc,main,xp
-; RUN: llvm-readobj -t %t.o.1 | FileCheck %s
+; RUN: llvm-readobj -t %t.o.2 | FileCheck %s
; CHECK: Symbol {
; CHECK: Name: foo
Modified: llvm/trunk/test/ThinLTO/X86/personality.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/personality.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/personality.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/personality.ll Fri Dec 15 18:10:00 2017
@@ -14,7 +14,7 @@
; RUN: -r %t1.bc,personality_routine3,l \
; RUN: -r %t1.bc,main,xp \
; RUN: -r %t1.bc,bar,l
-; RUN: llvm-readobj -t %t.o.1 | FileCheck %s --check-prefix=BINDING
+; RUN: llvm-readobj -t %t.o.2 | FileCheck %s --check-prefix=BINDING
; BINDING: Symbol {
; BINDING: Name: personality_routine
Modified: llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/reference_non_importable.ll Fri Dec 15 18:10:00 2017
@@ -14,14 +14,14 @@ target datalayout = "e-m:o-i64:64-f80:12
target triple = "x86_64-apple-macosx10.11.0"
; We shouldn't promote the private because it has a section
-; RUN: llvm-dis < %t.o.0.2.internalize.bc | FileCheck %s --check-prefix=PROMOTE
+; RUN: llvm-dis < %t.o.1.2.internalize.bc | FileCheck %s --check-prefix=PROMOTE
; PROMOTE: @a = private global i8 0, section "__TEXT,__cstring,cstring_literals"
@a = private global i8 0, section "__TEXT,__cstring,cstring_literals"
@b = global i8 *@a
; We want foo to be imported in the main module!
-; RUN: llvm-dis < %t.o.1.3.import.bc | FileCheck %s --check-prefix=IMPORT
+; RUN: llvm-dis < %t.o.2.3.import.bc | FileCheck %s --check-prefix=IMPORT
; IMPORT: define available_externally dso_local i8** @foo()
define i8 **@foo() {
ret i8 **@b
Modified: llvm/trunk/test/Transforms/FunctionImport/funcimport_var.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/funcimport_var.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/funcimport_var.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/funcimport_var.ll Fri Dec 15 18:10:00 2017
@@ -10,7 +10,7 @@
; RUN: -r %t.bc,_Z4LinkPKcS0_,plx \
; RUN: -r %t.bc,link,l \
; RUN: -r %t2.bc,get_link,plx
-; RUN: llvm-nm %t.out.0 | FileCheck %s
+; RUN: llvm-nm %t.out.1 | FileCheck %s
; CHECK: U link
; REQUIRES: x86-registered-target
Modified: llvm/trunk/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll (original)
+++ llvm/trunk/test/Transforms/PGOProfile/thinlto_samplepgo_icp2.ll Fri Dec 15 18:10:00 2017
@@ -21,7 +21,7 @@
; IMPORTS2-NOT: Import _ZL3barv
; RUN: llvm-nm %t3.2 | FileCheck %s --check-prefix=NM
; NM: _ZL3barv
-; RUN: llvm-dis < %t3.2.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE
+; RUN: llvm-dis < %t3.3.2.internalize.bc | FileCheck %s --check-prefix=INTERNALIZE
; INTERNALIZE: define dso_local void @_ZL3barv
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
Modified: llvm/trunk/test/tools/gold/X86/thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/thinlto.ll?rev=320905&r1=320904&r2=320905&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/thinlto.ll (original)
+++ llvm/trunk/test/tools/gold/X86/thinlto.ll Fri Dec 15 18:10:00 2017
@@ -68,11 +68,24 @@
; RUN: --plugin-opt=jobs=2 \
; RUN: --plugin-opt=obj-path=%t5.o \
; RUN: -shared %t.o %t2.o -o %t4
-; RUN: llvm-nm %t5.o | FileCheck %s --check-prefix=NM2
; RUN: llvm-nm %t5.o1 | FileCheck %s --check-prefix=NM2
+; RUN: llvm-nm %t5.o2 | FileCheck %s --check-prefix=NM2
+
+; Test to ensure that thinlto-index-only with obj-path creates the file.
+; RUN: rm -f %t5.o %t5.o1
+; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
+; RUN: -m elf_x86_64 \
+; RUN: --plugin-opt=thinlto \
+; RUN: --plugin-opt=jobs=2 \
+; RUN: --plugin-opt=thinlto-index-only \
+; RUN: --plugin-opt=obj-path=%t5.o \
+; RUN: -shared %t.o %t2.o -o %t4
+; RUN: llvm-readobj -h %t5.o | FileCheck %s --check-prefix=FORMAT
+; RUN: llvm-nm %t5.o | count 0
; NM: T f
; NM2: T {{f|g}}
+; FORMAT: Format: ELF64-x86-64
; The backend index for this module contains summaries from itself and
; Inputs/thinlto.ll, as it imports from the latter.
More information about the llvm-commits
mailing list