[llvm] 0c0fc9a - [gn build] Port d86b68afd7f0 (AMDGPUMCTests dependency mess)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 06:19:20 PDT 2024


Author: Nico Weber
Date: 2024-05-09T09:19:11-04:00
New Revision: 0c0fc9a7c6e298269871b4f1bf5fea7fa9048209

URL: https://github.com/llvm/llvm-project/commit/0c0fc9a7c6e298269871b4f1bf5fea7fa9048209
DIFF: https://github.com/llvm/llvm-project/commit/0c0fc9a7c6e298269871b4f1bf5fea7fa9048209.diff

LOG: [gn build] Port d86b68afd7f0 (AMDGPUMCTests dependency mess)

Added: 
    

Modified: 
    llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn
    llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn
    llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
    llvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn

Removed: 
    


################################################################################
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 e1b867bf70baa..edd8d4f1840d0 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn
@@ -61,6 +61,7 @@ tablegen("AMDGPUGenRegisterBank") {
   visibility = [
     ":LLVMAMDGPUCodeGen",
     "Utils",
+    "//llvm/unittests/MC/AMDGPU:AMDGPUMCTests",
     "//llvm/unittests/Target/AMDGPU:AMDGPUTests",
   ]
   args = [ "-gen-register-bank" ]

diff  --git a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn
index 631d1ef5c7b09..ec0d5fc767f79 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn
@@ -1,7 +1,10 @@
 import("//llvm/utils/TableGen/tablegen.gni")
 
 tablegen("AMDGPUGenSearchableTables") {
-  visibility = [ ":Utils" ]
+  visibility = [
+    ":Utils",
+    "//llvm/unittests/MC/AMDGPU:AMDGPUMCTests",
+  ]
   args = [ "-gen-searchable-tables" ]
   td_file = "../AMDGPU.td"
 }

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
index 6cc3848c11149..2db5b9603f216 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
@@ -77,7 +77,7 @@ group("unittests") {
   }
   if (llvm_build_AMDGPU) {
     deps += [
-      "MC/AMDGPU:AMDGPUDwarfTests",
+      "MC/AMDGPU:AMDGPUMCTests",
       "Target/AMDGPU:AMDGPUTests",
     ]
   }

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn
index 603753abec35b..4a7f829d6d8e6 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/MC/AMDGPU/BUILD.gn
@@ -1,13 +1,29 @@
 import("//third-party/unittest/unittest.gni")
 
-unittest("AMDGPUDwarfTests") {
+unittest("AMDGPUMCTests") {
   deps = [
+    "//llvm/lib/CodeGen",
+    "//llvm/lib/IR",
     "//llvm/lib/MC",
     "//llvm/lib/Support",
     "//llvm/lib/Target/AMDGPU:LLVMAMDGPUCodeGen",
     "//llvm/lib/Target/AMDGPU/MCTargetDesc",
     "//llvm/lib/Target/AMDGPU/TargetInfo",
     "//llvm/lib/TargetParser",
+
+    # SIProgramInfoMCExprs.cpp includes AMDGPUTargetMachine.h, which includes
+    # the generated AMDGPUGenRegisterBank.inc file :/
+    "//llvm/lib/Target/AMDGPU:AMDGPUGenRegisterBank",
+
+    # SIProgramInfoMCExprs.cpp includes AMDGPUTargetMachine.h, which includes
+    # the generated AMDGPUGenSearchableTables.inc file :/
+    "//llvm/lib/Target/AMDGPU/Utils:AMDGPUGenSearchableTables",
+  ]
+
+  # AMDGPUMCTests heavily reaches into lib/Target/AMDGPU internals.
+  include_dirs = [ "//llvm/lib/Target/AMDGPU" ]
+  sources = [
+    "DwarfRegMappings.cpp",
+    "SIProgramInfoMCExprs.cpp",
   ]
-  sources = [ "DwarfRegMappings.cpp" ]
 }


        


More information about the llvm-commits mailing list