blob: e1cbe546f6d0a14aa6cd7dda31442fa298e046dd [file] [log] [blame]
# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("//build_tools/bazel:iree_tablegen_doc.bzl", "iree_tablegen_doc")
load("//build_tools/bazel:tblgen.bzl", "gentbl_cc_library")
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)
filegroup(
name = "td_files",
srcs = enforce_glob(
[
"FlowBase.td",
"FlowInterfaces.td",
"FlowOps.td",
],
include = ["*.td"],
),
)
cc_library(
name = "IR",
srcs = [
"FlowDialect.cpp",
"FlowEnums.cpp.inc",
"FlowInterfaces.cpp.inc",
"FlowOpFolders.cpp",
"FlowOpUtils.cpp",
"FlowOps.cpp",
"FlowOps.cpp.inc",
"FlowTypes.cpp",
],
hdrs = [
"FlowDialect.h",
"FlowEnums.h.inc",
"FlowInterfaces.h.inc",
"FlowOpUtils.h",
"FlowOps.h",
"FlowOps.h.inc",
"FlowTypes.h",
],
deps = [
":FlowEnumsGen",
":FlowInterfacesGen",
":FlowOpsGen",
"//iree/compiler/Dialect/IREE/IR",
"//iree/compiler/Dialect/Shape/IR",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:InferTypeOpInterface",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:SideEffects",
"@llvm-project//mlir:StandardOps",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TensorDialect",
"@llvm-project//mlir:TransformUtils",
],
)
gentbl_cc_library(
name = "FlowEnumsGen",
tbl_outs = [
(
["-gen-enum-decls"],
"FlowEnums.h.inc",
),
(
["-gen-enum-defs"],
"FlowEnums.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "FlowBase.td",
td_srcs = [
":td_files",
"//iree/compiler/Dialect/IREE/IR:td_files",
"//iree/compiler/Dialect/Shape/IR:td_files",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:StdOpsTdFiles",
"@llvm-project//mlir:ViewLikeInterfaceTdFiles",
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
],
)
gentbl_cc_library(
name = "FlowInterfacesGen",
tbl_outs = [
(
["-gen-op-interface-decls"],
"FlowInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"FlowInterfaces.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "FlowInterfaces.td",
td_srcs = [
":td_files",
"//iree/compiler/Dialect/IREE/IR:td_files",
"//iree/compiler/Dialect/Shape/IR:td_files",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:StdOpsTdFiles",
"@llvm-project//mlir:ViewLikeInterfaceTdFiles",
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
],
)
gentbl_cc_library(
name = "FlowOpsGen",
tbl_outs = [
(
["-gen-op-decls"],
"FlowOps.h.inc",
),
(
["-gen-op-defs"],
"FlowOps.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "FlowOps.td",
td_srcs = [
":td_files",
"//iree/compiler/Dialect/IREE/IR:td_files",
"//iree/compiler/Dialect/Shape/IR:td_files",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:SideEffectTdFiles",
"@llvm-project//mlir:StdOpsTdFiles",
"@llvm-project//mlir:ViewLikeInterfaceTdFiles",
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
],
)
iree_tablegen_doc(
name = "FlowDialectDocGen",
tbl_outs = [
(
["-gen-dialect-doc"],
"FlowDialect.md",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "FlowOps.td",
td_srcs = [
":td_files",
"//iree/compiler/Dialect/IREE/IR:td_files",
"//iree/compiler/Dialect/Shape/IR:td_files",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:SideEffectTdFiles",
"@llvm-project//mlir:StdOpsTdFiles",
"@llvm-project//mlir:ViewLikeInterfaceTdFiles",
"@llvm-project//mlir:include/mlir/Interfaces/InferTypeOpInterface.td",
],
)