blob: f1c279450fff97d90c5f625e63a4412f40104dd7 [file] [log] [blame] [edit]
load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_filegroup", "td_library")
package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"],
)
exports_files(glob(["include/iree-dialects/Dialect/Input/*.td"]))
exports_files(glob(["python/*.cpp"]))
################################################################################
# Package-by-package filegroup exports.
# Some tools can make use of such non-nested groups.
################################################################################
filegroup(
name = "python_dialects",
srcs = glob(["python/iree/compiler/dialects/**/*.py"]) + [
":python/iree/compiler/dialects/_iree_ops_gen.py",
],
)
################################################################################
# Tablegen exports
################################################################################
filegroup(
name = "TdFilegroup",
srcs = glob([
"include/iree-dialects/Dialect/Input/*.td",
]),
)
td_library(
name = "TdFiles",
srcs = glob([
"include/iree-dialects/Dialect/Input/*.td",
"include/iree-dialects/Dialect/LinalgTransform/*.td",
"python/iree/compiler/dialects/*.td",
]),
includes = ["include"],
deps = [
"@llvm-project//mlir:BuiltinDialectTdFiles",
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:PDLDialectTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles",
"@llvm-project//mlir:TransformDialectTdFiles",
],
)
################################################################################
# IREEInput dialect
################################################################################
gentbl_cc_library(
name = "IREEInputInterfacesIncGen",
tags = ["manual"],
tbl_outs = [
(
["--gen-op-interface-decls"],
"include/iree-dialects/Dialect/Input/InputOpInterfaces.h.inc",
),
(
["--gen-op-interface-defs"],
"include/iree-dialects/Dialect/Input/InputOpInterfaces.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/iree-dialects/Dialect/Input/InputInterfaces.td",
deps = [":TdFiles"],
)
gentbl_cc_library(
name = "IREEInputIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-dialect-decls"],
"include/iree-dialects/Dialect/Input/InputDialect.h.inc",
),
(
["--gen-dialect-defs"],
"include/iree-dialects/Dialect/Input/InputDialect.cpp.inc",
),
(
["--gen-op-decls"],
"include/iree-dialects/Dialect/Input/InputOps.h.inc",
),
(
["--gen-op-defs"],
"include/iree-dialects/Dialect/Input/InputOps.cpp.inc",
),
(
["--gen-typedef-decls"],
"include/iree-dialects/Dialect/Input/InputTypes.h.inc",
),
(
["--gen-typedef-defs"],
"include/iree-dialects/Dialect/Input/InputTypes.cpp.inc",
),
(
["--gen-attrdef-decls"],
"include/iree-dialects/Dialect/Input/InputAttrs.h.inc",
),
(
["--gen-attrdef-defs"],
"include/iree-dialects/Dialect/Input/InputAttrs.cpp.inc",
),
(
["--gen-enum-decls"],
"include/iree-dialects/Dialect/Input/InputEnums.h.inc",
),
(
["--gen-enum-defs"],
"include/iree-dialects/Dialect/Input/InputEnums.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/iree-dialects/Dialect/Input/InputOps.td",
deps = [":TdFiles"],
)
cc_library(
name = "IREEInputDialect",
srcs = glob([
"lib/Dialect/Input/*.cpp",
]),
hdrs = glob(["include/iree-dialects/Dialect/Input/*.h"]),
includes = ["include"],
deps = [
":IREEInputIncGen",
":IREEInputInterfacesIncGen",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:InferTypeOpInterface",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
],
)
gentbl_filegroup(
name = "IREEInputDialectPyGen",
tbl_outs = [
(
[
"--gen-python-op-bindings",
"--bind-dialect=iree",
],
"python/iree/compiler/dialects/_iree_ops_gen.py",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "python/iree/compiler/dialects/IreeInputBinding.td",
deps = [
":TdFiles",
],
)
################################################################################
# IREELinalgTransform Dialect
################################################################################
cc_library(
name = "IREEDialectsTransforms",
srcs = glob([
"lib/Transforms/*.cpp",
]),
hdrs = glob([
"include/iree-dialects/Transforms/*.h",
]),
includes = ["include"],
deps = [
"@llvm-project//llvm:Support",
"@llvm-project//mlir:Analysis",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:FunctionInterfaces",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:Rewrite",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformDialectInterfaces",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:Transforms",
],
)
gentbl_cc_library(
name = "IREELinalgTransformStructuredIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-op-decls"],
"include/iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.h.inc",
),
(
["--gen-op-defs"],
"include/iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/iree-dialects/Dialect/LinalgTransform/StructuredTransformOpsExt.td",
deps = [
":TdFiles",
],
)
cc_library(
name = "IREELinalgTransformDialect",
srcs = glob([
"lib/Dialect/LinalgTransform/IR/*.cpp",
"lib/Dialect/LinalgTransform/IR/*.h",
]),
hdrs = glob([
"include/iree-dialects/Dialect/LinalgTransform/*.h",
]),
includes = ["include"],
deps = [
":IREEDialectsTransforms",
":IREELinalgTransformStructuredIncGen",
"@llvm-project//llvm:Support",
# Dialects
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:AffineUtils",
"@llvm-project//mlir:AsyncDialect",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:BufferizationDialect",
"@llvm-project//mlir:BufferizationTransforms",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:FunctionInterfaces",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:PDLDialect",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFUtils",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TilingInterface",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformDialectInterfaces",
"@llvm-project//mlir:TransformPDLExtension",
# IR
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Rewrite",
# Interfaces
"@llvm-project//mlir:ControlFlowInterfaces",
# Transforms
"@llvm-project//mlir:AffineToStandard",
"@llvm-project//mlir:AsyncTransforms",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MemRefTransforms",
"@llvm-project//mlir:ReconcileUnrealizedCasts",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:TensorTransformOps",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:VectorToSCF",
# Utils
"@llvm-project//mlir:ArithUtils",
"@llvm-project//mlir:DialectUtils",
# Conversions
"@llvm-project//mlir:AsyncToLLVM",
"@llvm-project//mlir:FuncToLLVM",
"@llvm-project//mlir:IndexToLLVM",
"@llvm-project//mlir:LinalgToStandard",
"@llvm-project//mlir:MathToLLVM",
"@llvm-project//mlir:MemRefToLLVM",
"@llvm-project//mlir:SCFToControlFlow",
"@llvm-project//mlir:VectorToLLVM",
],
)
cc_library(
name = "IREELinalgTransformDialectPasses",
srcs = glob([
"lib/Dialect/LinalgTransform/Passes/*.cpp",
]),
deps = [
":IREEDialectsTransforms",
":IREELinalgTransformDialect",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:AffineUtils",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:ArithTransforms",
"@llvm-project//mlir:BufferizationDialect",
"@llvm-project//mlir:BufferizationTransforms",
"@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:FunctionInterfaces",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MathDialect",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:PDLDialect",
"@llvm-project//mlir:PDLInterpDialect",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Rewrite",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:SCFUtils",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TensorTransforms",
"@llvm-project//mlir:TensorUtils",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformDialectInterfaces",
"@llvm-project//mlir:TransformDialectTransforms",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:VectorDialect",
"@llvm-project//mlir:VectorToLLVM",
"@llvm-project//mlir:VectorTransforms",
],
)
################################################################################
# CAPI
################################################################################
cc_library(
name = "CAPI",
srcs = glob(["lib/CAPI/*.cpp"]),
hdrs = glob(["include/iree-dialects-c/*.h"]),
includes = ["include"],
deps = [
":IREEInputDialect",
":IREELinalgTransformDialect",
":IREELinalgTransformDialectPasses",
"@llvm-project//mlir:CAPIIR",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LinalgTransformOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TransformDialect",
],
)
################################################################################
# Test lib
################################################################################
cc_library(
name = "IREEDialectsTest",
srcs = glob([
"test/lib/**/*.cpp",
]),
deps = [
":IREEDialectsTransforms",
":IREELinalgTransformDialect",
":IREELinalgTransformDialectPasses",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Rewrite",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:Transforms",
],
)
################################################################################
# Tools
################################################################################
cc_binary(
name = "iree-dialects-opt",
srcs = [
"tools/iree-dialects-opt/iree-dialects-opt.cpp",
],
tags = ["hostonly"],
deps = [
":IREEDialectsTest",
":IREEInputDialect",
":IREELinalgTransformDialect",
":IREELinalgTransformDialectPasses",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:ArithDialect",
"@llvm-project//mlir:AsyncDialect",
"@llvm-project//mlir:BufferizationTransformOps",
"@llvm-project//mlir:ControlFlowDialect",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:FuncExtensions",
"@llvm-project//mlir:FunctionInterfaces",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:LLVMDialect",
"@llvm-project//mlir:LLVMIRTransforms",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LinalgTransformOps",
"@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MemRefTransforms",
"@llvm-project//mlir:MlirOptLib",
"@llvm-project//mlir:PDLDialect",
"@llvm-project//mlir:PDLInterpDialect",
"@llvm-project//mlir:SCFDialect",
"@llvm-project//mlir:SCFTransformOps",
"@llvm-project//mlir:SCFTransforms",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TensorTransformOps",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformPDLExtension",
"@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:VectorTransformOps",
],
)