Adopt td_library
This avoids needing to list all transitive include dependencies and tracks include directories. PiperOrigin-RevId: 360779798
This commit is contained in:
parent
5eac983723
commit
50a516fb9c
148
BUILD
148
BUILD
|
@ -1,39 +1,30 @@
|
||||||
load("@llvm-project//mlir:tblgen.bzl", "gentbl")
|
load("@llvm-project//mlir:tblgen.bzl", "gentbl", "td_library")
|
||||||
|
|
||||||
package(
|
package(
|
||||||
default_visibility = ["//visibility:public"],
|
default_visibility = ["//visibility:public"],
|
||||||
licenses = ["notice"], # Apache 2.0
|
licenses = ["notice"], # Apache 2.0
|
||||||
)
|
)
|
||||||
|
|
||||||
exports_files(["include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td"])
|
exports_files([
|
||||||
|
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td",
|
||||||
|
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td",
|
||||||
|
])
|
||||||
|
|
||||||
exports_files(["include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td"])
|
td_library(
|
||||||
|
|
||||||
filegroup(
|
|
||||||
name = "hlo_ops_td_files",
|
name = "hlo_ops_td_files",
|
||||||
srcs = [
|
srcs = glob(["include/mlir-hlo/Dialect/mhlo/IR/*.td"]) + [
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/chlo_ops.td",
|
# TODO(gcmn): These should be encapsulate in a td_library.
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops_base.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops_base_enums.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops_base_structs.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_utils.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/infer_fusibility_op_interface.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops_base.td",
|
|
||||||
"@llvm-project//mlir:OpBaseTdFiles",
|
|
||||||
"@llvm-project//mlir:SideEffectTdFiles",
|
|
||||||
"@llvm-project//mlir:include/mlir/Interfaces/CopyOpInterface.td",
|
"@llvm-project//mlir:include/mlir/Interfaces/CopyOpInterface.td",
|
||||||
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
|
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
|
||||||
"@llvm-project//mlir:include/mlir/Interfaces/LoopLikeInterface.td",
|
"@llvm-project//mlir:include/mlir/Interfaces/LoopLikeInterface.td",
|
||||||
"@llvm-project//mlir:include/mlir/Interfaces/ViewLikeInterface.td",
|
"@llvm-project//mlir:include/mlir/Interfaces/ViewLikeInterface.td",
|
||||||
|
"@llvm-project//mlir:include/mlir/Dialect/Shape/IR/ShapeBase.td",
|
||||||
|
"@llvm-project//mlir:include/mlir/Dialect/Shape/IR/ShapeOps.td",
|
||||||
],
|
],
|
||||||
)
|
includes = ["include"],
|
||||||
|
deps = [
|
||||||
filegroup(
|
"@llvm-project//mlir:OpBaseTdFiles",
|
||||||
name = "hlo_ops_base_td",
|
"@llvm-project//mlir:SideEffectTdFiles",
|
||||||
srcs = [
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_ops_base.td",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -52,7 +43,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_srcs = [
|
deps = [
|
||||||
"@llvm-project//mlir:PassBaseTdFiles",
|
"@llvm-project//mlir:PassBaseTdFiles",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -72,7 +63,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_srcs = [
|
deps = [
|
||||||
"@llvm-project//mlir:PassBaseTdFiles",
|
"@llvm-project//mlir:PassBaseTdFiles",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -90,10 +81,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -108,16 +96,8 @@ gentbl(
|
||||||
td_includes = [
|
td_includes = [
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/hlo_utils.td",
|
|
||||||
],
|
|
||||||
td_relative_includes = [
|
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_base_td",
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
|
|
||||||
],
|
],
|
||||||
|
deps = [":hlo_ops_td_files"],
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -133,10 +113,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -151,10 +128,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -169,10 +143,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -190,14 +161,9 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
":hlo_ops_td_files",
|
||||||
"@llvm-project//mlir:StdOpsTdFiles",
|
"@llvm-project//mlir:StdOpsTdFiles",
|
||||||
"@llvm-project//mlir:include/mlir/Dialect/Shape/IR/ShapeBase.td",
|
|
||||||
"@llvm-project//mlir:include/mlir/Dialect/Shape/IR/ShapeOps.td",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -214,13 +180,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_dialect.td",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -236,14 +196,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops_structs.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_dialect.td",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -259,13 +212,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops_base.td",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -281,10 +228,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
|
@ -335,15 +279,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops_base.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops_structs.td",
|
|
||||||
"include/mlir-hlo/Dialect/mhlo/IR/lhlo_gpu_ops_enums.td",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#TODO(aminim): revisit the naming and grouping of these rules post-move.
|
#TODO(aminim): revisit the naming and grouping of these rules post-move.
|
||||||
|
@ -359,10 +295,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [":hlo_ops_td_files"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gentbl(
|
gentbl(
|
||||||
|
@ -383,12 +316,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
|
@ -835,10 +763,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
":hlo_ops_td_files",
|
||||||
"@llvm-project//mlir:StdOpsTdFiles",
|
"@llvm-project//mlir:StdOpsTdFiles",
|
||||||
],
|
],
|
||||||
|
@ -929,12 +854,8 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
":hlo_ops_td_files",
|
||||||
"@llvm-project//llvm:Support",
|
|
||||||
"@llvm-project//mlir:StdOpsTdFiles",
|
"@llvm-project//mlir:StdOpsTdFiles",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -1032,12 +953,7 @@ gentbl(
|
||||||
"external/mlir-hlo/include",
|
"external/mlir-hlo/include",
|
||||||
"include",
|
"include",
|
||||||
],
|
],
|
||||||
td_relative_includes = [
|
deps = [":hlo_ops_td_files"],
|
||||||
"include",
|
|
||||||
],
|
|
||||||
td_srcs = [
|
|
||||||
":hlo_ops_td_files",
|
|
||||||
],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
|
|
Loading…
Reference in New Issue