[gn build] (manually) port ef16c8eaa5cd5679759 (MCACustomBehaviorAMDGPU)
authorNico Weber <thakis@chromium.org>
Thu, 8 Jul 2021 01:59:07 +0000 (21:59 -0400)
committerNico Weber <thakis@chromium.org>
Thu, 8 Jul 2021 01:59:07 +0000 (21:59 -0400)
llvm/utils/gn/secondary/llvm/tools/llvm-mca/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-mca/lib/AMDGPU/BUILD.gn [new file with mode: 0644]

index dcea891..458598b 100644 (file)
@@ -1,3 +1,5 @@
+import("//llvm/lib/Target/targets.gni")
+
 executable("llvm-mca") {
   deps = [
     "//llvm/lib/MC",
@@ -30,4 +32,9 @@ executable("llvm-mca") {
     "Views/View.cpp",
     "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
new file mode 100644 (file)
index 0000000..3bde981
--- /dev/null
@@ -0,0 +1,15 @@
+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" ]
+}