[llvm] r266131 - Move summary creation out of llvm-as into opt
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 12 14:35:19 PDT 2016
Author: mehdi_amini
Date: Tue Apr 12 16:35:18 2016
New Revision: 266131
URL: http://llvm.org/viewvc/llvm-project?rev=266131&view=rev
Log:
Move summary creation out of llvm-as into opt
Summary:
Let keep llvm-as "dumb": it converts textual IR to bitcode. This
commit removes the dependency from llvm-as to libLLVMAnalysis.
We'll add back summary in llvm-as if we get to a textual
representation for it at some point. In the meantime, opt seems
like a better place for that.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19032
From: Mehdi Amini <mehdi.amini at apple.com>
Modified:
llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
llvm/trunk/test/Bitcode/module_hash.ll
llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.ll
llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll
llvm/trunk/test/Bitcode/thinlto-function-summary.ll
llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll
llvm/trunk/test/Linker/funcimport.ll
llvm/trunk/test/Linker/funcimport2.ll
llvm/trunk/test/Linker/funcimport_appending_global.ll
llvm/trunk/test/Linker/funcimport_comdat.ll
llvm/trunk/test/Linker/thinlto_funcimport_debug.ll
llvm/trunk/test/ThinLTO/X86/funcimport.ll
llvm/trunk/test/ThinLTO/X86/odr_resolution.ll
llvm/trunk/test/Transforms/FunctionImport/adjustable_threshold.ll
llvm/trunk/test/Transforms/FunctionImport/funcimport.ll
llvm/trunk/test/Transforms/FunctionImport/funcimport_alias.ll
llvm/trunk/test/Transforms/FunctionImport/funcimport_debug.ll
llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll
llvm/trunk/test/tools/gold/X86/thinlto.ll
llvm/trunk/test/tools/gold/X86/thinlto_linkonceresolution.ll
llvm/trunk/test/tools/llvm-lto/thinlto.ll
llvm/trunk/tools/llvm-as/CMakeLists.txt
llvm/trunk/tools/llvm-as/LLVMBuild.txt
llvm/trunk/tools/llvm-as/llvm-as.cpp
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/ExecutionEngine.h Tue Apr 12 16:35:18 2016
@@ -565,7 +565,7 @@ public:
}
/// setOptLevel - Set the optimization level for the JIT. This option
- /// defaults to CodeGenOpt::Default.
+ /// defaults to CodeGenOpt::Default.-
EngineBuilder &setOptLevel(CodeGenOpt::Level l) {
OptLevel = l;
return *this;
Modified: llvm/trunk/test/Bitcode/module_hash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/module_hash.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/module_hash.ll (original)
+++ llvm/trunk/test/Bitcode/module_hash.ll Tue Apr 12 16:35:18 2016
@@ -1,14 +1,14 @@
; Check per module hash.
-; RUN: llvm-as -module-hash %s -o - | llvm-bcanalyzer -dump | FileCheck %s --check-prefix=MOD1
+; RUN: opt -module-hash %s -o - | llvm-bcanalyzer -dump | FileCheck %s --check-prefix=MOD1
; MOD1: <HASH op0={{[0-9]*}} op1={{[0-9]*}} op2={{[0-9]*}} op3={{[0-9]*}} op4={{[0-9]*}} (match)/>
-; RUN: llvm-as -module-hash %p/Inputs/module_hash.ll -o - | llvm-bcanalyzer -dump | FileCheck %s --check-prefix=MOD2
+; RUN: opt -module-hash %p/Inputs/module_hash.ll -o - | llvm-bcanalyzer -dump | FileCheck %s --check-prefix=MOD2
; MOD2: <HASH op0={{[0-9]*}} op1={{[0-9]*}} op2={{[0-9]*}} op3={{[0-9]*}} op4={{[0-9]*}} (match)/>
; Check that the hash matches in the combined index.
; First regenerate the modules with a summary
-; RUN: llvm-as -module-hash -module-summary %s -o %t.m1.bc
-; RUN: llvm-as -module-hash -module-summary %p/Inputs/module_hash.ll -o %t.m2.bc
+; RUN: opt -module-hash -module-summary %s -o %t.m1.bc
+; RUN: opt -module-hash -module-summary %p/Inputs/module_hash.ll -o %t.m2.bc
; Recover the hashes from the modules themselves.
; RUN: llvm-bcanalyzer -dump %t.m1.bc | grep '<HASH' > %t.hash
Modified: llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll Tue Apr 12 16:35:18 2016
@@ -1,7 +1,7 @@
; Test to check the callgraph in summary when there is PGO
-; RUN: llvm-as -module-summary %s -o %t.o
+; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
-; RUN: llvm-as -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o
+; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
Modified: llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-function-summary-callgraph.ll Tue Apr 12 16:35:18 2016
@@ -1,7 +1,7 @@
; Test to check the callgraph in summary
-; RUN: llvm-as -module-summary %s -o %t.o
+; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
-; RUN: llvm-as -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o
+; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph.ll -o %t2.o
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
Modified: llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-function-summary-refgraph.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
; Test to check both the callgraph and refgraph in summary
-; RUN: llvm-as -module-summary %s -o %t.o
+; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
; See if the calls and other references are recorded properly using the
Modified: llvm/trunk/test/Bitcode/thinlto-function-summary.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-function-summary.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-function-summary.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-function-summary.ll Tue Apr 12 16:35:18 2016
@@ -1,4 +1,4 @@
-; RUN: llvm-as -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
+; RUN: opt -module-summary < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
; Check for summary block/records.
; Check the value ids in the summary entries against the
@@ -13,7 +13,7 @@
; BC-NEXT: <FNENTRY {{.*}} op0=2 {{.*}}> record string = 'bar'
; BC-NEXT: <FNENTRY {{.*}} op0=4 {{.*}}> record string = 'f'
-; RUN: llvm-as -module-summary < %s | llvm-dis | FileCheck %s
+; RUN: opt -module-summary < %s | llvm-dis | FileCheck %s
; Check that this round-trips correctly.
; ModuleID = '<stdin>'
Modified: llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll (original)
+++ llvm/trunk/test/Bitcode/thinlto-summary-linkage-types.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
; Check the linkage types in both the per-module and combined summaries.
-; RUN: llvm-as -module-summary %s -o %t.o
+; RUN: opt -module-summary %s -o %t.o
; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s
; RUN: llvm-lto -thinlto -o %t2 %t.o
; RUN: llvm-bcanalyzer -dump %t2.thinlto.bc | FileCheck %s --check-prefix=COMBINED
Modified: llvm/trunk/test/Linker/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Linker/funcimport.ll (original)
+++ llvm/trunk/test/Linker/funcimport.ll Tue Apr 12 16:35:18 2016
@@ -1,13 +1,13 @@
; First ensure that the ThinLTO handling in llvm-link and llvm-lto handles
; bitcode without summary sections gracefully.
-; RUN: llvm-as %s -o %t.bc
-; RUN: llvm-as %p/Inputs/funcimport.ll -o %t2.bc
+; RUN: opt %s -o %t.bc
+; RUN: opt %p/Inputs/funcimport.ll -o %t2.bc
; RUN: llvm-link %t.bc -summary-index=%t.bc -S
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Ensure statics are promoted/renamed correctly from this file (all but
Modified: llvm/trunk/test/Linker/funcimport2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport2.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Linker/funcimport2.ll (original)
+++ llvm/trunk/test/Linker/funcimport2.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
-; RUN: llvm-as -module-summary %s -o %t1.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport2.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t1.bc
+; RUN: opt -module-summary %p/Inputs/funcimport2.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t1.bc %t2.bc
; RUN: llvm-link -import=bar:%t2.bc %t1.bc -summary-index=%t3.thinlto.bc -S | FileCheck %s
Modified: llvm/trunk/test/Linker/funcimport_appending_global.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport_appending_global.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Linker/funcimport_appending_global.ll (original)
+++ llvm/trunk/test/Linker/funcimport_appending_global.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport_appending_global.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport_appending_global.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Do the import now
Modified: llvm/trunk/test/Linker/funcimport_comdat.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport_comdat.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Linker/funcimport_comdat.ll (original)
+++ llvm/trunk/test/Linker/funcimport_comdat.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport_comdat.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport_comdat.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Ensure linking of comdat containing external linkage global and function
Modified: llvm/trunk/test/Linker/thinlto_funcimport_debug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/thinlto_funcimport_debug.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Linker/thinlto_funcimport_debug.ll (original)
+++ llvm/trunk/test/Linker/thinlto_funcimport_debug.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/thinlto_funcimport_debug.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/thinlto_funcimport_debug.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; If we import func1 and not func2 we should only link DISubprogram for func1
Modified: llvm/trunk/test/ThinLTO/X86/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/funcimport.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/funcimport.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/funcimport.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
; Ensure statics are promoted/renamed correctly from this file (all but
Modified: llvm/trunk/test/ThinLTO/X86/odr_resolution.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ThinLTO/X86/odr_resolution.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/ThinLTO/X86/odr_resolution.ll (original)
+++ llvm/trunk/test/ThinLTO/X86/odr_resolution.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/odr_resolution.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/odr_resolution.ll -o %t2.bc
; RUN: llvm-lto -thinlto-action=thinlink -o %t3.bc %t.bc %t2.bc
; Verify that only one ODR is selected across modules, but non ODR are not affected.
Modified: llvm/trunk/test/Transforms/FunctionImport/adjustable_threshold.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/adjustable_threshold.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/adjustable_threshold.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/adjustable_threshold.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/adjustable_threshold.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/adjustable_threshold.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Test import with default progressive instruction factor
Modified: llvm/trunk/test/Transforms/FunctionImport/funcimport.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/funcimport.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/funcimport.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/funcimport.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport.ll -o %t2.bc
; RUN: llvm-lto -thinlto -print-summary-global-ids -o %t3 %t.bc %t2.bc 2>&1 | FileCheck %s --check-prefix=GUID
; Do the import now
Modified: llvm/trunk/test/Transforms/FunctionImport/funcimport_alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/funcimport_alias.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/funcimport_alias.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/funcimport_alias.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport_alias.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport_alias.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Do the import now. Ensures that the importer handles an external call
Modified: llvm/trunk/test/Transforms/FunctionImport/funcimport_debug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/FunctionImport/funcimport_debug.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/FunctionImport/funcimport_debug.ll (original)
+++ llvm/trunk/test/Transforms/FunctionImport/funcimport_debug.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Do setup work for all below tests: generate bitcode and combined index
-; RUN: llvm-as -module-summary %s -o %t.bc
-; RUN: llvm-as -module-summary %p/Inputs/funcimport_debug.ll -o %t2.bc
+; RUN: opt -module-summary %s -o %t.bc
+; RUN: opt -module-summary %p/Inputs/funcimport_debug.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Do the import now and confirm that metadata is linked for imported function.
Modified: llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll (original)
+++ llvm/trunk/test/tools/gold/X86/pr19901_thinlto.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
; RUN: llc %s -o %t.o -filetype=obj -relocation-model=pic
-; RUN: llvm-as -module-summary %p/Inputs/pr19901-1.ll -o %t2.o
+; RUN: opt -module-summary %p/Inputs/pr19901-1.ll -o %t2.o
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
; RUN: --plugin-opt=thinlto \
; RUN: -shared -m elf_x86_64 -o %t.so %t2.o %t.o
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=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/thinlto.ll (original)
+++ llvm/trunk/test/tools/gold/X86/thinlto.ll Tue Apr 12 16:35:18 2016
@@ -13,8 +13,8 @@
; RUN: llvm-nm %t4 | FileCheck %s --check-prefix=NM
; Next generate summary sections and test gold handling.
-; RUN: llvm-as -module-summary %s -o %t.o
-; RUN: llvm-as -module-summary %p/Inputs/thinlto.ll -o %t2.o
+; RUN: opt -module-summary %s -o %t.o
+; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
; Ensure gold generates an index and not a binary if requested.
; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \
Modified: llvm/trunk/test/tools/gold/X86/thinlto_linkonceresolution.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/thinlto_linkonceresolution.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/tools/gold/X86/thinlto_linkonceresolution.ll (original)
+++ llvm/trunk/test/tools/gold/X86/thinlto_linkonceresolution.ll Tue Apr 12 16:35:18 2016
@@ -1,5 +1,5 @@
-; RUN: llvm-as -module-summary %s -o %t.o
-; RUN: llvm-as -module-summary %p/Inputs/thinlto_linkonceresolution.ll -o %t2.o
+; RUN: opt -module-summary %s -o %t.o
+; RUN: opt -module-summary %p/Inputs/thinlto_linkonceresolution.ll -o %t2.o
; Ensure the plugin ensures that for ThinLTO the prevailing copy of a
; linkonce symbol is changed to weak to ensure it is not eliminated.
Modified: llvm/trunk/test/tools/llvm-lto/thinlto.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-lto/thinlto.ll?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-lto/thinlto.ll (original)
+++ llvm/trunk/test/tools/llvm-lto/thinlto.ll Tue Apr 12 16:35:18 2016
@@ -1,6 +1,6 @@
; Test combined function index generation for ThinLTO via llvm-lto.
-; RUN: llvm-as -module-summary %s -o %t.o
-; RUN: llvm-as -module-summary %p/Inputs/thinlto.ll -o %t2.o
+; RUN: opt -module-summary %s -o %t.o
+; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
; RUN: not test -e %t3
Modified: llvm/trunk/tools/llvm-as/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/CMakeLists.txt?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-as/CMakeLists.txt (original)
+++ llvm/trunk/tools/llvm-as/CMakeLists.txt Tue Apr 12 16:35:18 2016
@@ -1,5 +1,4 @@
set(LLVM_LINK_COMPONENTS
- Analysis
AsmParser
BitWriter
Core
Modified: llvm/trunk/tools/llvm-as/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/LLVMBuild.txt?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-as/LLVMBuild.txt (original)
+++ llvm/trunk/tools/llvm-as/LLVMBuild.txt Tue Apr 12 16:35:18 2016
@@ -19,4 +19,4 @@
type = Tool
name = llvm-as
parent = Tools
-required_libraries = Analysis AsmParser BitWriter
+required_libraries = AsmParser BitWriter
Modified: llvm/trunk/tools/llvm-as/llvm-as.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-as/llvm-as.cpp?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-as/llvm-as.cpp (original)
+++ llvm/trunk/tools/llvm-as/llvm-as.cpp Tue Apr 12 16:35:18 2016
@@ -15,7 +15,6 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/LLVMContext.h"
@@ -45,10 +44,6 @@ static cl::opt<bool> Force("f", cl::desc
static cl::opt<bool> DisableOutput("disable-output", cl::desc("Disable output"),
cl::init(false));
-static cl::opt<bool> EmitSummaryIndex("module-summary",
- cl::desc("Emit module summary index"),
- cl::init(false));
-
static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"),
cl::init(false));
@@ -84,14 +79,9 @@ static void WriteOutputFile(const Module
exit(1);
}
- if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) {
- std::unique_ptr<ModuleSummaryIndex> Index;
- if (EmitSummaryIndex)
- Index = ModuleSummaryIndexBuilder(M).takeIndex();
-
- WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, Index.get(),
+ if (Force || !CheckBitcodeOutputToConsole(Out->os(), true))
+ WriteBitcodeToFile(M, Out->os(), PreserveBitcodeUseListOrder, nullptr,
EmitModuleHash);
- }
// Declare success.
Out->keep();
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=266131&r1=266130&r2=266131&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Tue Apr 12 16:35:18 2016
@@ -158,6 +158,12 @@ DisableSLPVectorization("disable-slp-vec
cl::desc("Disable the slp vectorization pass"),
cl::init(false));
+static cl::opt<bool> EmitSummaryIndex("module-summary",
+ cl::desc("Emit module summary index"),
+ cl::init(false));
+
+static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"),
+ cl::init(false));
static cl::opt<bool>
DisableSimplifyLibCalls("disable-simplify-libcalls",
@@ -617,7 +623,8 @@ int main(int argc, char **argv) {
if (OutputAssembly)
Passes.add(createPrintModulePass(*OS, "", PreserveAssemblyUseListOrder));
else
- Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder));
+ Passes.add(createBitcodeWriterPass(*OS, PreserveBitcodeUseListOrder,
+ EmitSummaryIndex, EmitModuleHash));
}
// Before executing passes, print the final values of the LLVM options.
More information about the llvm-commits
mailing list