summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid L. Jones <dlj@google.com>2019-05-14 04:13:59 +0000
committerDavid L. Jones <dlj@google.com>2019-05-14 04:13:59 +0000
commitfe1aec0dbb1638b5ce84c9ad71d1c8bee4f1f8ac (patch)
treeb3a6518306ce9c67a50ea5fefc12919d7b67ef62
parent6c780b62f03a7ba88539e8b8f8795932f66416b5 (diff)
downloadbcm5719-llvm-fe1aec0dbb1638b5ce84c9ad71d1c8bee4f1f8ac.tar.gz
bcm5719-llvm-fe1aec0dbb1638b5ce84c9ad71d1c8bee4f1f8ac.zip
gn build: add Hexagon target
Differential Revision: https://reviews.llvm.org/D61819 llvm-svn: 360647
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/AsmParser/BUILD.gn22
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn112
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/Disassembler/BUILD.gn22
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/MCTargetDesc/BUILD.gn74
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/TargetInfo/BUILD.gn15
-rw-r--r--llvm/utils/gn/secondary/llvm/lib/Target/targets.gni3
6 files changed, 248 insertions, 0 deletions
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/AsmParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/AsmParser/BUILD.gn
new file mode 100644
index 00000000000..fa8b624713f
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/AsmParser/BUILD.gn
@@ -0,0 +1,22 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("HexagonGenAsmMatcher") {
+ visibility = [ ":AsmParser" ]
+ args = [ "-gen-asm-matcher" ]
+ td_file = "../Hexagon.td"
+}
+
+static_library("AsmParser") {
+ output_name = "LLVMHexagonAsmParser"
+ deps = [
+ ":HexagonGenAsmMatcher",
+ "//llvm/lib/MC",
+ "//llvm/lib/MC/MCParser",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target/Hexagon/MCTargetDesc",
+ ]
+ include_dirs = [ ".." ]
+ sources = [
+ "HexagonAsmParser.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn
new file mode 100644
index 00000000000..7c6d28025a8
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn
@@ -0,0 +1,112 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("HexagonGenCallingConv") {
+ visibility = [ ":LLVMHexagonCodeGen" ]
+ args = [ "-gen-callingconv" ]
+ td_file = "Hexagon.td"
+}
+
+tablegen("HexagonGenDAGISel") {
+ visibility = [ ":LLVMHexagonCodeGen" ]
+ args = [ "-gen-dag-isel" ]
+ td_file = "Hexagon.td"
+}
+
+tablegen("HexagonGenDFAPacketizer") {
+ visibility = [ ":LLVMHexagonCodeGen" ]
+ args = [ "-gen-dfa-packetizer" ]
+ td_file = "Hexagon.td"
+}
+
+static_library("LLVMHexagonCodeGen") {
+ deps = [
+ ":HexagonGenCallingConv",
+ ":HexagonGenDAGISel",
+ ":HexagonGenDFAPacketizer",
+ "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/Passes",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target",
+ "//llvm/lib/Transforms/Utils",
+ ]
+ include_dirs = [ "." ]
+ sources = [
+ "BitTracker.cpp",
+ "HexagonAsmPrinter.cpp",
+ "HexagonBitSimplify.cpp",
+ "HexagonBitTracker.cpp",
+ "HexagonBlockRanges.cpp",
+ "HexagonBranchRelaxation.cpp",
+ "HexagonCFGOptimizer.cpp",
+ "HexagonCommonGEP.cpp",
+ "HexagonConstExtenders.cpp",
+ "HexagonConstPropagation.cpp",
+ "HexagonCopyToCombine.cpp",
+ "HexagonEarlyIfConv.cpp",
+ "HexagonExpandCondsets.cpp",
+ "HexagonFixupHwLoops.cpp",
+ "HexagonFrameLowering.cpp",
+ "HexagonGenExtract.cpp",
+ "HexagonGenInsert.cpp",
+ "HexagonGenMux.cpp",
+ "HexagonGenPredicate.cpp",
+ "HexagonHardwareLoops.cpp",
+ "HexagonHazardRecognizer.cpp",
+ "HexagonInstrInfo.cpp",
+ "HexagonISelDAGToDAG.cpp",
+ "HexagonISelDAGToDAGHVX.cpp",
+ "HexagonISelLowering.cpp",
+ "HexagonISelLoweringHVX.cpp",
+ "HexagonLoopIdiomRecognition.cpp",
+ "HexagonMachineFunctionInfo.cpp",
+ "HexagonMachineScheduler.cpp",
+ "HexagonMCInstLower.cpp",
+ "HexagonNewValueJump.cpp",
+ "HexagonOptAddrMode.cpp",
+ "HexagonOptimizeSZextends.cpp",
+ "HexagonPeephole.cpp",
+ "HexagonRDFOpt.cpp",
+ "HexagonRegisterInfo.cpp",
+ "HexagonSelectionDAGInfo.cpp",
+ "HexagonSplitConst32AndConst64.cpp",
+ "HexagonSplitDouble.cpp",
+ "HexagonStoreWidening.cpp",
+ "HexagonSubtarget.cpp",
+ "HexagonTargetMachine.cpp",
+ "HexagonTargetObjectFile.cpp",
+ "HexagonTargetTransformInfo.cpp",
+ "HexagonVectorLoopCarriedReuse.cpp",
+ "HexagonVectorPrint.cpp",
+ "HexagonVExtract.cpp",
+ "HexagonVLIWPacketizer.cpp",
+ "RDFCopy.cpp",
+ "RDFDeadCode.cpp",
+ "RDFGraph.cpp",
+ "RDFLiveness.cpp",
+ "RDFRegisters.cpp",
+ ]
+}
+
+# This is a bit different from most build files: Due to this group
+# having the directory's name, "//llvm/lib/Target/Hexagon" 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("Hexagon") {
+ deps = [
+ ":LLVMHexagonCodeGen",
+ "AsmParser",
+ "Disassembler",
+ "MCTargetDesc",
+ "TargetInfo",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/Disassembler/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/Disassembler/BUILD.gn
new file mode 100644
index 00000000000..26ce3d2cff1
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/Disassembler/BUILD.gn
@@ -0,0 +1,22 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("HexagonGenDisassemblerTables") {
+ visibility = [ ":Disassembler" ]
+ args = [ "-gen-disassembler" ]
+ td_file = "../Hexagon.td"
+}
+
+static_library("Disassembler") {
+ output_name = "LLVMHexagonDisassembler"
+ deps = [
+ ":HexagonGenDisassemblerTables",
+ "//llvm/lib/MC/MCDisassembler",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target/Hexagon/MCTargetDesc",
+ "//llvm/lib/Target/Hexagon/TargetInfo",
+ ]
+ include_dirs = [ ".." ]
+ sources = [
+ "HexagonDisassembler.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/MCTargetDesc/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/MCTargetDesc/BUILD.gn
new file mode 100644
index 00000000000..55eb01f2d83
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/MCTargetDesc/BUILD.gn
@@ -0,0 +1,74 @@
+import("//llvm/utils/TableGen/tablegen.gni")
+
+tablegen("HexagonGenAsmWriter") {
+ visibility = [ ":MCTargetDesc" ]
+ args = [ "-gen-asm-writer" ]
+ td_file = "../Hexagon.td"
+}
+
+tablegen("HexagonGenInstrInfo") {
+ visibility = [ ":tablegen" ]
+ args = [ "-gen-instr-info" ]
+ td_file = "../Hexagon.td"
+}
+
+tablegen("HexagonGenMCCodeEmitter") {
+ visibility = [ ":MCTargetDesc" ]
+ args = [ "-gen-emitter" ]
+ td_file = "../Hexagon.td"
+}
+
+tablegen("HexagonGenRegisterInfo") {
+ visibility = [ ":tablegen" ]
+ args = [ "-gen-register-info" ]
+ td_file = "../Hexagon.td"
+}
+
+tablegen("HexagonGenSubtargetInfo") {
+ visibility = [ ":tablegen" ]
+ args = [ "-gen-subtarget" ]
+ td_file = "../Hexagon.td"
+}
+
+group("tablegen") {
+ visibility = [
+ ":MCTargetDesc",
+ "../TargetInfo",
+ ]
+ public_deps = [
+ ":HexagonGenInstrInfo",
+ ":HexagonGenRegisterInfo",
+ ":HexagonGenSubtargetInfo",
+ ]
+}
+
+static_library("MCTargetDesc") {
+ output_name = "LLVMHexagonDesc"
+ public_deps = [
+ ":tablegen",
+ ]
+ deps = [
+ ":HexagonGenAsmWriter",
+ ":HexagonGenMCCodeEmitter",
+ "//llvm/lib/MC",
+ "//llvm/lib/Support",
+ "//llvm/lib/Target/Hexagon/TargetInfo",
+ ]
+ include_dirs = [ ".." ]
+ sources = [
+ "HexagonAsmBackend.cpp",
+ "HexagonELFObjectWriter.cpp",
+ "HexagonInstPrinter.cpp",
+ "HexagonMCAsmInfo.cpp",
+ "HexagonMCChecker.cpp",
+ "HexagonMCCodeEmitter.cpp",
+ "HexagonMCCompound.cpp",
+ "HexagonMCDuplexInfo.cpp",
+ "HexagonMCELFStreamer.cpp",
+ "HexagonMCExpr.cpp",
+ "HexagonMCInstrInfo.cpp",
+ "HexagonMCShuffler.cpp",
+ "HexagonMCTargetDesc.cpp",
+ "HexagonShuffler.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/TargetInfo/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/TargetInfo/BUILD.gn
new file mode 100644
index 00000000000..d9e909052cf
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/TargetInfo/BUILD.gn
@@ -0,0 +1,15 @@
+static_library("TargetInfo") {
+ output_name = "LLVMHexagonInfo"
+ deps = [
+ "//llvm/lib/IR",
+ "//llvm/lib/Support",
+
+ # MCTargetDesc depends on TargetInfo, so we can't depend on the full
+ # MCTargetDesc target here: it would form a cycle.
+ "//llvm/lib/Target/Hexagon/MCTargetDesc:tablegen",
+ ]
+ include_dirs = [ ".." ]
+ sources = [
+ "HexagonTargetInfo.cpp",
+ ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni b/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
index c9959ade5b3..1b3550a5a23 100644
--- a/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
+++ b/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
@@ -23,6 +23,7 @@ if (llvm_targets_to_build == "host") {
"AArch64",
"ARM",
"BPF",
+ "Hexagon",
"Lanai",
"PowerPC",
"Sparc",
@@ -46,6 +47,8 @@ foreach(target, llvm_targets_to_build) {
llvm_build_ARM = true
} else if (target == "BPF") {
llvm_build_BPF = true
+ } else if (target == "Hexagon") {
+ # Nothing to do.
} else if (target == "Lanai") {
# Nothing to do.
} else if (target == "PowerPC") {
OpenPOWER on IntegriCloud