Index: llvm/utils/gn/secondary/BUILD.gn =================================================================== --- llvm/utils/gn/secondary/BUILD.gn +++ llvm/utils/gn/secondary/BUILD.gn @@ -5,6 +5,9 @@ deps = [ "//clang/test", "//lld/test", + "//llvm/tools/llvm-exegesis", + "//llvm/tools/llvm-extract", + "//llvm/tools/llvm-link", "//llvm/tools/llvm-mca", "//llvm/tools/llvm-mt", "//llvm/tools/llvm-rc", Index: llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/MCJIT/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/lib/ExecutionEngine/MCJIT/BUILD.gn @@ -0,0 +1,14 @@ +static_library("MCJIT") { + output_name = "LLVMMCJIT" + deps = [ + "//llvm/lib/ExecutionEngine", + "//llvm/lib/ExecutionEngine/RuntimeDyld", + "//llvm/lib/IR", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Target", + ] + sources = [ + "MCJIT.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/BUILD.gn @@ -0,0 +1,15 @@ +executable("llvm-exegesis") { + deps = [ + "lib", + "//llvm/lib/CodeGen", + "//llvm/lib/ExecutionEngine", + "//llvm/lib/ExecutionEngine/MCJIT", + "//llvm/lib/MC", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Target:NativeTarget", + ] + sources = [ + "llvm-exegesis.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/BUILD.gn @@ -0,0 +1,41 @@ +import("//llvm/lib/Target/targets.gni") + +static_library("lib") { + output_name = "LLVMExegesis" + deps = [ + "//llvm/lib/Analysis", + "//llvm/lib/CodeGen", + "//llvm/lib/ExecutionEngine", + "//llvm/lib/ExecutionEngine/MCJIT", + "//llvm/lib/IR", + "//llvm/lib/MC", + "//llvm/lib/Object", + "//llvm/lib/ObjectYAML", + "//llvm/lib/Support", + ] + sources = [ + "Analysis.cpp", + "Assembler.cpp", + "BenchmarkResult.cpp", + "BenchmarkRunner.cpp", + "Clustering.cpp", + "CodeTemplate.cpp", + "Latency.cpp", + "LlvmState.cpp", + "MCInstrDescView.cpp", + "PerfHelper.cpp", + "RegisterAliasing.cpp", + "RegisterValue.cpp", + "SnippetGenerator.cpp", + "Target.cpp", + "Uops.cpp", + ] + + # FIXME: Add this once llvm/lib/Target/AArch64 exists. + #if (llvm_build_AArch64) { + # deps += [ "AArch64" ] + #} + if (llvm_build_X86) { + deps += [ "X86" ] + } +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/X86/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/X86/BUILD.gn @@ -0,0 +1,21 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("X86GenExegesis") { + args = [ "-gen-exegesis" ] + td_file = "//llvm/lib/Target/X86/X86.td" +} + +static_library("X86") { + output_name = "LLVMExegesisX86" + deps = [ + ":X86GenExegesis", + + # Exegesis reaches inside the Target/X86 tablegen internals and must + # depend on this Target/X86-internal build target. + "//llvm/lib/Target/X86/MCTargetDesc", + ] + sources = [ + "Target.cpp", + ] + include_dirs = [ "//llvm/lib/Target/X86" ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-extract/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-extract/BUILD.gn @@ -0,0 +1,12 @@ +executable("llvm-extract") { + deps = [ + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/Support", + "//llvm/lib/Transforms/IPO", + ] + sources = [ + "llvm-extract.cpp", + ] +} Index: llvm/utils/gn/secondary/llvm/tools/llvm-link/BUILD.gn =================================================================== --- /dev/null +++ llvm/utils/gn/secondary/llvm/tools/llvm-link/BUILD.gn @@ -0,0 +1,16 @@ +executable("llvm-link") { + deps = [ + "//llvm/lib/Bitcode/Reader", + "//llvm/lib/Bitcode/Writer", + "//llvm/lib/IR", + "//llvm/lib/IRReader", + "//llvm/lib/Linker", + "//llvm/lib/Object", + "//llvm/lib/Support", + "//llvm/lib/Transforms/IPO", + "//llvm/lib/Transforms/Utils", + ] + sources = [ + "llvm-link.cpp", + ] +}