[llvm] r363170 - gn build: Add SystemZ target

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 07:24:43 PDT 2019


Author: nico
Date: Wed Jun 12 07:24:43 2019
New Revision: 363170

URL: http://llvm.org/viewvc/llvm-project?rev=363170&view=rev
Log:
gn build: Add SystemZ target

Added:
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/BUILD.gn
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/BUILD.gn
Modified:
    llvm/trunk/utils/gn/TODO.txt
    llvm/trunk/utils/gn/secondary/llvm/lib/Target/targets.gni

Modified: llvm/trunk/utils/gn/TODO.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/TODO.txt?rev=363170&r1=363169&r2=363170&view=diff
==============================================================================
--- llvm/trunk/utils/gn/TODO.txt (original)
+++ llvm/trunk/utils/gn/TODO.txt Wed Jun 12 07:24:43 2019
@@ -4,7 +4,7 @@ Ideas for things to do:
   - once there are more projects, have an llvm_enable_projects arg, modeled
     after llvm_targets_to_build in the GN build
   - a check-all build target that runs test of all projects
-- more targets (AMDGPU ARC AVR MSP430 NVPTX SystemZ XCore)
+- more targets (AMDGPU ARC AVR MSP430 NVPTX XCore)
   - example: https://reviews.llvm.org/D56416
 - investigate feasibility of working `gn check`
 

Added: llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn?rev=363170&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn Wed Jun 12 07:24:43 2019
@@ -0,0 +1,23 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("SystemZGenAsmMatcher") {
+  visibility = [ ":AsmParser" ]
+  args = [ "-gen-asm-matcher" ]
+  td_file = "../SystemZ.td"
+}
+
+static_library("AsmParser") {
+  output_name = "LLVMSystemZAsmParser"
+  deps = [
+    ":SystemZGenAsmMatcher",
+    "//llvm/lib/MC",
+    "//llvm/lib/MC/MCParser",
+    "//llvm/lib/Support",
+    "//llvm/lib/Target/SystemZ/MCTargetDesc",
+    "//llvm/lib/Target/SystemZ/TargetInfo",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "SystemZAsmParser.cpp",
+  ]
+}

Added: llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn?rev=363170&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn Wed Jun 12 07:24:43 2019
@@ -0,0 +1,74 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("SystemZGenCallingConv") {
+  visibility = [ ":LLVMSystemZCodeGen" ]
+  args = [ "-gen-callingconv" ]
+  td_file = "SystemZ.td"
+}
+
+tablegen("SystemZGenDAGISel") {
+  visibility = [ ":LLVMSystemZCodeGen" ]
+  args = [ "-gen-dag-isel" ]
+  td_file = "SystemZ.td"
+}
+
+static_library("LLVMSystemZCodeGen") {
+  deps = [
+    ":SystemZGenCallingConv",
+    ":SystemZGenDAGISel",
+    "MCTargetDesc",
+    "TargetInfo",
+    "//llvm/include/llvm/Config:llvm-config",
+    "//llvm/lib/Analysis",
+    "//llvm/lib/CodeGen",
+    "//llvm/lib/CodeGen/AsmPrinter",
+    "//llvm/lib/CodeGen/SelectionDAG",
+    "//llvm/lib/IR",
+    "//llvm/lib/MC",
+    "//llvm/lib/Support",
+    "//llvm/lib/Target",
+    "//llvm/lib/Transforms/Scalar",
+  ]
+  include_dirs = [ "." ]
+  sources = [
+    "SystemZAsmPrinter.cpp",
+    "SystemZCallingConv.cpp",
+    "SystemZConstantPoolValue.cpp",
+    "SystemZElimCompare.cpp",
+    "SystemZExpandPseudo.cpp",
+    "SystemZFrameLowering.cpp",
+    "SystemZHazardRecognizer.cpp",
+    "SystemZISelDAGToDAG.cpp",
+    "SystemZISelLowering.cpp",
+    "SystemZInstrInfo.cpp",
+    "SystemZLDCleanup.cpp",
+    "SystemZLongBranch.cpp",
+    "SystemZMCInstLower.cpp",
+    "SystemZMachineFunctionInfo.cpp",
+    "SystemZMachineScheduler.cpp",
+    "SystemZPostRewrite.cpp",
+    "SystemZRegisterInfo.cpp",
+    "SystemZSelectionDAGInfo.cpp",
+    "SystemZShortenInst.cpp",
+    "SystemZSubtarget.cpp",
+    "SystemZTDC.cpp",
+    "SystemZTargetMachine.cpp",
+    "SystemZTargetTransformInfo.cpp",
+  ]
+}
+
+# This is a bit different from most build files: Due to this group
+# having the directory's name, "//llvm/lib/Target/SystemZ" will refer to this
+# target, which pulls in the code in this directory *and all subdirectories*.
+# For most other directories, "//llvm/lib/Foo" only pulls in the code directly
+# in "llvm/lib/Foo". The forwarding targets in //llvm/lib/Target expect this
+# different behavior.
+group("SystemZ") {
+  deps = [
+    ":LLVMSystemZCodeGen",
+    "AsmParser",
+    "Disassembler",
+    "MCTargetDesc",
+    "TargetInfo",
+  ]
+}

