[llvm] 2847b8b - [gn build] Manually port dbed061b more

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 24 18:02:24 PDT 2021


Author: Nico Weber
Date: 2021-08-24T21:02:13-04:00
New Revision: 2847b8b6ff3e2cf90faca851399248620ba76370

URL: https://github.com/llvm/llvm-project/commit/2847b8b6ff3e2cf90faca851399248620ba76370
DIFF: https://github.com/llvm/llvm-project/commit/2847b8b6ff3e2cf90faca851399248620ba76370.diff

LOG: [gn build] Manually port dbed061b more

Added: 
    llvm/utils/gn/secondary/llvm/lib/Target/targets_with_mcas.gni

Modified: 
    llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
    llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn
    llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn

Removed: 
    


################################################################################
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 1e4fb7870cc2d..172d114988d3c 100644
--- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
@@ -2,6 +2,7 @@ import("//llvm/lib/DebugInfo/PDB/enable_dia.gni")
 import("//llvm/lib/Target/targets.gni")
 import("//llvm/lib/Target/targets_with_asm_parsers.gni")
 import("//llvm/lib/Target/targets_with_disassemblers.gni")
+import("//llvm/lib/Target/targets_with_mcas.gni")
 import("//llvm/triples.gni")
 import("//llvm/utils/gn/build/buildflags.gni")
 import("//llvm/utils/gn/build/libs/edit/enable.gni")
@@ -437,7 +438,7 @@ write_target_def_file("Targets.def") {
 write_target_def_file("TargetMCAs.def") {
   key = "LLVM_ENUM_TARGETMCAS"
   value = "LLVM_TARGETMCA"
-  all_targets = []
+  all_targets = targets_with_mcas
 }
 
 group("write_target_def_files") {

diff  --git a/llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn
index 51dfc4fcc48d4..a953e1b671ef7 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn
@@ -1,6 +1,7 @@
 import("//llvm/lib/Target/targets.gni")
 import("//llvm/lib/Target/targets_with_asm_parsers.gni")
 import("//llvm/lib/Target/targets_with_disassemblers.gni")
+import("//llvm/lib/Target/targets_with_mcas.gni")
 
 # This build file has two parts:
 # 1. The actual //llvm/lib/Target build target, which is just a static
@@ -81,3 +82,10 @@ group("AllTargetsInfos") {
     deps += [ "$target/TargetInfo" ]
   }
 }
+
+group("AllTargetsMCAs") {
+  deps = []
+  foreach(target, targets_with_mcas) {
+    deps += [ "$target/MCA" ]
+  }
+}

diff  --git a/llvm/utils/gn/secondary/llvm/lib/Target/targets_with_mcas.gni b/llvm/utils/gn/secondary/llvm/lib/Target/targets_with_mcas.gni
new file mode 100644
index 0000000000000..21d2b4f28fbbc
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/targets_with_mcas.gni
@@ -0,0 +1,7 @@
+import("//llvm/lib/Target/targets.gni")
+
+targets_with_mcas = []
+if (llvm_build_AMDGPU) {
+  # AMDGPU is currently the only target with an MCA.
+  targets_with_mcas += [ "AMDGPU" ]
+}

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 0b6b2bc0dca86..5717070295ebf 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn
@@ -10,6 +10,7 @@ executable("llvm-mca") {
     "//llvm/lib/Target:AllTargetsDescs",
     "//llvm/lib/Target:AllTargetsDisassemblers",
     "//llvm/lib/Target:AllTargetsInfos",
+    "//llvm/lib/Target:AllTargetsMCAs",
   ]
   include_dirs = [
     ".",


        


More information about the llvm-commits mailing list