diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn index 178b71d24f8c..74828a6e9acf 100644 --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -337,6 +337,7 @@ write_cmake_config("llvm-config") { "LLVM_NATIVE_TARGET=1", "LLVM_NATIVE_TARGETINFO=1", "LLVM_NATIVE_TARGETMC=1", + "LLVM_NATIVE_TARGETMCA=1", # FIXME: Set to 1 on mac once the 10.14 SDK is in common use. "LLVM_SUPPORT_XCODE_SIGNPOSTS=", @@ -431,6 +432,12 @@ write_target_def_file("Targets.def") { value = "LLVM_TARGET" } +write_target_def_file("TargetMCAs.def") { + key = "LLVM_ENUM_TARGETMCAS" + value = "LLVM_TARGETMCA" + all_targets = [] +} + group("write_target_def_files") { visibility = [ "//llvm/lib/Support", @@ -440,6 +447,7 @@ group("write_target_def_files") { ":AsmParsers.def", ":AsmPrinters.def", ":Disassemblers.def", + ":TargetMCAs.def", ":Targets.def", ] } diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn index 058a17bbe8b4..9a831ba9b1f5 100644 --- a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn @@ -241,6 +241,7 @@ group("AMDGPU") { ":LLVMAMDGPUCodeGen", "AsmParser", "Disassembler", + "MCA", "MCTargetDesc", "TargetInfo", "Utils", diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/MCA/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/MCA/BUILD.gn new file mode 100644 index 000000000000..9f65d17057ec --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/MCA/BUILD.gn @@ -0,0 +1,9 @@ +static_library("MCA") { + output_name = "LLVMAMDGPUTargetMCA" + deps = [ + "//llvm/lib/Target/AMDGPU/MCTargetDesc", + "//llvm/lib/Target/AMDGPU/Utils", + ] + include_dirs = [ ".." ] + sources = [ "AMDGPUCustomBehaviour.cpp" ] +} diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn index 458598b682f8..0b6b2bc0dca8 100644 --- a/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn @@ -33,8 +33,4 @@ executable("llvm-mca") { "llvm-mca.cpp", ] defines = [] - if (llvm_build_AMDGPU) { - deps += [ "//llvm/tools/llvm-mca/lib/AMDGPU" ] - defines += [ "HAS_AMDGPU" ] - } } diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-mca/lib/AMDGPU/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-mca/lib/AMDGPU/BUILD.gn deleted file mode 100644 index 3bde981c58ad..000000000000 --- a/llvm/utils/gn/secondary/llvm/tools/llvm-mca/lib/AMDGPU/BUILD.gn +++ /dev/null @@ -1,15 +0,0 @@ -static_library("AMDGPU") { - output_name = "LLVMMCACustomBehaviourAMDGPU" - deps = [ - "//llvm/lib/IR", - "//llvm/lib/Support", - "//llvm/lib/Target/AMDGPU", - - # llvm-mca/libAMDGPU reaches inside the Target/AMDGPU tablegen internals - # and must depend on these Target/AMDGPU-internal build targets. - "//llvm/lib/Target/AMDGPU/MCTargetDesc", - "//llvm/lib/Target/AMDGPU/Utils", - ] - include_dirs = [ "//llvm/lib/Target/AMDGPU" ] - sources = [ "AMDGPUCustomBehaviour.cpp" ] -}