Added: llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/BUILD.gn?rev=363170&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/Disassembler/BUILD.gn Wed Jun 12 07:24:43 2019
@@ -0,0 +1,23 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("SystemZGenDisassemblerTables") {
+  visibility = [ ":Disassembler" ]
+  args = [ "-gen-disassembler" ]
+  td_file = "../SystemZ.td"
+}
+
+static_library("Disassembler") {
+  output_name = "LLVMSystemZDisassembler"
+  deps = [
+    ":SystemZGenDisassemblerTables",
+    "//llvm/lib/MC",
+    "//llvm/lib/MC/MCDisassembler",
+    "//llvm/lib/Support",
+    "//llvm/lib/Target/SystemZ/MCTargetDesc",
+    "//llvm/lib/Target/SystemZ/TargetInfo",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "SystemZDisassembler.cpp",
+  ]
+}

Added: llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn?rev=363170&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn Wed Jun 12 07:24:43 2019
@@ -0,0 +1,60 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("SystemZGenAsmWriter") {
+  visibility = [ ":MCTargetDesc" ]
+  args = [ "-gen-asm-writer" ]
+  td_file = "../SystemZ.td"
+}
+
+tablegen("SystemZGenInstrInfo") {
+  visibility = [ ":MCTargetDesc" ]
+  args = [ "-gen-instr-info" ]
+  td_file = "../SystemZ.td"
+}
+
+tablegen("SystemZGenMCCodeEmitter") {
+  visibility = [ ":MCTargetDesc" ]
+  args = [ "-gen-emitter" ]
+  td_file = "../SystemZ.td"
+}
+
+tablegen("SystemZGenRegisterInfo") {
+  visibility = [ ":MCTargetDesc" ]
+  args = [ "-gen-register-info" ]
+  td_file = "../SystemZ.td"
+}
+
+tablegen("SystemZGenSubtargetInfo") {
+  visibility = [ ":MCTargetDesc" ]
+  args = [ "-gen-subtarget" ]
+  td_file = "../SystemZ.td"
+}
+
+static_library("MCTargetDesc") {
+  output_name = "LLVMSystemZDesc"
+
+  # This should contain tablegen targets generating .inc files included
+  # by other targets. .inc files only used by .cpp files in this directory
+  # should be in deps on the static_library instead.
+  public_deps = [
+    ":SystemZGenInstrInfo",
+    ":SystemZGenRegisterInfo",
+    ":SystemZGenSubtargetInfo",
+  ]
+  deps = [
+    ":SystemZGenAsmWriter",
+    ":SystemZGenMCCodeEmitter",
+    "//llvm/lib/MC",
+    "//llvm/lib/Support",
+    "//llvm/lib/Target/SystemZ/TargetInfo",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "SystemZInstPrinter.cpp",
+    "SystemZMCAsmBackend.cpp",
+    "SystemZMCAsmInfo.cpp",
+    "SystemZMCCodeEmitter.cpp",
+    "SystemZMCObjectWriter.cpp",
+    "SystemZMCTargetDesc.cpp",
+  ]
+}

Added: llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/BUILD.gn?rev=363170&view=auto
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/BUILD.gn (added)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/SystemZ/TargetInfo/BUILD.gn Wed Jun 12 07:24:43 2019
@@ -0,0 +1,10 @@
+static_library("TargetInfo") {
+  output_name = "LLVMSystemZInfo"
+  deps = [
+    "//llvm/lib/Support",
+  ]
+  include_dirs = [ ".." ]
+  sources = [
+    "SystemZTargetInfo.cpp",
+  ]
+}

Modified: llvm/trunk/utils/gn/secondary/llvm/lib/Target/targets.gni
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/llvm/lib/Target/targets.gni?rev=363170&r1=363169&r2=363170&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/llvm/lib/Target/targets.gni (original)
+++ llvm/trunk/utils/gn/secondary/llvm/lib/Target/targets.gni Wed Jun 12 07:24:43 2019
@@ -28,6 +28,7 @@ if (llvm_targets_to_build == "host") {
     "Mips",
     "PowerPC",
     "Sparc",
+    "SystemZ",
     "WebAssembly",
     "X86",
   ]
@@ -60,6 +61,8 @@ foreach(target, llvm_targets_to_build) {
     # Nothing to do.
   } else if (target == "Sparc") {
     # Nothing to do.
+  } else if (target == "SystemZ") {
+    # Nothing to do.
   } else if (target == "WebAssembly") {
     llvm_build_WebAssembly = true
   } else if (target == "X86") {




More information about the llvm-commits mailing list