Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gn build] Add build files for //bolt
Adds build files for libraries, tools, and tests -- everything except the runtime. Doesn't hook up bolt in the main BUILD.gn file yet -- I want to verify that it builds on Linux, macOS, Windows before doing that. (I've only checked on macOS so far.) `ninja check-bolt` passes on macOS with this. (I locally bumped the deployment target to macOS 10.12 for that. bolt/ uses std::mutex quite a bit, which requires 10.12.) Differential Revision: https://reviews.llvm.org/D138355
- Loading branch information
Showing
22 changed files
with
514 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
llvm/utils/gn/secondary/bolt/include/bolt/RuntimeLibs/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import("//llvm/utils/gn/build/write_cmake_config.gni") | ||
|
||
write_cmake_config("RuntimeLibraryVariables") { | ||
input = "//bolt/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in" | ||
output = "$target_gen_dir/RuntimeLibraryVariables.inc" | ||
values = [ "LLVM_LIBDIR_SUFFIX=" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
static_library("Core") { | ||
output_name = "LLVMBOLTCore" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/DebugInfo/DWARF", | ||
"//llvm/lib/Demangle", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/MC/MCDisassembler", | ||
"//llvm/lib/Object", | ||
"//llvm/lib/Support", | ||
"//llvm/utils/gn/build/libs/pthread", | ||
] | ||
sources = [ | ||
"BinaryBasicBlock.cpp", | ||
"BinaryContext.cpp", | ||
"BinaryData.cpp", | ||
"BinaryEmitter.cpp", | ||
"BinaryFunction.cpp", | ||
"BinaryFunctionProfile.cpp", | ||
"BinarySection.cpp", | ||
"DebugData.cpp", | ||
"DynoStats.cpp", | ||
"Exceptions.cpp", | ||
"FunctionLayout.cpp", | ||
"JumpTable.cpp", | ||
"MCPlusBuilder.cpp", | ||
"ParallelUtilities.cpp", | ||
"Relocation.cpp", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
static_library("Passes") { | ||
output_name = "LLVMBOLTPasses" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Core", | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/CodeGen/AsmPrinter", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/Support", | ||
"//llvm/lib/Transforms/Utils", | ||
"//llvm/utils/gn/build/libs/pthread", | ||
] | ||
sources = [ | ||
"ADRRelaxationPass.cpp", | ||
"Aligner.cpp", | ||
"AllocCombiner.cpp", | ||
"AsmDump.cpp", | ||
"BinaryFunctionCallGraph.cpp", | ||
"BinaryPasses.cpp", | ||
"CMOVConversion.cpp", | ||
"CacheMetrics.cpp", | ||
"CallGraph.cpp", | ||
"CallGraphWalker.cpp", | ||
"DataflowAnalysis.cpp", | ||
"DataflowInfoManager.cpp", | ||
"FrameAnalysis.cpp", | ||
"FrameOptimizer.cpp", | ||
"HFSort.cpp", | ||
"HFSortPlus.cpp", | ||
"Hugify.cpp", | ||
"IdenticalCodeFolding.cpp", | ||
"IndirectCallPromotion.cpp", | ||
"Inliner.cpp", | ||
"Instrumentation.cpp", | ||
"JTFootprintReduction.cpp", | ||
"LivenessAnalysis.cpp", | ||
"LongJmp.cpp", | ||
"LoopInversionPass.cpp", | ||
"MCF.cpp", | ||
"PLTCall.cpp", | ||
"PatchEntries.cpp", | ||
"PettisAndHansen.cpp", | ||
"RegAnalysis.cpp", | ||
"RegReAssign.cpp", | ||
"ReorderAlgorithm.cpp", | ||
"ReorderData.cpp", | ||
"ReorderFunctions.cpp", | ||
"RetpolineInsertion.cpp", | ||
"ShrinkWrapping.cpp", | ||
"SplitFunctions.cpp", | ||
"StackAllocationAnalysis.cpp", | ||
"StackAvailableExpressions.cpp", | ||
"StackPointerTracking.cpp", | ||
"StackReachingUses.cpp", | ||
"StokeInfo.cpp", | ||
"TailDuplication.cpp", | ||
"ThreeWayBranch.cpp", | ||
"ValidateInternalCalls.cpp", | ||
"ValidateMemRefs.cpp", | ||
"VeneerElimination.cpp", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
static_library("Profile") { | ||
output_name = "LLVMBOLTProfile" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Core", | ||
"//bolt/lib/Passes", | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/Support", | ||
] | ||
sources = [ | ||
"BoltAddressTranslation.cpp", | ||
"DataAggregator.cpp", | ||
"DataReader.cpp", | ||
"Heatmap.cpp", | ||
"ProfileReaderBase.cpp", | ||
"YAMLProfileReader.cpp", | ||
"YAMLProfileWriter.cpp", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import("//llvm/lib/Target/targets.gni") | ||
|
||
static_library("Rewrite") { | ||
output_name = "LLVMBOLTRewrite" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Core", | ||
"//bolt/lib/Passes", | ||
"//bolt/lib/Profile", | ||
"//bolt/lib/RuntimeLibs", | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/DWP", | ||
"//llvm/lib/DebugInfo/DWARF", | ||
"//llvm/lib/ExecutionEngine", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/Object", | ||
"//llvm/lib/Support", | ||
"//llvm/utils/gn/build/libs/pthread", | ||
] | ||
sources = [ | ||
"BinaryPassManager.cpp", | ||
"BoltDiff.cpp", | ||
"DWARFRewriter.cpp", | ||
"ExecutableFileMemoryManager.cpp", | ||
"MachORewriteInstance.cpp", | ||
"RewriteInstance.cpp", | ||
] | ||
|
||
defines = [] | ||
if (llvm_build_AArch64) { | ||
defines += [ "AARCH64_AVAILABLE" ] | ||
deps += [ "//bolt/lib/Target/AArch64" ] | ||
} | ||
if (llvm_build_X86) { | ||
defines += [ "X86_AVAILABLE" ] | ||
deps += [ "//bolt/lib/Target/X86" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
static_library("RuntimeLibs") { | ||
output_name = "LLVMBOLTRuntimeLibs" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/include/bolt/RuntimeLibs:RuntimeLibraryVariables", | ||
"//bolt/lib/Core", | ||
"//bolt/lib/Passes", | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/BinaryFormat", | ||
"//llvm/lib/ExecutionEngine/RuntimeDyld", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/Object", | ||
"//llvm/lib/Support", | ||
] | ||
include_dirs = [ target_gen_dir ] | ||
sources = [ | ||
"HugifyRuntimeLibrary.cpp", | ||
"InstrumentationRuntimeLibrary.cpp", | ||
"RuntimeLibrary.cpp", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
static_library("AArch64") { | ||
output_name = "LLVMBOLTTargetAArch64" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Core", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/Support", | ||
"//llvm/lib/Target/AArch64/MCTargetDesc", | ||
] | ||
sources = [ "AArch64MCPlusBuilder.cpp" ] | ||
|
||
# This target reaches into the internal headers of LLVM's AArch64 library. | ||
# That target doesn't expect that, so it doesn't use public_deps for | ||
# tblgen-generated headers used only in internal headers (...which this | ||
# target here questionably includes). So depend on the target that generates | ||
# those headers here. | ||
include_dirs = [ "//llvm/lib/Target/AArch64" ] | ||
deps += [ "//llvm/lib/Target/AArch64/Utils" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
static_library("X86") { | ||
output_name = "LLVMBOLTTargetX86" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//bolt/lib/Core", | ||
"//bolt/lib/Utils", | ||
"//llvm/lib/MC", | ||
"//llvm/lib/MC/MCDisassembler", | ||
"//llvm/lib/Support", | ||
"//llvm/lib/Target/X86/MCTargetDesc", | ||
] | ||
sources = [ | ||
"X86MCPlusBuilder.cpp", | ||
"X86MCSymbolizer.cpp", | ||
] | ||
|
||
# This target reaches into the internal headers of LLVM's X86 library. | ||
include_dirs = [ "//llvm/lib/Target/X86" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
static_library("Utils") { | ||
output_name = "LLVMBOLTUtils" | ||
configs += [ "//llvm/utils/gn/build:bolt_code" ] | ||
deps = [ | ||
"//llvm/lib/Support", | ||
"//llvm/utils/gn/build/libs/pthread", | ||
] | ||
sources = [ | ||
"CommandLineOpts.cpp", | ||
"Utils.cpp", | ||
] | ||
} |
Oops, something went wrong.