Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12094 lines
300 KiB
Python
Raw Normal View History

# This file is 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
# Description:
# The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load(":tblgen.bzl", "gentbl_cc_library", "td_library")
load(":linalggen.bzl", "genlinalg")
load(
":build_defs.bzl",
"cc_headers_only",
"if_cuda_available",
"mlir_c_api_cc_library",
)
package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
)
licenses(["notice"])
exports_files([
"LICENSE.TXT",
"run_lit.sh",
"utils/textmate/mlir.json",
])
expand_template(
name = "mlir_config_h_gen",
out = "include/mlir/Config/mlir-config.h",
substitutions = {
"#cmakedefine01 MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS": "#define MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS 0",
"#cmakedefine MLIR_GREEDY_REWRITE_RANDOMIZER_SEED ${MLIR_GREEDY_REWRITE_RANDOMIZER_SEED}": "/* #undef MLIR_GREEDY_REWRITE_RANDOMIZER_SEED */",
},
template = "include/mlir/Config/mlir-config.h.cmake",
)
cc_library(
name = "config",
hdrs = [
"include/mlir/Config/mlir-config.h",
],
)
filegroup(
name = "c_headers",
srcs = glob(["include/mlir-c/**/*"]), # <== i.e. match the entire tree
)
exports_files(glob(["include/**/*.td"]))
[
gentbl_cc_library(
name = name + "IncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/IR/" + name + ".h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/IR/" + name + ".cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/" + name + ".td",
deps = [":OpBaseTdFiles"],
)
for name in [
"OpAsmInterface",
"RegionKindInterface",
"SymbolInterfaces",
]
]
gentbl_cc_library(
name = "TensorEncodingIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attr-interface-decls"],
"include/mlir/IR/TensorEncInterfaces.h.inc",
),
(
["-gen-attr-interface-defs"],
"include/mlir/IR/TensorEncInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/TensorEncoding.td",
deps = [":TensorOpsTdFiles"],
)
td_library(
name = "BuiltinDialectTdFiles",
srcs = [
[mlir] Refactor ElementsAttr into an AttrInterface This revision refactors ElementsAttr into an Attribute Interface. This enables a common interface with which to interact with element attributes, without needing to modify the builtin dialect. It also removes a majority (if not all?) of the need for the current OpaqueElementsAttr, which was originally intended as a way to opaquely represent data that was not representable by the other builtin constructs. The new ElementsAttr interface not only allows for users to natively represent their data in the way that best suits them, it also allows for efficient opaque access and iteration of the underlying data. Attributes using the ElementsAttr interface can directly expose support for interacting with the held elements using any C++ data type they claim to support. For example, DenseIntOrFpElementsAttr supports iteration using various native C++ integer/float data types, as well as APInt/APFloat, and more. ElementsAttr instances that refer to DenseIntOrFpElementsAttr can use all of these data types for iteration: ```c++ DenseIntOrFpElementsAttr intElementsAttr = ...; ElementsAttr attr = intElementsAttr; for (uint64_t value : attr.getValues<uint64_t>()) ...; for (APInt value : attr.getValues<APInt>()) ...; for (IntegerAttr value : attr.getValues<IntegerAttr>()) ...; ``` ElementsAttr also supports failable range/iterator access, allowing for selective code paths depending on data type support: ```c++ ElementsAttr attr = ...; if (auto range = attr.tryGetValues<uint64_t>()) { for (uint64_t value : *range) ...; } ``` Differential Revision: https://reviews.llvm.org/D109190
2021-09-21 01:40:45 +00:00
"include/mlir/IR/BuiltinAttributeInterfaces.td",
"include/mlir/IR/BuiltinAttributes.td",
"include/mlir/IR/BuiltinDialect.td",
"include/mlir/IR/BuiltinLocationAttributes.td",
"include/mlir/IR/BuiltinOps.td",
"include/mlir/IR/BuiltinTypeInterfaces.td",
"include/mlir/IR/BuiltinTypes.td",
],
includes = ["include"],
deps = [
":BytecodeTdFiles",
":CallInterfacesTdFiles",
":CastInterfacesTdFiles",
":DataLayoutInterfacesTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
td_library(
name = "BuiltinDialectBytecodeTdFiles",
srcs = ["include/mlir/IR/BuiltinDialectBytecode.td"],
includes = ["include"],
deps = [
":BytecodeTdFiles",
],
)
gentbl_cc_library(
name = "BuiltinDialectIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-dialect-decls"],
"include/mlir/IR/BuiltinDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/IR/BuiltinDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinDialect.td",
deps = [":BuiltinDialectTdFiles"],
)
gentbl_cc_library(
name = "BuiltinDialectBytecodeGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-bytecode",
"-bytecode-dialect=Builtin",
],
"include/mlir/IR/BuiltinDialectBytecode.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinDialectBytecode.td",
deps = [":BuiltinDialectTdFiles"],
)
gentbl_cc_library(
name = "BuiltinAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attrdef-decls"],
"include/mlir/IR/BuiltinAttributes.h.inc",
),
(
["--gen-attrdef-defs"],
"include/mlir/IR/BuiltinAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinAttributes.td",
deps = [":BuiltinDialectTdFiles"],
)
[mlir] Refactor ElementsAttr into an AttrInterface This revision refactors ElementsAttr into an Attribute Interface. This enables a common interface with which to interact with element attributes, without needing to modify the builtin dialect. It also removes a majority (if not all?) of the need for the current OpaqueElementsAttr, which was originally intended as a way to opaquely represent data that was not representable by the other builtin constructs. The new ElementsAttr interface not only allows for users to natively represent their data in the way that best suits them, it also allows for efficient opaque access and iteration of the underlying data. Attributes using the ElementsAttr interface can directly expose support for interacting with the held elements using any C++ data type they claim to support. For example, DenseIntOrFpElementsAttr supports iteration using various native C++ integer/float data types, as well as APInt/APFloat, and more. ElementsAttr instances that refer to DenseIntOrFpElementsAttr can use all of these data types for iteration: ```c++ DenseIntOrFpElementsAttr intElementsAttr = ...; ElementsAttr attr = intElementsAttr; for (uint64_t value : attr.getValues<uint64_t>()) ...; for (APInt value : attr.getValues<APInt>()) ...; for (IntegerAttr value : attr.getValues<IntegerAttr>()) ...; ``` ElementsAttr also supports failable range/iterator access, allowing for selective code paths depending on data type support: ```c++ ElementsAttr attr = ...; if (auto range = attr.tryGetValues<uint64_t>()) { for (uint64_t value : *range) ...; } ``` Differential Revision: https://reviews.llvm.org/D109190
2021-09-21 01:40:45 +00:00
gentbl_cc_library(
name = "BuiltinAttributeInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attr-interface-decls"],
"include/mlir/IR/BuiltinAttributeInterfaces.h.inc",
),
(
["--gen-attr-interface-defs"],
"include/mlir/IR/BuiltinAttributeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinAttributeInterfaces.td",
deps = [":BuiltinDialectTdFiles"],
)
gentbl_cc_library(
name = "BuiltinLocationAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attrdef-decls"],
"include/mlir/IR/BuiltinLocationAttributes.h.inc",
),
(
["--gen-attrdef-defs"],
"include/mlir/IR/BuiltinLocationAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinLocationAttributes.td",
deps = [":BuiltinDialectTdFiles"],
)
gentbl_cc_library(
name = "BuiltinOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/IR/BuiltinOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/IR/BuiltinOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinOps.td",
2022-01-19 14:14:36 +01:00
deps = [
":BuiltinDialectTdFiles",
":FunctionInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "BuiltinTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-typedef-decls"],
"include/mlir/IR/BuiltinTypes.h.inc",
),
(
["--gen-typedef-defs"],
"include/mlir/IR/BuiltinTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinTypes.td",
deps = [":BuiltinDialectTdFiles"],
)
gentbl_cc_library(
name = "BuiltinTypeInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-type-interface-decls"],
"include/mlir/IR/BuiltinTypeInterfaces.h.inc",
),
(
["--gen-type-interface-defs"],
"include/mlir/IR/BuiltinTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/BuiltinTypeInterfaces.td",
2022-01-19 14:14:36 +01:00
deps = [
":BuiltinDialectTdFiles",
],
)
td_library(
name = "FunctionInterfacesTdFiles",
srcs = ["include/mlir/IR/FunctionInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "FunctionInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/IR/FunctionOpInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/IR/FunctionOpInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/IR/FunctionInterfaces.td",
deps = [
":OpBaseTdFiles",
],
)
cc_library(
name = "IR",
srcs = glob([
"lib/IR/*.cpp",
"lib/IR/*.h",
"lib/Bytecode/Reader/*.h",
"lib/Bytecode/Writer/*.h",
"lib/Bytecode/*.h",
]) + [
"lib/Bytecode/BytecodeOpInterface.cpp",
],
hdrs = glob([
"include/mlir/IR/*.h",
"include/mlir/Bytecode/*.h",
]) + [
"include/mlir/Interfaces/CallInterfaces.h",
"include/mlir/Interfaces/DataLayoutInterfaces.h",
"include/mlir/Interfaces/FoldInterfaces.h",
"include/mlir/Interfaces/SideEffectInterfaces.h",
],
includes = ["include"],
deps = [
[mlir] Refactor ElementsAttr into an AttrInterface This revision refactors ElementsAttr into an Attribute Interface. This enables a common interface with which to interact with element attributes, without needing to modify the builtin dialect. It also removes a majority (if not all?) of the need for the current OpaqueElementsAttr, which was originally intended as a way to opaquely represent data that was not representable by the other builtin constructs. The new ElementsAttr interface not only allows for users to natively represent their data in the way that best suits them, it also allows for efficient opaque access and iteration of the underlying data. Attributes using the ElementsAttr interface can directly expose support for interacting with the held elements using any C++ data type they claim to support. For example, DenseIntOrFpElementsAttr supports iteration using various native C++ integer/float data types, as well as APInt/APFloat, and more. ElementsAttr instances that refer to DenseIntOrFpElementsAttr can use all of these data types for iteration: ```c++ DenseIntOrFpElementsAttr intElementsAttr = ...; ElementsAttr attr = intElementsAttr; for (uint64_t value : attr.getValues<uint64_t>()) ...; for (APInt value : attr.getValues<APInt>()) ...; for (IntegerAttr value : attr.getValues<IntegerAttr>()) ...; ``` ElementsAttr also supports failable range/iterator access, allowing for selective code paths depending on data type support: ```c++ ElementsAttr attr = ...; if (auto range = attr.tryGetValues<uint64_t>()) { for (uint64_t value : *range) ...; } ``` Differential Revision: https://reviews.llvm.org/D109190
2021-09-21 01:40:45 +00:00
":BuiltinAttributeInterfacesIncGen",
":BuiltinAttributesIncGen",
":BuiltinDialectBytecodeGen",
":BuiltinDialectIncGen",
":BuiltinLocationAttributesIncGen",
":BuiltinOpsIncGen",
":BuiltinTypeInterfacesIncGen",
":BuiltinTypesIncGen",
":BytecodeOpInterfaceIncGen",
":CallOpInterfacesIncGen",
":DataLayoutInterfacesIncGen",
2022-01-19 14:14:36 +01:00
":FunctionInterfacesIncGen",
":InferTypeOpInterfaceIncGen",
":OpAsmInterfaceIncGen",
":RegionKindInterfaceIncGen",
":SideEffectInterfacesIncGen",
":Support",
":SymbolInterfacesIncGen",
":TensorEncodingIncGen",
"//llvm:Support",
],
)
cc_library(
name = "Pass",
srcs = glob([
"lib/Pass/*.cpp",
"lib/Pass/*.h",
]),
hdrs = glob([
"include/mlir/Pass/*.h",
]),
includes = ["include"],
deps = [
":IR",
":Parser",
":Support",
"//llvm:Support",
],
)
mlir_c_api_cc_library(
name = "CAPIIR",
srcs = [
2022-03-02 00:07:56 +01:00
"lib/CAPI/Dialect/Func.cpp",
"lib/CAPI/IR/AffineExpr.cpp",
"lib/CAPI/IR/AffineMap.cpp",
"lib/CAPI/IR/BuiltinAttributes.cpp",
"lib/CAPI/IR/BuiltinTypes.cpp",
"lib/CAPI/IR/Diagnostics.cpp",
"lib/CAPI/IR/DialectHandle.cpp",
"lib/CAPI/IR/IR.cpp",
"lib/CAPI/IR/IntegerSet.cpp",
"lib/CAPI/IR/Pass.cpp",
"lib/CAPI/IR/Support.cpp",
],
hdrs = [
"include/mlir-c/AffineExpr.h",
"include/mlir-c/AffineMap.h",
"include/mlir-c/BuiltinAttributes.h",
"include/mlir-c/BuiltinTypes.h",
"include/mlir-c/Diagnostics.h",
2022-03-02 00:07:56 +01:00
"include/mlir-c/Dialect/Func.h",
"include/mlir-c/ExecutionEngine.h",
"include/mlir-c/IR.h",
"include/mlir-c/IntegerSet.h",
"include/mlir-c/Interfaces.h",
"include/mlir-c/Pass.h",
[mlir] Overhaul C/Python registration APIs to properly scope registration/loading activities. Since the very first commits, the Python and C MLIR APIs have had mis-placed registration/load functionality for dialects, extensions, etc. This was done pragmatically in order to get bootstrapped and then just grew in. Downstreams largely bypass and do their own thing by providing various APIs to register things they need. Meanwhile, the C++ APIs have stabilized around this and it would make sense to follow suit. The thing we have observed in canonical usage by downstreams is that each downstream tends to have native entry points that configure its installation to its preferences with one-stop APIs. This patch leans in to this approach with `RegisterEverything.h` and `mlir._mlir_libs._mlirRegisterEverything` being the one-stop entry points for the "upstream packages". The `_mlir_libs.__init__.py` now allows customization of the environment and Context by adding "initialization modules" to the `_mlir_libs` package. If present, `_mlirRegisterEverything` is treated as such a module. Others can be added by downstreams by adding a `_site_initialize_{i}.py` module, where '{i}' is a number starting with zero. The number will be incremented and corresponding module loaded until one is not found. Initialization modules can: * Perform load time customization to the global environment (i.e. registering passes, hooks, etc). * Define a `register_dialects(registry: DialectRegistry)` function that can extend the `DialectRegistry` that will be used to bootstrap the `Context`. * Define a `context_init_hook(context: Context)` function that will be added to a list of callbacks which will be invoked after dialect registration during `Context` initialization. Note that the `MLIRPythonExtension.RegisterEverything` is not included by default when building a downstream (its corresponding behavior was prior). For downstreams which need the default MLIR initialization to take place, they must add this back in to their Python CMake build just like they add their own components (i.e. to `add_mlir_python_common_capi_library` and `add_mlir_python_modules`). It is perfectly valid to not do this, in which case, only the things explicitly depended on and initialized by downstreams will be built/packaged. If the downstream has not been set up for this, it is recommended to simply add this back for the time being and pay the build time/package size cost. CMake changes: * `MLIRCAPIRegistration` -> `MLIRCAPIRegisterEverything` (renamed to signify what it does and force an evaluation: a number of places were incidentally linking this very expensive target) * `MLIRPythonSoure.Passes` removed (without replacement: just drop) * `MLIRPythonExtension.AllPassesRegistration` removed (without replacement: just drop) * `MLIRPythonExtension.Conversions` removed (without replacement: just drop) * `MLIRPythonExtension.Transforms` removed (without replacement: just drop) Header changes: * `mlir-c/Registration.h` is deleted. Dialect registration functionality is now in `IR.h`. Registration of upstream features are in `mlir-c/RegisterEverything.h`. When updating MLIR and a couple of downstreams, I found that proper usage was commingled so required making a choice vs just blind S&R. Python APIs removed: * mlir.transforms and mlir.conversions (previously only had an __init__.py which indirectly triggered `mlirRegisterTransformsPasses()` and `mlirRegisterConversionPasses()` respectively). Downstream impact: Remove these imports if present (they now happen as part of default initialization). * mlir._mlir_libs._all_passes_registration, mlir._mlir_libs._mlirTransforms, mlir._mlir_libs._mlirConversions. Downstream impact: None expected (these were internally used). C-APIs changed: * mlirRegisterAllDialects(MlirContext) now takes an MlirDialectRegistry instead. It also used to trigger loading of all dialects, which was already marked with a TODO to remove -- it no longer does, and for direct use, dialects must be explicitly loaded. Downstream impact: Direct C-API users must ensure that needed dialects are loaded or call `mlirContextLoadAllAvailableDialects(MlirContext)` to emulate the prior behavior. Also see the `ir.c` test case (e.g. ` mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("func"));`). * mlirDialectHandle* APIs were moved from Registration.h (which now is restricted to just global/upstream registration) to IR.h, arguably where it should have been. Downstream impact: include correct header (likely already doing so). C-APIs added: * mlirContextLoadAllAvailableDialects(MlirContext): Corresponds to C++ API with the same purpose. Python APIs added: * mlir.ir.DialectRegistry: Mapping for an MlirDialectRegistry. * mlir.ir.Context.append_dialect_registry(MlirDialectRegistry) * mlir.ir.Context.load_all_available_dialects() * mlir._mlir_libs._mlirAllRegistration: New native extension that exposes a `register_dialects(MlirDialectRegistry)` entry point and performs all upstream pass/conversion/transforms registration on init. In this first step, we eagerly load this as part of the __init__.py and use it to monkey patch the Context to emulate prior behavior. * Type caster and capsule support for MlirDialectRegistry This should make it possible to build downstream Python dialects that only depend on a subset of MLIR. See: https://github.com/llvm/llvm-project/issues/56037 Here is an example PR, minimally adapting IREE to these changes: https://github.com/iree-org/iree/pull/9638/files In this situation, IREE is opting to not link everything, since it is already configuring the Context to its liking. For projects that would just like to not think about it and pull in everything, add `MLIRPythonExtension.RegisterEverything` to the list of Python sources getting built, and the old behavior will continue. Reviewed By: mehdi_amini, ftynse Differential Revision: https://reviews.llvm.org/D128593
2022-07-16 16:09:03 -07:00
"include/mlir-c/RegisterEverything.h",
"include/mlir-c/Support.h",
"include/mlir/CAPI/AffineExpr.h",
"include/mlir/CAPI/AffineMap.h",
"include/mlir/CAPI/Diagnostics.h",
"include/mlir/CAPI/IR.h",
"include/mlir/CAPI/IntegerSet.h",
"include/mlir/CAPI/Interfaces.h",
"include/mlir/CAPI/Pass.h",
"include/mlir/CAPI/Registration.h",
"include/mlir/CAPI/Support.h",
"include/mlir/CAPI/Utils.h",
"include/mlir/CAPI/Wrap.h",
],
header_deps = [
":BytecodeWriter",
":IR",
":Pass",
":Support",
"//llvm:Support",
],
includes = ["include"],
deps = [
":AsmParser",
":ConversionPassIncGen",
":FuncDialect",
":InferTypeOpInterface",
":Parser",
],
)
mlir_c_api_cc_library(
name = "CAPIInterfaces",
srcs = [
"lib/CAPI/Interfaces/Interfaces.cpp",
],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":IR",
":InferTypeOpInterface",
"//llvm:Support",
],
)
mlir_c_api_cc_library(
name = "CAPIArith",
srcs = ["lib/CAPI/Dialect/Arith.cpp"],
hdrs = ["include/mlir-c/Dialect/Arith.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":ArithDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIAsync",
srcs = [
"lib/CAPI/Dialect/Async.cpp",
"lib/CAPI/Dialect/AsyncPasses.cpp",
],
hdrs = ["include/mlir-c/Dialect/Async.h"],
capi_deps = [
":CAPIIR",
],
header_deps = [
":AsyncPassIncGen",
],
includes = ["include"],
deps = [
":AsyncDialect",
":AsyncTransforms",
":Pass",
],
)
mlir_c_api_cc_library(
name = "CAPILinalg",
srcs = [
"lib/CAPI/Dialect/Linalg.cpp",
"lib/CAPI/Dialect/LinalgPasses.cpp",
],
hdrs = [
"include/mlir-c/Dialect/Linalg.h",
],
capi_deps = [
":CAPIIR",
],
header_deps = [
":LinalgPassIncGen",
],
includes = ["include"],
deps = [
":LinalgDialect",
":LinalgTransforms",
":Pass",
],
)
mlir_c_api_cc_library(
name = "CAPILLVM",
srcs = [
"lib/CAPI/Dialect/LLVM.cpp",
],
hdrs = [
"include/mlir-c/Dialect/LLVM.h",
],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":LLVMDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIMath",
srcs = ["lib/CAPI/Dialect/Math.cpp"],
hdrs = ["include/mlir-c/Dialect/Math.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":MathDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIMemRef",
srcs = ["lib/CAPI/Dialect/MemRef.cpp"],
hdrs = ["include/mlir-c/Dialect/MemRef.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":MemRefDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIGPU",
srcs = [
"lib/CAPI/Dialect/GPU.cpp",
"lib/CAPI/Dialect/GPUPasses.cpp",
],
hdrs = [
"include/mlir-c/Dialect/GPU.h",
],
capi_deps = [
":CAPIIR",
],
header_deps = [
":GPUPassIncGen",
],
includes = ["include"],
deps = [
":GPUDialect",
":GPUTransforms",
":Pass",
],
)
mlir_c_api_cc_library(
name = "CAPISparseTensor",
srcs = [
"lib/CAPI/Dialect/SparseTensor.cpp",
"lib/CAPI/Dialect/SparseTensorPasses.cpp",
],
hdrs = [
"include/mlir-c/Dialect/SparseTensor.h",
],
capi_deps = [
":CAPIIR",
],
header_deps = [
":SparseTensorPassIncGen",
],
includes = ["include"],
deps = [
":Pass",
":SparseTensorDialect",
":SparseTensorTransforms",
":Support",
],
)
mlir_c_api_cc_library(
name = "CAPIQuant",
srcs = [
"lib/CAPI/Dialect/Quant.cpp",
],
hdrs = [
"include/mlir-c/Dialect/Quant.h",
],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":QuantOps",
],
)
mlir_c_api_cc_library(
name = "CAPIPDL",
srcs = [
"lib/CAPI/Dialect/PDL.cpp",
],
hdrs = [
"include/mlir-c/Dialect/PDL.h",
],
header_deps = [
":CAPIIRHeaders",
],
includes = ["include"],
deps = [
":CAPIIR",
":PDLDialect",
":PDLOpsIncGen",
":PDLTypesIncGen",
],
)
mlir_c_api_cc_library(
name = "CAPITransformDialect",
srcs = [
"lib/CAPI/Dialect/Transform.cpp",
],
hdrs = [
"include/mlir-c/Dialect/Transform.h",
],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":TransformDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIMLProgram",
srcs = [
"lib/CAPI/Dialect/MLProgram.cpp",
],
hdrs = [
"include/mlir-c/Dialect/MLProgram.h",
],
header_deps = [
":CAPIIRHeaders",
],
includes = ["include"],
deps = [
":CAPIIR",
":MLProgramDialect",
":MLProgramOpsIncGen",
":MLProgramTypesIncGen",
],
)
mlir_c_api_cc_library(
name = "CAPIVector",
srcs = ["lib/CAPI/Dialect/Vector.cpp"],
hdrs = ["include/mlir-c/Dialect/Vector.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":VectorDialect",
],
)
mlir_c_api_cc_library(
name = "CAPIConversion",
srcs = ["lib/CAPI/Conversion/Passes.cpp"],
hdrs = ["include/mlir-c/Conversion.h"],
capi_deps = [
":CAPIIR",
],
header_deps = [
":ConversionPassIncGen",
],
includes = ["include"],
deps = [
":ConversionPasses",
":Pass",
],
)
mlir_c_api_cc_library(
name = "CAPIDebug",
srcs = ["lib/CAPI/Debug/Debug.cpp"],
hdrs = ["include/mlir-c/Debug.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":Support",
"//llvm:Support",
],
)
mlir_c_api_cc_library(
name = "CAPIExecutionEngine",
srcs = ["lib/CAPI/ExecutionEngine/ExecutionEngine.cpp"],
hdrs = [
"include/mlir-c/ExecutionEngine.h",
"include/mlir/CAPI/ExecutionEngine.h",
],
capi_deps = [
":CAPIIR",
],
header_deps = [
":ExecutionEngine",
],
includes = ["include"],
deps = [
":BuiltinToLLVMIRTranslation",
":ExecutionEngineUtils",
":LLVMToLLVMIRTranslation",
":OpenMPToLLVMIRTranslation",
"//llvm:OrcJIT",
"//llvm:Support",
],
)
mlir_c_api_cc_library(
name = "CAPITransforms",
srcs = ["lib/CAPI/Transforms/Passes.cpp"],
hdrs = ["include/mlir-c/Transforms.h"],
capi_deps = [
":CAPIIR",
],
header_deps = [
":TransformsPassIncGen",
],
includes = ["include"],
deps = [
":Pass",
":Transforms",
],
)
mlir_c_api_cc_library(
[mlir] Overhaul C/Python registration APIs to properly scope registration/loading activities. Since the very first commits, the Python and C MLIR APIs have had mis-placed registration/load functionality for dialects, extensions, etc. This was done pragmatically in order to get bootstrapped and then just grew in. Downstreams largely bypass and do their own thing by providing various APIs to register things they need. Meanwhile, the C++ APIs have stabilized around this and it would make sense to follow suit. The thing we have observed in canonical usage by downstreams is that each downstream tends to have native entry points that configure its installation to its preferences with one-stop APIs. This patch leans in to this approach with `RegisterEverything.h` and `mlir._mlir_libs._mlirRegisterEverything` being the one-stop entry points for the "upstream packages". The `_mlir_libs.__init__.py` now allows customization of the environment and Context by adding "initialization modules" to the `_mlir_libs` package. If present, `_mlirRegisterEverything` is treated as such a module. Others can be added by downstreams by adding a `_site_initialize_{i}.py` module, where '{i}' is a number starting with zero. The number will be incremented and corresponding module loaded until one is not found. Initialization modules can: * Perform load time customization to the global environment (i.e. registering passes, hooks, etc). * Define a `register_dialects(registry: DialectRegistry)` function that can extend the `DialectRegistry` that will be used to bootstrap the `Context`. * Define a `context_init_hook(context: Context)` function that will be added to a list of callbacks which will be invoked after dialect registration during `Context` initialization. Note that the `MLIRPythonExtension.RegisterEverything` is not included by default when building a downstream (its corresponding behavior was prior). For downstreams which need the default MLIR initialization to take place, they must add this back in to their Python CMake build just like they add their own components (i.e. to `add_mlir_python_common_capi_library` and `add_mlir_python_modules`). It is perfectly valid to not do this, in which case, only the things explicitly depended on and initialized by downstreams will be built/packaged. If the downstream has not been set up for this, it is recommended to simply add this back for the time being and pay the build time/package size cost. CMake changes: * `MLIRCAPIRegistration` -> `MLIRCAPIRegisterEverything` (renamed to signify what it does and force an evaluation: a number of places were incidentally linking this very expensive target) * `MLIRPythonSoure.Passes` removed (without replacement: just drop) * `MLIRPythonExtension.AllPassesRegistration` removed (without replacement: just drop) * `MLIRPythonExtension.Conversions` removed (without replacement: just drop) * `MLIRPythonExtension.Transforms` removed (without replacement: just drop) Header changes: * `mlir-c/Registration.h` is deleted. Dialect registration functionality is now in `IR.h`. Registration of upstream features are in `mlir-c/RegisterEverything.h`. When updating MLIR and a couple of downstreams, I found that proper usage was commingled so required making a choice vs just blind S&R. Python APIs removed: * mlir.transforms and mlir.conversions (previously only had an __init__.py which indirectly triggered `mlirRegisterTransformsPasses()` and `mlirRegisterConversionPasses()` respectively). Downstream impact: Remove these imports if present (they now happen as part of default initialization). * mlir._mlir_libs._all_passes_registration, mlir._mlir_libs._mlirTransforms, mlir._mlir_libs._mlirConversions. Downstream impact: None expected (these were internally used). C-APIs changed: * mlirRegisterAllDialects(MlirContext) now takes an MlirDialectRegistry instead. It also used to trigger loading of all dialects, which was already marked with a TODO to remove -- it no longer does, and for direct use, dialects must be explicitly loaded. Downstream impact: Direct C-API users must ensure that needed dialects are loaded or call `mlirContextLoadAllAvailableDialects(MlirContext)` to emulate the prior behavior. Also see the `ir.c` test case (e.g. ` mlirContextGetOrLoadDialect(ctx, mlirStringRefCreateFromCString("func"));`). * mlirDialectHandle* APIs were moved from Registration.h (which now is restricted to just global/upstream registration) to IR.h, arguably where it should have been. Downstream impact: include correct header (likely already doing so). C-APIs added: * mlirContextLoadAllAvailableDialects(MlirContext): Corresponds to C++ API with the same purpose. Python APIs added: * mlir.ir.DialectRegistry: Mapping for an MlirDialectRegistry. * mlir.ir.Context.append_dialect_registry(MlirDialectRegistry) * mlir.ir.Context.load_all_available_dialects() * mlir._mlir_libs._mlirAllRegistration: New native extension that exposes a `register_dialects(MlirDialectRegistry)` entry point and performs all upstream pass/conversion/transforms registration on init. In this first step, we eagerly load this as part of the __init__.py and use it to monkey patch the Context to emulate prior behavior. * Type caster and capsule support for MlirDialectRegistry This should make it possible to build downstream Python dialects that only depend on a subset of MLIR. See: https://github.com/llvm/llvm-project/issues/56037 Here is an example PR, minimally adapting IREE to these changes: https://github.com/iree-org/iree/pull/9638/files In this situation, IREE is opting to not link everything, since it is already configuring the Context to its liking. For projects that would just like to not think about it and pull in everything, add `MLIRPythonExtension.RegisterEverything` to the list of Python sources getting built, and the old behavior will continue. Reviewed By: mehdi_amini, ftynse Differential Revision: https://reviews.llvm.org/D128593
2022-07-16 16:09:03 -07:00
name = "CAPIRegisterEverything",
srcs = ["lib/CAPI/RegisterEverything/RegisterEverything.cpp"],
hdrs = ["include/mlir-c/RegisterEverything.h"],
capi_deps = [
":CAPIIR",
],
includes = ["include"],
deps = [
":AllExtensions",
":AllPassesAndDialects",
":BuiltinToLLVMIRTranslation",
":LLVMToLLVMIRTranslation",
],
)
##---------------------------------------------------------------------------##
# Sources of Python bindings.
#----------------------------------------------------------------------------##
exports_files(
glob(["lib/Bindings/Python/**/*.cpp"]),
)
MLIR_BINDINGS_PYTHON_HEADERS = [
"lib/Bindings/Python/*.h",
"include/mlir-c/Bindings/Python/*.h",
"include/mlir/Bindings/Python/*.h",
]
cc_library(
name = "MLIRBindingsPythonHeaders",
includes = [
"include",
"lib/Bindings/Python",
],
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
textual_hdrs = glob(MLIR_BINDINGS_PYTHON_HEADERS),
deps = [
":CAPIIRHeaders",
"@pybind11",
"@python_runtime//:headers",
],
)
cc_library(
name = "MLIRBindingsPythonHeadersAndDeps",
includes = [
"include",
"lib/Bindings/Python",
],
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
textual_hdrs = glob(MLIR_BINDINGS_PYTHON_HEADERS),
deps = [
":CAPIIR",
"@pybind11",
"@python_runtime//:headers",
],
)
# These flags are needed for pybind11 to work.
PYBIND11_COPTS = [
"-fexceptions",
"-frtti",
]
PYBIND11_FEATURES = [
# Cannot use header_modules (parse_headers feature fails).
"-use_header_modules",
]
MLIR_PYTHON_BINDINGS_SOURCES = [
"lib/Bindings/Python/IRAffine.cpp",
"lib/Bindings/Python/IRAttributes.cpp",
"lib/Bindings/Python/IRCore.cpp",
"lib/Bindings/Python/IRInterfaces.cpp",
"lib/Bindings/Python/IRModule.cpp",
"lib/Bindings/Python/IRTypes.cpp",
"lib/Bindings/Python/Pass.cpp",
]
cc_library(
name = "MLIRBindingsPythonCore",
srcs = MLIR_PYTHON_BINDINGS_SOURCES,
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIAsync",
":CAPIDebug",
":CAPIGPU",
":CAPIIR",
":CAPIInterfaces",
":MLIRBindingsPythonHeadersAndDeps",
"//llvm:Support",
"@pybind11",
"@python_runtime//:headers",
],
)
cc_library(
name = "MLIRBindingsPythonCoreNoCAPI",
srcs = MLIR_PYTHON_BINDINGS_SOURCES,
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIAsyncHeaders",
":CAPIDebugHeaders",
":CAPIGPUHeaders",
":CAPIIRHeaders",
":MLIRBindingsPythonHeaders",
"//llvm:Support",
"@pybind11",
"@python_runtime//:headers",
],
)
# Target that bundles together the CAPI objects needed for
# MLIRBindingsPythonCoreNoCAPI.
cc_library(
name = "MLIRBindingsPythonCAPIObjects",
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIAsyncObjects",
":CAPIDebugObjects",
":CAPIGPUObjects",
":CAPIIRObjects",
":CAPIInterfacesObjects",
],
)
# Dynamic library with the MLIR Python extension.
cc_binary(
name = "_mlir.so",
srcs = ["lib/Bindings/Python/MainModule.cpp"],
# These flags are needed for pybind11 to work.
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":MLIRBindingsPythonCore",
":MLIRBindingsPythonHeadersAndDeps",
],
)
cc_binary(
name = "_mlirDialectsLinalg.so",
srcs = ["lib/Bindings/Python/DialectLinalg.cpp"],
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIIR",
":CAPILinalg",
":MLIRBindingsPythonHeadersAndDeps",
],
)
cc_binary(
name = "_mlirDialectsQuant.so",
srcs = ["lib/Bindings/Python/DialectQuant.cpp"],
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIIR",
":CAPIQuant",
":MLIRBindingsPythonHeadersAndDeps",
],
)
cc_binary(
name = "_mlirDialectsSparseTensor.so",
srcs = ["lib/Bindings/Python/DialectSparseTensor.cpp"],
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIIR",
":CAPISparseTensor",
":MLIRBindingsPythonHeadersAndDeps",
],
)
# Dynamic library with the MLIR Conversions Python extension.
cc_binary(
name = "_mlirExecutionEngine.so",
srcs = ["lib/Bindings/Python/ExecutionEngineModule.cpp"],
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPIExecutionEngine",
":MLIRBindingsPythonHeadersAndDeps",
"@pybind11",
"@python_runtime//:headers",
],
)
# Dynamic library with the MLIR Linalg dialect+passes Python extension.
cc_binary(
name = "_mlirLinalgPasses.so",
srcs = ["lib/Bindings/Python/LinalgPasses.cpp"],
copts = PYBIND11_COPTS,
features = PYBIND11_FEATURES,
linkshared = 1,
linkstatic = 0,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":CAPILinalg",
":MLIRBindingsPythonHeadersAndDeps",
"@pybind11",
"@python_runtime//:headers",
],
)
##---------------------------------------------------------------------------##
td_library(
name = "AttrTdFiles",
srcs = [
"include/mlir/IR/AttrTypeBase.td",
"include/mlir/IR/EnumAttr.td",
],
includes = ["include"],
)
td_library(
name = "OpBaseTdFiles",
srcs = [
"include/mlir/IR/DialectBase.td",
"include/mlir/IR/OpAsmInterface.td",
"include/mlir/IR/OpBase.td",
"include/mlir/IR/PatternBase.td",
"include/mlir/IR/RegionKindInterface.td",
"include/mlir/IR/SymbolInterfaces.td",
"include/mlir/IR/TensorEncoding.td",
],
includes = ["include"],
deps = [
":AttrTdFiles",
],
)
td_library(
name = "BytecodeTdFiles",
srcs = ["include/mlir/IR/BytecodeBase.td"],
includes = ["include"],
)
td_library(
name = "CallInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/CallInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "CastInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/CastInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "ControlFlowInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/ControlFlowInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "BytecodeOpInterfaceTdFiles",
srcs = ["include/mlir/Bytecode/BytecodeOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "CopyOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/CopyOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "DerivedAttributeOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/DerivedAttributeOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "DestinationStyleOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/DestinationStyleOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
2022-06-03 20:43:02 +02:00
td_library(
name = "InferIntRangeInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/InferIntRangeInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "InferTypeOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/InferTypeOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "LoopLikeInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/LoopLikeInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "MemorySlotInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/MemorySlotInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "ShapedOpInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/ShapedOpInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "ParallelCombiningOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/ParallelCombiningOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "RuntimeVerifiableOpInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/RuntimeVerifiableOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "SideEffectInterfacesTdFiles",
srcs = [
"include/mlir/Interfaces/SideEffectInterfaceBase.td",
"include/mlir/Interfaces/SideEffectInterfaces.td",
],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "TilingInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/TilingInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "VectorInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/VectorInterfaces.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "ViewLikeInterfaceTdFiles",
srcs = ["include/mlir/Interfaces/ViewLikeInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "ReducerTdFiles",
srcs = ["include/mlir/Reducer/Passes.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
##---------------------------------------------------------------------------##
# Affine dialect.
##---------------------------------------------------------------------------##
td_library(
name = "PassBaseTdFiles",
srcs = ["include/mlir/Pass/PassBase.td"],
includes = ["include"],
)
td_library(
name = "RewritePassBaseTdFiles",
srcs = ["include/mlir/Rewrite/PassUtil.td"],
includes = ["include"],
)
td_library(
name = "AffineOpsTdFiles",
srcs = [
"include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
"include/mlir/Dialect/Affine/IR/AffineOps.td",
],
includes = ["include"],
deps = [
":ArithOpsTdFiles",
":FuncTdFiles",
":LoopLikeInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "AffineOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Affine/IR/AffineOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Affine/IR/AffineOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=affine",
],
"include/mlir/Dialect/Affine/IR/AffineOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=affine",
],
"include/mlir/Dialect/Affine/IR/AffineOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Affine/IR/AffineOps.td",
deps = [":AffineOpsTdFiles"],
)
gentbl_cc_library(
name = "AffineMemoryOpInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td",
deps = [":AffineOpsTdFiles"],
)
2022-11-21 10:20:19 +01:00
td_library(
name = "AffineTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/Affine/TransformOps/AffineTransformOps.td",
],
includes = ["include"],
deps = [
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "AffineTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Affine/TransformOps/AffineTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Affine/TransformOps/AffineTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Affine/TransformOps/AffineTransformOps.td",
deps = [
":AffineTransformOpsTdFiles",
],
)
cc_library(
name = "AffineTransformOps",
srcs = glob(["lib/Dialect/Affine/TransformOps/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Affine/TransformOps/*.h"]),
includes = ["include"],
deps = [
":AffineAnalysis",
2022-11-21 10:20:19 +01:00
":AffineDialect",
":AffineTransformOpsIncGen",
":AffineTransforms",
":AffineUtils",
":FuncDialect",
":IR",
":TransformDialect",
":Transforms",
2022-11-21 10:20:19 +01:00
":VectorDialect",
],
)
##---------------------------------------------------------------------------##
# AMDGPU dialect.
##---------------------------------------------------------------------------##
td_library(
name = "AMDGPUTdFiles",
srcs = ["include/mlir/Dialect/AMDGPU/IR/AMDGPU.td"],
includes = ["include"],
deps = [
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "AMDGPUIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-attrdef-decls",
"-dialect=amdgpu",
],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.h.inc",
),
(
[
"-gen-attrdef-defs",
"-dialect=amdgpu",
],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=amdgpu",
],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=amdgpu",
],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/AMDGPU/IR/AMDGPUEnums.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/AMDGPU/IR/AMDGPU.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/AMDGPU/IR/AMDGPU.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/AMDGPU/IR/AMDGPU.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/AMDGPU/IR/AMDGPU.td",
deps = [":AMDGPUTdFiles"],
)
cc_library(
name = "AMDGPUDialect",
srcs = ["lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp"],
hdrs = ["include/mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h"],
includes = ["include"],
deps = [
":AMDGPUIncGen",
2022-11-21 18:18:25 +01:00
":ArithDialect",
2023-02-09 21:35:08 +01:00
":GPUDialect",
":IR",
":SideEffectInterfaces",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "AMDGPUPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=AMDGPU",
],
"include/mlir/Dialect/AMDGPU/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/AMDGPU/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "AMDGPUTransforms",
srcs = glob(
[
"lib/Dialect/AMDGPU/Transforms/*.cpp",
"lib/Dialect/AMDGPU/Transforms/*.h",
],
),
hdrs = glob(["include/mlir/Dialect/AMDGPU/Transforms/*.h"]),
includes = ["include"],
deps = [
":AMDGPUDialect",
":AMDGPUPassIncGen",
":AMDGPUUtils",
":ArithDialect",
":ControlFlowDialect",
":IR",
":Pass",
":TransformUtils",
":Transforms",
],
)
cc_library(
name = "AMDGPUUtils",
srcs = glob(["lib/Dialect/AMDGPU/Utils/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/AMDGPU/Utils/*.h"]),
includes = ["include"],
deps = [
":AMDGPUDialect",
":Support",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# EmitC dialect.
##---------------------------------------------------------------------------##
td_library(
name = "EmitCTdFiles",
srcs = [
"include/mlir/Dialect/EmitC/IR/EmitC.td",
"include/mlir/Dialect/EmitC/IR/EmitCAttributes.td",
"include/mlir/Dialect/EmitC/IR/EmitCBase.td",
"include/mlir/Dialect/EmitC/IR/EmitCTypes.td",
],
includes = ["include"],
deps = [
":BuiltinDialectTdFiles",
2022-04-28 18:29:43 +02:00
":CastInterfacesTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "EmitCAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attrdef-decls"],
"include/mlir/Dialect/EmitC/IR/EmitCAttributes.h.inc",
),
(
["--gen-attrdef-defs"],
"include/mlir/Dialect/EmitC/IR/EmitCAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/EmitC/IR/EmitCAttributes.td",
deps = [":EmitCTdFiles"],
)
gentbl_cc_library(
name = "EmitCOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-dialect-decls"],
"include/mlir/Dialect/EmitC/IR/EmitCDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/EmitC/IR/EmitCDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/EmitC/IR/EmitC.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/EmitC/IR/EmitC.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/EmitC/IR/EmitCTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/EmitC/IR/EmitCTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/EmitC/IR/EmitC.td",
deps = [":EmitCTdFiles"],
)
cc_library(
name = "TargetCpp",
srcs = glob([
"lib/Target/Cpp/*.cpp",
"lib/Target/Cpp/*.h",
]),
hdrs = glob(["include/mlir/Target/Cpp/*.h"]),
deps = [
":ArithDialect",
":ControlFlowDialect",
":EmitCDialect",
":FuncDialect",
":IR",
":MathDialect",
":SCFDialect",
":Support",
":TranslateLib",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# Async dialect.
##---------------------------------------------------------------------------##
td_library(
name = "AsyncOpsTdFiles",
srcs = [
"include/mlir/Dialect/Async/IR/AsyncDialect.td",
"include/mlir/Dialect/Async/IR/AsyncOps.td",
"include/mlir/Dialect/Async/IR/AsyncTypes.td",
],
includes = ["include"],
deps = [
":CallInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":FunctionInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "AsyncOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Async/IR/AsyncOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Async/IR/AsyncOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/Async/IR/AsyncOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/Async/IR/AsyncOpsDialect.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/Async/IR/AsyncOpsTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/Async/IR/AsyncOpsTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Async/IR/AsyncOps.td",
deps = [":AsyncOpsTdFiles"],
)
gentbl_cc_library(
name = "AsyncPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Async",
],
"include/mlir/Dialect/Async/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=Async",
],
"include/mlir/Dialect/Async/Passes.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=Async",
],
"include/mlir/Dialect/Async/Passes.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Async/Passes.td",
deps = [":PassBaseTdFiles"],
)
##---------------------------------------------------------------------------##
# ArmNeon dialect.
##---------------------------------------------------------------------------##
td_library(
name = "ArmNeonTdFiles",
srcs = ["include/mlir/Dialect/ArmNeon/ArmNeon.td"],
includes = ["include"],
deps = [
":LLVMOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ArmNeonIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=arm_neon",
],
"include/mlir/Dialect/ArmNeon/ArmNeonDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=arm_neon",
],
"include/mlir/Dialect/ArmNeon/ArmNeonDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/ArmNeon/ArmNeon.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/ArmNeon/ArmNeon.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/ArmNeon/ArmNeon.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmNeon/ArmNeon.td",
deps = [":ArmNeonTdFiles"],
)
cc_library(
name = "ArmNeonDialect",
srcs = ["lib/Dialect/ArmNeon/IR/ArmNeonDialect.cpp"],
hdrs = ["include/mlir/Dialect/ArmNeon/ArmNeonDialect.h"],
includes = ["include"],
deps = [
":ArmNeonIncGen",
":IR",
":SideEffectInterfaces",
":VectorDialect",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ArmNeonConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/ArmNeon/ArmNeonConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmNeon/ArmNeon.td",
deps = [":ArmNeonTdFiles"],
)
cc_library(
name = "ArmNeon2dToIntr",
srcs = glob([
"lib/Conversion/ArmNeon2dToIntr/*.cpp",
"lib/Conversion/ArmNeon2dToIntr/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/ArmNeon2dToIntr/*.h",
]),
includes = ["include"],
deps = [
":ArmNeonDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MemRefDialect",
":OpenACCDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
":VectorDialect",
],
)
##---------------------------------------------------------------------------##
# ArmSME dialect.
##---------------------------------------------------------------------------##
td_library(
name = "ArmSMETdFiles",
srcs = [
"include/mlir/Dialect/ArmSME/IR/ArmSME.td",
],
includes = ["include"],
deps = [
":ArithOpsTdFiles",
":FuncTdFiles",
":LLVMOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ArmSMETransformsPassIncGen",
strip_include_prefix = "include",
tbl_outs = [(
[
"-gen-pass-decls",
"-name=ArmSME",
],
"include/mlir/Dialect/ArmSME/Transforms/Passes.h.inc",
)],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmSME/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
gentbl_cc_library(
name = "ArmSMEIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/ArmSME/IR/ArmSME.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/ArmSME/IR/ArmSME.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/ArmSME/IR/ArmSMETypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/ArmSME/IR/ArmSMETypes.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=arm_sme",
],
"include/mlir/Dialect/ArmSME/IR/ArmSMEDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=arm_sme",
],
"include/mlir/Dialect/ArmSME/IR/ArmSMEDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmSME/IR/ArmSME.td",
deps = [":ArmSMETdFiles"],
)
gentbl_cc_library(
name = "ArmSMEConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/ArmSME/IR/ArmSMEConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmSME/IR/ArmSME.td",
deps = [":ArmSMETdFiles"],
)
cc_library(
name = "ArmSMEDialect",
srcs = ["lib/Dialect/ArmSME/IR/ArmSME.cpp"],
hdrs = ["include/mlir/Dialect/ArmSME/IR/ArmSME.h"],
includes = ["include"],
deps = [
":ArmSMEIncGen",
":IR",
":LLVMDialect",
":SCFDialect",
":SideEffectInterfaces",
2023-07-18 15:51:49 +02:00
":VectorDialect",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ArmSMEUtils",
srcs = glob(["lib/Dialect/ArmSME/Utils/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/ArmSME/Utils/*.h"]),
includes = ["include"],
deps = [
":ArmSMEDialect",
":IR",
":Dialect",
],
)
cc_library(
name = "ArmSMETransforms",
srcs = glob(["lib/Dialect/ArmSME/Transforms/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/ArmSME/Transforms/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":ArmSMEDialect",
":ArmSMEUtils",
":ArmSMETransformsPassIncGen",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":SCFDialect",
2023-07-18 16:10:48 +02:00
":Transforms",
":VectorDialect",
],
)
##---------------------------------------------------------------------------##
# ArmSVE dialect.
##---------------------------------------------------------------------------##
td_library(
name = "ArmSVETdFiles",
srcs = [
"include/mlir/Dialect/ArmSVE/ArmSVE.td",
],
includes = ["include"],
deps = [
":ArithOpsTdFiles",
":FuncTdFiles",
":LLVMOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ArmSVEIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/ArmSVE/ArmSVE.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/ArmSVE/ArmSVE.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/ArmSVE/ArmSVETypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/ArmSVE/ArmSVETypes.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=arm_sve",
],
"include/mlir/Dialect/ArmSVE/ArmSVEDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=arm_sve",
],
"include/mlir/Dialect/ArmSVE/ArmSVEDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmSVE/ArmSVE.td",
deps = [":ArmSVETdFiles"],
)
cc_library(
name = "ArmSVEDialect",
srcs = ["lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp"],
hdrs = ["include/mlir/Dialect/ArmSVE/ArmSVEDialect.h"],
includes = ["include"],
deps = [
":ArmSVEIncGen",
":IR",
":LLVMDialect",
":SideEffectInterfaces",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ArmSVETransforms",
srcs = glob(["lib/Dialect/ArmSVE/Transforms/*.cpp"]),
hdrs = ["include/mlir/Dialect/ArmSVE/Transforms.h"],
includes = ["include"],
deps = [
":ArmSVEDialect",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":TransformUtils",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ArmSVEConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/ArmSVE/ArmSVEConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ArmSVE/ArmSVE.td",
deps = [":ArmSVETdFiles"],
)
##---------------------------------------------------------------------------##
# AMX dialect.
##---------------------------------------------------------------------------##
td_library(
name = "AMXTdFiles",
srcs = ["include/mlir/Dialect/AMX/AMX.td"],
includes = ["include"],
deps = [
":LLVMOpsTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "AMXIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=amx",
],
"include/mlir/Dialect/AMX/AMXDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=amx",
],
"include/mlir/Dialect/AMX/AMXDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/AMX/AMX.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/AMX/AMX.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/AMX/AMX.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/AMX/AMX.td",
deps = [":AMXTdFiles"],
)
cc_library(
name = "AMXDialect",
srcs = ["lib/Dialect/AMX/IR/AMXDialect.cpp"],
hdrs = ["include/mlir/Dialect/AMX/AMXDialect.h"],
includes = ["include"],
deps = [
":AMXIncGen",
":IR",
":LLVMDialect",
":SideEffectInterfaces",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "AMXTransforms",
srcs = glob(["lib/Dialect/AMX/Transforms/*.cpp"]),
hdrs = ["include/mlir/Dialect/AMX/Transforms.h"],
includes = ["include"],
deps = [
":AMXDialect",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "AMXConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/AMX/AMXConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/AMX/AMX.td",
deps = [":AMXTdFiles"],
)
##---------------------------------------------------------------------------##
# X86Vector dialect.
##---------------------------------------------------------------------------##
td_library(
name = "X86VectorTdFiles",
srcs = ["include/mlir/Dialect/X86Vector/X86Vector.td"],
includes = ["include"],
deps = [
":InferTypeOpInterfaceTdFiles",
":LLVMOpsTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "X86VectorIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=x86vector",
],
"include/mlir/Dialect/X86Vector/X86VectorDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=x86vector",
],
"include/mlir/Dialect/X86Vector/X86VectorDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/X86Vector/X86Vector.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/X86Vector/X86Vector.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/X86Vector/X86Vector.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/X86Vector/X86Vector.td",
deps = [":X86VectorTdFiles"],
)
cc_library(
name = "X86VectorDialect",
srcs = ["lib/Dialect/X86Vector/IR/X86VectorDialect.cpp"],
hdrs = ["include/mlir/Dialect/X86Vector/X86VectorDialect.h"],
includes = ["include"],
deps = [
":IR",
":InferTypeOpInterface",
":LLVMDialect",
":SideEffectInterfaces",
":X86VectorIncGen",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "X86VectorTransforms",
srcs = glob(["lib/Dialect/X86Vector/Transforms/*.cpp"]),
hdrs = ["include/mlir/Dialect/X86Vector/Transforms.h"],
includes = ["include"],
deps = [
":ArithDialect",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":VectorDialect",
":VectorUtils",
":X86VectorDialect",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "X86VectorConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/X86Vector/X86VectorConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/X86Vector/X86Vector.td",
deps = [":X86VectorTdFiles"],
)
##---------------------------------------------------------------------------##
# IRDL dialect.
##---------------------------------------------------------------------------##
td_library(
name = "IRDLTdFiles",
srcs = [
"include/mlir/Dialect/IRDL/IR/IRDL.td",
"include/mlir/Dialect/IRDL/IR/IRDLAttributes.td",
"include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td",
"include/mlir/Dialect/IRDL/IR/IRDLOps.td",
"include/mlir/Dialect/IRDL/IR/IRDLTypes.td",
],
includes = ["include"],
deps = [
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "IRDLIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-dialect-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/IRDL/IR/IRDL.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/IRDL/IR/IRDL.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLOps.td",
deps = [":IRDLTdFiles"],
)
gentbl_cc_library(
name = "IRDLInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td",
deps = [":IRDLTdFiles"],
)
gentbl_cc_library(
name = "IRDLAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLAttributes.td",
deps = [":IRDLTdFiles"],
)
gentbl_cc_library(
name = "IRDLEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLAttributes.td",
deps = [":IRDLTdFiles"],
)
gentbl_cc_library(
name = "IRDLOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLOps.td",
deps = [":IRDLTdFiles"],
)
gentbl_cc_library(
name = "IRDLTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-typedef-decls"],
"include/mlir/Dialect/IRDL/IR/IRDLTypesGen.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/IRDL/IR/IRDLTypesGen.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/IRDL/IR/IRDLTypes.td",
deps = [":IRDLTdFiles"],
)
cc_library(
name = "IRDLDialect",
srcs = [
"lib/Dialect/IRDL/IR/IRDL.cpp",
"lib/Dialect/IRDL/IR/IRDLOps.cpp",
"lib/Dialect/IRDL/IRDLLoading.cpp",
"lib/Dialect/IRDL/IRDLVerifiers.cpp",
],
hdrs = [
"include/mlir/Dialect/IRDL/IR/IRDL.h",
"include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h",
"include/mlir/Dialect/IRDL/IR/IRDLTraits.h",
"include/mlir/Dialect/IRDL/IRDLLoading.h",
"include/mlir/Dialect/IRDL/IRDLVerifiers.h",
],
includes = ["include"],
deps = [
":Dialect",
":IR",
":IRDLAttributesIncGen",
":IRDLEnumsIncGen",
":IRDLIncGen",
":IRDLInterfacesIncGen",
":IRDLOpsIncGen",
":IRDLTypesIncGen",
":InferTypeOpInterface",
":Support",
"//llvm:Core",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# SCF dialect.
##---------------------------------------------------------------------------##
td_library(
name = "SCFTdFiles",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
srcs = [
"include/mlir/Dialect/SCF/IR/DeviceMappingInterface.td",
"include/mlir/Dialect/SCF/IR/SCFOps.td",
],
includes = ["include"],
deps = [
":ControlFlowInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":LoopLikeInterfaceTdFiles",
":ParallelCombiningOpInterfaceTdFiles",
":SideEffectInterfacesTdFiles",
":ViewLikeInterfaceTdFiles",
],
)
gentbl_cc_library(
name = "SCFIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/SCF/IR/SCFOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/SCF/IR/SCFOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/SCF/IR/SCFOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/SCF/IR/SCFOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SCF/IR/SCFOps.td",
deps = [":SCFTdFiles"],
)
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
gentbl_cc_library(
name = "SCFDeviceMappingInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attr-interface-decls"],
"include/mlir/Dialect/SCF/IR/DeviceMappingAttrInterface.h.inc",
),
(
["-gen-attr-interface-defs"],
"include/mlir/Dialect/SCF/IR/DeviceMappingAttrInterface.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/SCF/IR/DeviceMappingAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/SCF/IR/DeviceMappingAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SCF/IR/DeviceMappingInterface.td",
deps = [":SCFTdFiles"],
)
gentbl_cc_library(
name = "SCFPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=SCF",
],
"include/mlir/Dialect/SCF/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SCF/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "SCFTransforms",
srcs = glob([
"lib/Dialect/SCF/Transforms/*.cpp",
"lib/Dialect/SCF/Transforms/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/SCF/Transforms/*.h",
]),
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
":ArithDialect",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":DestinationStyleOpInterface",
":DialectUtils",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":SCFPassIncGen",
":SCFUtils",
":SideEffectInterfaces",
":Support",
":TensorDialect",
":TensorTransforms",
":TilingInterface",
":Transforms",
"//llvm:Support",
],
)
td_library(
name = "SCFTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td",
],
includes = ["include"],
deps = [
":PDLDialect",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "SCFTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SCF/TransformOps/SCFTransformOps.td",
deps = [
":SCFTransformOpsTdFiles",
],
)
cc_library(
name = "SCFTransformOps",
srcs = glob(["lib/Dialect/SCF/TransformOps/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/SCF/TransformOps/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":AffineUtils",
":FuncDialect",
":IR",
":LoopLikeInterface",
":SCFDialect",
":SCFTransformOpsIncGen",
":SCFTransforms",
":SCFUtils",
":SideEffectInterfaces",
":TransformDialect",
":VectorDialect",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# SparseTensor dialect.
##---------------------------------------------------------------------------##
td_library(
name = "SparseTensorTdFiles",
srcs = [
"include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td",
"include/mlir/Dialect/SparseTensor/IR/SparseTensorBase.td",
"include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td",
"include/mlir/Dialect/SparseTensor/IR/SparseTensorTypes.td",
],
includes = ["include"],
deps = [
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "SparseTensorAttrDefsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attrdef-decls"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.h.inc",
),
(
["--gen-attrdef-defs"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.cpp.inc",
),
(
["--gen-enum-decls"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrEnums.h.inc",
),
(
["--gen-enum-defs"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td",
deps = [":SparseTensorTdFiles"],
)
gentbl_cc_library(
name = "SparseTensorOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=sparse_tensor",
],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=sparse_tensor",
],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorOpsDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/SparseTensor/SparseTensor.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td",
deps = [":SparseTensorTdFiles"],
)
gentbl_cc_library(
name = "SparseTensorTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-typedef-decls"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorTypes.h.inc",
),
(
["--gen-typedef-defs"],
"include/mlir/Dialect/SparseTensor/IR/SparseTensorTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SparseTensor/IR/SparseTensorTypes.td",
deps = [":SparseTensorTdFiles"],
)
gentbl_cc_library(
name = "SparseTensorPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=SparseTensor",
],
"include/mlir/Dialect/SparseTensor/Transforms/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=SparseTensor",
],
"include/mlir/Dialect/SparseTensor/Transforms/Passes.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=SparseTensor",
],
"include/mlir/Dialect/SparseTensor/Transforms/Passes.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SparseTensor/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
# This library is shared by both SparseTensorDialect and
# SparseTensorRuntime, so it must not depend on any of the MLIR/LLVM
# internals or else mlir_c_runner_utils will inherit that dependency.
cc_library(
name = "SparseTensorEnums",
hdrs = ["include/mlir/Dialect/SparseTensor/IR/Enums.h"],
includes = ["include"],
)
cc_library(
name = "SparseTensorDialect",
srcs = [
"lib/Dialect/SparseTensor/IR/Detail/DimLvlMap.cpp",
"lib/Dialect/SparseTensor/IR/Detail/DimLvlMap.h",
"lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.cpp",
"lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.h",
"lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp",
"lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.h",
"lib/Dialect/SparseTensor/IR/Detail/TemplateExtras.h",
"lib/Dialect/SparseTensor/IR/Detail/Var.cpp",
"lib/Dialect/SparseTensor/IR/Detail/Var.h",
"lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp",
],
hdrs = [
"include/mlir/Dialect/SparseTensor/IR/SparseTensor.h",
"include/mlir/Dialect/SparseTensor/IR/SparseTensorStorageLayout.h",
"include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h",
],
includes = ["include"],
deps = [
":ArithDialect",
":DialectUtils",
":IR",
2022-04-28 22:51:27 +02:00
":InferTypeOpInterface",
":SparseTensorAttrDefsIncGen",
":SparseTensorEnums",
":SparseTensorOpsIncGen",
":SparseTensorTypesIncGen",
"//llvm:Support",
],
)
cc_library(
name = "SparseTensorUtils",
srcs = glob(["lib/Dialect/SparseTensor/Utils/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/SparseTensor/Utils/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":ComplexDialect",
":IR",
":LinalgDialect",
":MathDialect",
":SparseTensorDialect",
":SparseTensorEnums",
"//llvm:Support",
],
)
cc_library(
name = "SparseTensorTransforms",
srcs = glob([
"lib/Dialect/SparseTensor/Transforms/*.cpp",
"lib/Dialect/SparseTensor/Transforms/*.h",
]),
hdrs = [
"include/mlir/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.h",
"include/mlir/Dialect/SparseTensor/Transforms/Passes.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":ComplexDialect",
":DialectUtils",
":FuncDialect",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":GPUDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":LinalgDialect",
":LinalgTransforms",
":LinalgUtils",
":MathDialect",
":MemRefDialect",
":Pass",
":SCFDialect",
":SCFTransforms",
":SparseTensorDialect",
":SparseTensorEnums",
":SparseTensorPassIncGen",
":SparseTensorUtils",
":Support",
":TensorDialect",
":Transforms",
":VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "SparseTensorPipelines",
srcs = glob(["lib/Dialect/SparseTensor/Pipelines/*.cpp"]),
hdrs = ["include/mlir/Dialect/SparseTensor/Pipelines/Passes.h"],
includes = ["include"],
local_defines = if_cuda_available(["MLIR_GPU_TO_CUBIN_PASS_ENABLE"]),
deps = [
":ArithTransforms",
":BufferizationTransforms",
":ConversionPasses",
2022-03-17 09:24:53 +01:00
":FuncDialect",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":GPUDialect",
":GPUToNVVMTransforms",
":GPUTransforms",
":LinalgTransforms",
":MemRefTransforms",
":NVVMDialect",
":Pass",
":SparseTensorDialect",
":SparseTensorTransforms",
":TensorTransforms",
":Transforms",
":VectorToLLVM",
":VectorTransforms",
2023-04-13 14:58:11 +02:00
] + if_cuda_available([
":SerializeToCubin",
]),
)
##---------------------------------------------------------------------------##
# NVGPU dialect.
##---------------------------------------------------------------------------##
td_library(
name = "NVGPUTdFiles",
srcs = ["include/mlir/Dialect/NVGPU/IR/NVGPU.td"],
includes = ["include"],
deps = [
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "NVGPUIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=nvgpu",
],
"include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=nvgpu",
],
"include/mlir/Dialect/NVGPU/IR/NVGPUDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/NVGPU/IR/NVGPU.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/NVGPU/IR/NVGPU.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/NVGPU/NVGPU.md",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/NVGPU/IR/NVGPUTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/NVGPU/IR/NVGPUTypes.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/NVGPU/IR/NVGPUEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/NVGPU/IR/NVGPUEnums.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/NVGPU/IR/NVGPU.td",
deps = [":NVGPUTdFiles"],
)
gentbl_cc_library(
name = "NVGPUPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=NVGPU",
],
"include/mlir/Dialect/NVGPU/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/NVGPU/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "NVGPUDialect",
srcs = ["lib/Dialect/NVGPU/IR/NVGPUDialect.cpp"],
hdrs = ["include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h"],
includes = ["include"],
deps = [
":GPUDialect",
":IR",
":NVGPUIncGen",
":SideEffectInterfaces",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "NVGPUTransformOps",
srcs = glob([
"lib/Dialect/NVGPU/TransformOps/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/NVGPU/TransformOps/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":Analysis",
":ArithDialect",
":ArithUtils",
":DialectUtils",
":GPUDialect",
":IR",
":LinalgDialect",
":MemRefDialect",
":NVGPUDialect",
":NVGPUTransformOpsIncGen",
":NVGPUTransforms",
":SCFDialect",
":SCFTransforms",
":Support",
":TransformDialect",
":VectorDialect",
"//llvm:Support",
],
)
td_library(
name = "NVGPUTransformOpsTdFiles",
srcs = glob([
"include/mlir/Dialect/NVGPU/TransformOps/*.td",
]),
includes = ["include"],
deps = [
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "NVGPUTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/NVGPU/TransformOps/NVGPUTransformOps.td",
deps = [
":NVGPUTransformOpsTdFiles",
],
)
2023-01-17 15:22:30 -08:00
cc_library(
name = "NVGPUUtils",
srcs = ["lib/Dialect/NVGPU/Utils/MMAUtils.cpp"],
hdrs = ["include/mlir/Dialect/NVGPU/Utils/MMAUtils.h"],
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":IR",
":NVGPUDialect",
":NVVMDialect",
":VectorDialect",
],
)
cc_library(
name = "NVGPUTransforms",
srcs = glob([
"lib/Dialect/NVGPU/Transforms/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/NVGPU/Transforms/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":FuncDialect",
":GPUDialect",
":IR",
":MemRefDialect",
":NVGPUDialect",
":NVGPUPassIncGen",
":Pass",
":SideEffectInterfaces",
":Support",
":Transforms",
":VectorDialect",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
2022-03-02 00:07:56 +01:00
name = "FuncTdFiles",
srcs = [
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOps.td",
],
includes = ["include"],
deps = [
":AttrTdFiles",
":CallInterfacesTdFiles",
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
2022-03-17 09:24:53 +01:00
":FunctionInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":VectorInterfacesTdFiles",
],
)
gentbl_cc_library(
2022-03-02 00:07:56 +01:00
name = "FuncIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOps.h.inc",
),
(
["-gen-op-defs"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOps.cpp.inc",
),
(
["-gen-dialect-decls"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/FuncOpsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
2022-03-02 00:07:56 +01:00
td_file = "include/mlir/Dialect/Func/IR/FuncOps.td",
deps = [":FuncTdFiles"],
)
cc_library(
name = "Dialect",
srcs = glob([
"lib/Dialect/*.cpp",
"lib/Dialect/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/*.h",
]),
includes = ["include"],
deps = [
":IR",
"//llvm:Support",
],
)
td_library(
name = "DialectUtilsTdFiles",
srcs = [
"include/mlir/Dialect/Utils/StructuredOpsUtils.td",
],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "DialectUtilsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Utils/DialectUtilsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Utils/DialectUtilsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Utils/StructuredOpsUtils.td",
deps = [":DialectUtilsTdFiles"],
)
cc_library(
name = "DialectUtils",
srcs = glob([
"lib/Dialect/Utils/*.cpp",
"lib/Dialect/Utils/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/Utils/*.h",
]),
includes = ["include"],
deps = [
":ArithUtils",
":DialectUtilsIncGen",
":IR",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "AffineDialect",
srcs = glob([
"lib/Dialect/Affine/IR/*.cpp",
"lib/Dialect/Affine/IR/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/Affine/IR/*.h",
]),
includes = ["include"],
deps = [
":AffineMemoryOpInterfacesIncGen",
":AffineOpsIncGen",
":ArithDialect",
2022-02-03 01:41:03 +01:00
":ControlFlowInterfaces",
":DialectUtils",
":IR",
":LoopLikeInterface",
":MemRefDialect",
":ShapedOpInterfaces",
":SideEffectInterfaces",
":Support",
":ValueBoundsOpInterface",
"//llvm:Support",
],
)
cc_library(
name = "EmitCDialect",
srcs = glob([
"lib/Dialect/EmitC/IR/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/EmitC/IR/*.h",
]),
includes = ["include"],
deps = [
":CastInterfaces",
":EmitCAttributesIncGen",
":EmitCOpsIncGen",
":IR",
":SideEffectInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "AsyncDialect",
srcs = glob([
"lib/Dialect/Async/IR/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/Async/IR/*.h",
]),
includes = ["include"],
deps = [
":AsyncOpsIncGen",
":ControlFlowInterfaces",
":IR",
":InferTypeOpInterface",
":SideEffectInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "AsyncTransforms",
srcs = glob([
"lib/Dialect/Async/Transforms/*.cpp",
"lib/Dialect/Async/Transforms/*.h",
]),
hdrs = [
"include/mlir/Dialect/Async/Passes.h",
"include/mlir/Dialect/Async/Transforms.h",
],
includes = ["include"],
deps = [
":Analysis",
":ArithDialect",
":AsyncDialect",
":AsyncPassIncGen",
":ControlFlowDialect",
":FuncDialect",
":IR",
":Pass",
":SCFDialect",
":SCFToControlFlow",
":Support",
":TransformUtils",
":Transforms",
":TransformsPassIncGen",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "AffineAnalysis",
srcs = glob([
"lib/Dialect/Affine/Analysis/*.cpp",
"lib/Dialect/Affine/Analysis/*.h",
]),
hdrs = glob(["include/mlir/Dialect/Affine/Analysis/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":Analysis",
":ArithDialect",
":DialectUtils",
":FuncDialect",
":IR",
":SideEffectInterfaces",
":Support",
2022-03-04 04:20:08 +00:00
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "AffineUtils",
srcs = glob(
[
"lib/Dialect/Affine/Utils/*.cpp",
"lib/Dialect/Affine/Utils/*.h",
],
),
hdrs = [
"include/mlir/Dialect/Affine/LoopFusionUtils.h",
"include/mlir/Dialect/Affine/LoopUtils.h",
"include/mlir/Dialect/Affine/Utils.h",
"include/mlir/Dialect/Affine/ViewLikeInterfaceUtils.h",
],
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
":Analysis",
":ArithUtils",
":DialectUtils",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":MemRefDialect",
":SCFDialect",
":Support",
":TransformUtils",
":ViewLikeInterface",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "AffinePassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Affine",
],
"include/mlir/Dialect/Affine/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Affine/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "AffineTransforms",
srcs = glob([
"lib/Dialect/Affine/Transforms/*.cpp",
"lib/Dialect/Affine/Transforms/*.h",
]),
hdrs = [
"include/mlir/Dialect/Affine/Passes.h",
"include/mlir/Dialect/Affine/Transforms/Transforms.h",
],
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
":AffinePassIncGen",
":AffineUtils",
":Analysis",
":ArithDialect",
":ArithUtils",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":SCFUtils",
":Support",
":TensorDialect",
":Transforms",
":ValueBoundsOpInterface",
":VectorDialect",
":VectorUtils",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ConversionPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Conversion",
],
"include/mlir/Conversion/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=Conversion",
],
"include/mlir/Conversion/Passes.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=Conversion",
],
"include/mlir/Conversion/Passes.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Conversion/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "ConversionPasses",
hdrs = ["include/mlir/Conversion/Passes.h"],
includes = ["include"],
deps = [
":AMDGPUToROCDL",
":AffineToStandard",
":ArithToLLVM",
":ArithToSPIRV",
":ArmNeon2dToIntr",
":AsyncToLLVM",
":BufferizationToMemRef",
":ComplexToLLVM",
":ComplexToLibm",
":ComplexToSPIRV",
":ComplexToStandard",
":ControlFlowToLLVM",
":ControlFlowToSPIRV",
":ConversionPassIncGen",
":FuncToLLVM",
2022-03-03 02:05:11 +00:00
":FuncToSPIRV",
":GPUToGPURuntimeTransforms",
":GPUToNVVMTransforms",
":GPUToROCDLTransforms",
":GPUToSPIRV",
":GPUToVulkanTransforms",
":IndexToLLVM",
":LinalgToStandard",
2022-08-26 09:04:50 +02:00
":MathToFuncs",
":MathToLLVM",
":MathToLibm",
":MathToSPIRV",
":MemRefToLLVM",
":MemRefToSPIRV",
":NVGPUToNVVM",
":NVVMToLLVM",
":OpenACCToLLVM",
":OpenACCToSCF",
":OpenMPToLLVM",
":PDLToPDLInterp",
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion Conversion to the LLVM dialect is being refactored to be more progressive and is now performed as a series of independent passes converting different dialects. These passes may produce `unrealized_conversion_cast` operations that represent pending conversions between built-in and LLVM dialect types. Historically, a more monolithic Standard-to-LLVM conversion pass did not need these casts as all operations were converted in one shot. Previous refactorings have led to the requirement of running the Standard-to-LLVM conversion pass to clean up `unrealized_conversion_cast`s even though the IR had no standard operations in it. The pass must have been also run the last among all to-LLVM passes, in contradiction with the partial conversion logic. Additionally, the way it was set up could produce invalid operations by removing casts between LLVM and built-in types even when the consumer did not accept the uncasted type, or could lead to cryptic conversion errors (recursive application of the rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure to eliminate casts). In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not specific to to-LLVM conversions and can be factored out into a separate type reconciliation pass, which is achieved in this commit. While the cast operation itself has a folder pattern, it is insufficient in most conversion passes as the folder only applies to the second cast. Without complex legality setup in the conversion target, the conversion infra will either consider the cast operations valid and not fold them (a separate canonicalization would be necessary to trigger the folding), or consider the first cast invalid upon generation and stop with error. The pattern provided by the reconciliation pass applies to the first cast operation instead. Furthermore, having a separate pass makes it clear when `unrealized_conversion_cast`s could not have been eliminated since it is the only reason why this pass can fail. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D109507
2021-09-09 16:06:10 +02:00
":ReconcileUnrealizedCasts",
":SCFToControlFlow",
":SCFToGPU",
":SCFToOpenMP",
":SCFToSPIRV",
":SPIRVToLLVM",
":ShapeToStandard",
":TensorToLinalg",
2022-03-03 02:05:11 +00:00
":TensorToSPIRV",
":TosaToArith",
":TosaToLinalg",
":TosaToSCF",
":TosaToTensor",
":UBToLLVM",
":UBToSPIRV",
":VectorToArmSME",
":VectorToGPU",
":VectorToLLVM",
":VectorToSCF",
":VectorToSPIRV",
],
)
cc_library(
name = "AsyncToLLVM",
srcs = glob([
"lib/Conversion/AsyncToLLVM/*.cpp",
"lib/Conversion/AsyncToLLVM/*.h",
]),
hdrs = glob(["include/mlir/Conversion/AsyncToLLVM/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":AsyncDialect",
":ConversionPassIncGen",
":FuncDialect",
":FuncToLLVM",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "AffineToStandard",
srcs = glob([
"lib/Conversion/AffineToStandard/*.cpp",
"lib/Conversion/AffineToStandard/*.h",
]),
hdrs = glob(["include/mlir/Conversion/AffineToStandard/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":AffineUtils",
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
":VectorDialect",
],
)
# SDBM dialect only contains attribute components that can be constructed given
# a dialect object, so whenever it is used it must also be registered. Therefore
# we don't split out the registration library for it.
cc_library(
name = "SDBM",
srcs = glob([
"lib/Dialect/SDBM/*.cpp",
"lib/Dialect/SDBM/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/SDBM/*.h",
]),
includes = ["include"],
deps = [
":IR",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "SCFDialect",
srcs = glob(
[
"lib/Dialect/SCF/IR/*.cpp",
"lib/Dialect/SCF/IR/*.h",
],
),
hdrs = glob(
[
"include/mlir/Dialect/SCF/IR/*.h",
],
),
includes = ["include"],
deps = [
":ArithDialect",
":ArithUtils",
":BufferizationDialect",
":ControlFlowDialect",
":ControlFlowInterfaces",
":FuncDialect",
":IR",
":InferTypeOpInterface",
":LoopLikeInterface",
":MemRefDialect",
":ParallelCombiningOpInterface",
":Pass",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
":SCFDeviceMappingInterfacesIncGen",
":SCFIncGen",
":SCFPassIncGen",
":Support",
":TensorDialect",
2023-04-13 14:58:11 +02:00
":ValueBoundsOpInterface",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "SCFUtils",
srcs = glob(
[
"lib/Dialect/SCF/Utils/*.cpp",
],
),
hdrs = glob(
[
"include/mlir/Dialect/SCF/Utils/*.h",
],
),
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
":Analysis",
":ArithDialect",
":DialectUtils",
":FuncDialect",
":IR",
":SCFDialect",
":SideEffectInterfaces",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "InferIntRangeCommon",
srcs = [
"lib/Interfaces/Utils/InferIntRangeCommon.cpp",
],
hdrs = ["include/mlir/Interfaces/Utils/InferIntRangeCommon.h"],
includes = ["include"],
deps = [
":IR",
":InferIntRangeInterface",
2023-01-20 21:58:56 +01:00
"//llvm:Support",
],
)
cc_library(
name = "DataLayoutInterfaces",
srcs = ["lib/Interfaces/DataLayoutInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/DataLayoutInterfaces.h"],
includes = ["include"],
deps = [
":DataLayoutInterfacesIncGen",
":IR",
"//llvm:Support",
],
)
cc_library(
name = "LoopLikeInterface",
srcs = ["lib/Interfaces/LoopLikeInterface.cpp"],
hdrs = ["include/mlir/Interfaces/LoopLikeInterface.h"],
includes = ["include"],
deps = [
":IR",
":LoopLikeInterfaceIncGen",
"//llvm:Support",
],
)
cc_library(
name = "MemorySlotInterfaces",
srcs = ["lib/Interfaces/MemorySlotInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/MemorySlotInterfaces.h"],
includes = ["include"],
deps = [
":IR",
":MemorySlotInterfacesIncGen",
"//llvm:Support",
],
)
cc_library(
name = "ShapedOpInterfaces",
srcs = ["lib/Interfaces/ShapedOpInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/ShapedOpInterfaces.h"],
includes = ["include"],
deps = [
":IR",
":ShapedOpInterfacesIncGen",
"//llvm:Support",
],
)
cc_library(
name = "ParallelCombiningOpInterface",
srcs = ["lib/Interfaces/ParallelCombiningOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/ParallelCombiningOpInterface.h"],
includes = ["include"],
deps = [
":IR",
":ParallelCombiningOpInterfaceIncGen",
"//llvm:Support",
],
)
cc_library(
name = "RuntimeVerifiableOpInterface",
srcs = ["lib/Interfaces/RuntimeVerifiableOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/RuntimeVerifiableOpInterface.h"],
includes = ["include"],
deps = [
":IR",
":RuntimeVerifiableOpInterfaceIncGen",
"//llvm:Support",
],
)
cc_library(
name = "VectorInterfaces",
srcs = ["lib/Interfaces/VectorInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/VectorInterfaces.h"],
includes = ["include"],
deps = [
":IR",
":VectorInterfacesIncGen",
],
)
cc_library(
name = "ViewLikeInterface",
srcs = ["lib/Interfaces/ViewLikeInterface.cpp"],
hdrs = ["include/mlir/Interfaces/ViewLikeInterface.h"],
includes = ["include"],
deps = [
":DialectUtils",
":IR",
":ViewLikeInterfaceIncGen",
],
)
cc_library(
name = "CopyOpInterface",
srcs = ["lib/Interfaces/CopyOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/CopyOpInterface.h"],
includes = ["include"],
deps = [
":CopyOpInterfaceIncGen",
":IR",
],
)
td_library(
name = "ShapeOpsTdFiles",
srcs = [
"include/mlir/Dialect/Shape/IR/ShapeBase.td",
"include/mlir/Dialect/Shape/IR/ShapeOps.td",
],
includes = ["include"],
deps = [
":CallInterfacesTdFiles",
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":FunctionInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ShapeOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Shape/IR/ShapeOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Shape/IR/ShapeOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/Shape/IR/ShapeOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/Shape/IR/ShapeOpsDialect.cpp.inc",
),
(
["-gen-typedef-decls"],
"include/mlir/Dialect/Shape/IR/ShapeOpsTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/Shape/IR/ShapeOpsTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Shape/IR/ShapeOps.td",
deps = [":ShapeOpsTdFiles"],
)
gentbl_cc_library(
name = "MLIRShapeCanonicalizationIncGen",
strip_include_prefix = "include/mlir/Dialect/Shape/IR",
tbl_outs = [
(
["-gen-rewriters"],
"include/mlir/Dialect/Shape/IR/ShapeCanonicalization.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Dialect/Shape/IR/ShapeCanonicalization.td",
deps = [
":FuncTdFiles",
":ShapeOpsTdFiles",
":TensorOpsTdFiles",
],
)
cc_library(
name = "ShapeDialect",
srcs = glob(["lib/Dialect/Shape/IR/*.cpp"]),
hdrs = ["include/mlir/Dialect/Shape/IR/Shape.h"],
includes = ["include"],
deps = [
":ArithDialect",
":CastInterfaces",
":ControlFlowInterfaces",
":Dialect",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":InferTypeOpInterface",
":MLIRShapeCanonicalizationIncGen",
":ShapeOpsIncGen",
":SideEffectInterfaces",
":TensorDialect",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ShapeToStandardGen",
strip_include_prefix = "lib/Conversion/ShapeToStandard",
tbl_outs = [
(
["-gen-rewriters"],
"lib/Conversion/ShapeToStandard/ShapeToStandard.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Conversion/ShapeToStandard/ShapeToStandard.td",
deps = [":ShapeOpsTdFiles"],
)
cc_library(
name = "ShapeToStandard",
srcs = glob([
"lib/Conversion/ShapeToStandard/*.cpp",
"lib/Conversion/ShapeToStandard/*.h",
]),
hdrs = ["include/mlir/Conversion/ShapeToStandard/ShapeToStandard.h"],
includes = ["include"],
deps = [
":ArithDialect",
":ControlFlowDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":ShapeDialect",
":ShapeToStandardGen",
":Support",
":TensorDialect",
":Transforms",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ShapeTransformsPassIncGen",
strip_include_prefix = "include",
tbl_outs = [(
[
"-gen-pass-decls",
"-name=Shape",
],
"include/mlir/Dialect/Shape/Transforms/Passes.h.inc",
)],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Shape/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "ShapeTransforms",
srcs = glob([
"lib/Dialect/Shape/Transforms/*.cpp",
"lib/Dialect/Shape/Transforms/*.h",
]),
hdrs = [
2022-10-03 09:06:42 +02:00
"include/mlir/Dialect/Shape/Analysis/ShapeMappingAnalysis.h",
"include/mlir/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.h",
"include/mlir/Dialect/Shape/Transforms/Passes.h",
],
includes = ["include"],
deps = [
":ArithDialect",
":BufferizationDialect",
":BufferizationTransforms",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":ShapeDialect",
":ShapeTransformsPassIncGen",
2022-10-03 09:06:42 +02:00
":TensorDialect",
":Transforms",
2022-10-03 09:06:42 +02:00
"//llvm:Support",
],
)
td_library(
name = "ControlFlowOpsTdFiles",
srcs = [
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td",
],
includes = ["include"],
deps = [
":AttrTdFiles",
":CallInterfacesTdFiles",
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ControlFlowOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/ControlFlow/IR/ControlFlowOpsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/ControlFlow/IR/ControlFlowOps.td",
deps = [
":AttrTdFiles",
":ControlFlowOpsTdFiles",
],
)
cc_library(
name = "ControlFlowDialect",
srcs = glob(
[
"lib/Dialect/ControlFlow/IR/*.cpp",
"lib/Dialect/ControlFlow/IR/*.h",
],
),
hdrs = glob([
"include/mlir/Dialect/ControlFlow/IR/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":CommonFolders",
":ControlFlowInterfaces",
":ControlFlowOpsIncGen",
":IR",
":SideEffectInterfaces",
":Support",
"//llvm:Support",
],
)
cc_library(
2022-03-02 00:07:56 +01:00
name = "FuncDialect",
srcs = glob(
[
2022-03-02 00:07:56 +01:00
"lib/Dialect/Func/IR/*.cpp",
"lib/Dialect/Func/IR/*.h",
"lib/Dialect/Func/Utils/*.cpp",
],
),
hdrs = glob([
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/IR/*.h",
"include/mlir/Dialect/Func/Utils/*.h",
]) + ["include/mlir/Transforms/InliningUtils.h"],
includes = ["include"],
deps = [
":ArithDialect",
":CallOpInterfaces",
":CastInterfaces",
":CommonFolders",
":ControlFlowDialect",
":ControlFlowInterfaces",
2022-03-02 00:07:56 +01:00
":FuncIncGen",
":IR",
":InferTypeOpInterface",
":SideEffectInterfaces",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "FuncExtensions",
srcs = glob(["lib/Dialect/Func/Extensions/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Func/Extensions/*.h"]),
includes = ["include"],
deps = [
":ControlFlowDialect",
":FuncDialect",
":IR",
":InferTypeOpInterface",
],
)
cc_library(
name = "AllExtensions",
hdrs = ["include/mlir/InitAllExtensions.h"],
deps = [
":FuncExtensions",
],
)
2022-03-02 00:07:56 +01:00
# TODO(zinenko): remove this after updating users.
gentbl_cc_library(
2022-03-02 00:07:56 +01:00
name = "FuncTransformsPassIncGen",
strip_include_prefix = "include",
tbl_outs = [(
[
"-gen-pass-decls",
2022-03-02 00:07:56 +01:00
"-name=Func",
],
2022-03-02 00:07:56 +01:00
"include/mlir/Dialect/Func/Transforms/Passes.h.inc",
)],
tblgen = ":mlir-tblgen",
2022-03-02 00:07:56 +01:00
td_file = "include/mlir/Dialect/Func/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
2022-03-02 00:07:56 +01:00
name = "FuncTransforms",
srcs = glob([
2022-03-02 00:07:56 +01:00
"lib/Dialect/Func/Transforms/*.cpp",
"lib/Dialect/Func/Transforms/*.h",
]),
2022-03-02 00:07:56 +01:00
hdrs = glob(["include/mlir/Dialect/Func/Transforms/*.h"]),
includes = ["include"],
deps = [
":BufferizationDialect",
":BufferizationTransforms",
":FuncDialect",
2022-03-02 00:07:56 +01:00
":FuncTransformsPassIncGen",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "VectorDialect",
srcs = glob(
[
"lib/Dialect/Vector/IR/*.cpp",
],
),
hdrs = glob([
"include/mlir/Dialect/Vector/IR/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ArithUtils",
":ControlFlowInterfaces",
":DataLayoutInterfaces",
":DestinationStyleOpInterface",
":DialectUtils",
":IR",
":InferTypeOpInterface",
":MaskableOpInterface",
":MaskingOpInterface",
":MemRefDialect",
":SideEffectInterfaces",
":Support",
":TensorDialect",
":VectorInterfaces",
":VectorOpsIncGen",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "VectorTransformOps",
srcs = [
"lib/Dialect/Vector/TransformOps/VectorTransformOps.cpp",
],
hdrs = [
"include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":AsmParser",
":IR",
":LLVMDialect",
":SideEffectInterfaces",
":TransformDialect",
":TransformUtils",
":VectorDialect",
2023-01-17 13:17:56 +01:00
":VectorEnumsIncGen",
":VectorToSCF",
":VectorTransformOpsIncGen",
":VectorTransforms",
":X86VectorTransforms",
"//llvm:Support",
],
)
2023-01-17 13:17:56 +01:00
td_library(
name = "VectorTransformsTdFiles",
srcs = ["include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "VectorEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Vector/Transforms/VectorTransformsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Vector/Transforms/VectorTransformsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/Transforms/VectorTransformsBase.td",
deps = [
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "VectorPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Vector",
],
"include/mlir/Dialect/Vector/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "VectorTransforms",
srcs = glob(
[
"lib/Dialect/Vector/Transforms/*.cpp",
"lib/Dialect/Vector/Transforms/*.h",
],
),
hdrs = glob([
"include/mlir/Dialect/Vector/Transforms/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":ArithTransforms",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":DialectUtils",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":LinalgDialect",
":MemRefDialect",
":MemRefUtils",
":Pass",
":SCFDialect",
":SideEffectInterfaces",
":Support",
":TensorDialect",
":Transforms",
":VectorDialect",
2023-01-17 13:17:56 +01:00
":VectorEnumsIncGen",
":VectorInterfaces",
":VectorPassIncGen",
":VectorUtils",
"//llvm:Support",
],
)
cc_library(
name = "VectorUtils",
srcs = glob(
[
"lib/Dialect/Vector/Utils/*.cpp",
],
),
hdrs = glob([
"include/mlir/Dialect/Vector/Utils/*.h",
]),
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
":ArithDialect",
":DialectUtils",
":FuncDialect",
":IR",
":MemRefDialect",
":Support",
":TensorDialect",
":VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "Support",
srcs = glob([
"lib/Support/*.cpp",
"lib/Support/*.h",
]),
hdrs = glob(["include/mlir/Support/*.h"]),
includes = ["include"],
2022-12-20 20:09:00 +01:00
deps = [
"//llvm:Support",
"//llvm:TargetParser",
],
)
2023-03-06 17:24:26 +01:00
cc_library(
name = "Debug",
srcs = glob([
"lib/Debug/*.cpp",
"lib/Debug/*.h",
"lib/Debug/BreakpointManagers/*.cpp",
"lib/Debug/BreakpointManagers/*.h",
"lib/Debug/Observers/*.cpp",
"lib/Debug/Observers/*.h",
2023-03-06 17:24:26 +01:00
]),
hdrs = glob([
"include/mlir/Debug/*.h",
"include/mlir/Debug/BreakpointManagers/*.h",
"include/mlir/Debug/Observers/*.h",
]),
includes = ["include"],
deps = [
":CAPIIR",
2023-03-06 17:24:26 +01:00
":IR",
":Support",
2023-03-06 17:24:26 +01:00
"//llvm:Support",
],
)
cc_library(
name = "MlirLspServerSupportLib",
srcs = glob(
[
"lib/Tools/lsp-server-support/*.cpp",
],
),
hdrs = glob(
[
"include/mlir/Tools/lsp-server-support/*.h",
],
),
deps = [
":Support",
"//llvm:Support",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
cc_library(
name = "MlirLspServerLib",
srcs = glob(
[
"lib/Tools/mlir-lsp-server/*.cpp",
"lib/Tools/mlir-lsp-server/*.h",
"lib/Tools/mlir-lsp-server/lsp/*.cpp",
"lib/Tools/mlir-lsp-server/lsp/*.h",
],
),
hdrs = glob(
["include/mlir/Tools/mlir-lsp-server/*.h"],
),
includes = ["include"],
deps = [
":AsmParser",
":BytecodeWriter",
":IR",
":MlirLspServerSupportLib",
":Parser",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "MlirPdllLspServerLib",
srcs = glob(
[
"lib/Tools/mlir-pdll-lsp-server/*.cpp",
"lib/Tools/mlir-pdll-lsp-server/*.h",
],
),
hdrs = glob(
["include/mlir/Tools/mlir-pdll-lsp-server/*.h"],
),
includes = ["include"],
deps = [
":IR",
":MlirLspServerSupportLib",
":PDLLAST",
":PDLLCodeGen",
":PDLLODS",
":PDLLParser",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "AsmParserTokenKinds",
# strip_include_prefix does not apply to textual_hdrs.
hdrs = ["lib/AsmParser/TokenKinds.def"],
strip_include_prefix = "lib/AsmParser",
textual_hdrs = ["lib/AsmParser/TokenKinds.def"],
)
cc_library(
name = "AsmParser",
srcs = glob([
"lib/AsmParser/*.cpp",
"lib/AsmParser/*.h",
]),
hdrs = glob([
"include/mlir/AsmParser/*.h",
]),
includes = ["include"],
deps = [
":AsmParserTokenKinds",
":IR",
":Support",
"//llvm:Support",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
cc_library(
name = "BytecodeReader",
srcs = glob([
"lib/Bytecode/Reader/*.cpp",
"lib/Bytecode/Reader/*.h",
"lib/Bytecode/*.h",
]),
hdrs = glob([
"include/mlir/Bytecode/*.h",
]),
includes = ["include"],
deps = [
":AsmParser",
":BytecodeOpInterfaceIncGen",
":IR",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "BytecodeWriter",
srcs = glob([
"lib/Bytecode/Writer/*.cpp",
"lib/Bytecode/Writer/*.h",
"lib/Bytecode/*.h",
]),
hdrs = glob([
"include/mlir/Bytecode/*.h",
]),
includes = ["include"],
deps = [
":BytecodeOpInterfaceIncGen",
":IR",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "Parser",
srcs = glob([
"lib/Parser/*.cpp",
"lib/Parser/*.h",
]),
hdrs = glob([
"include/mlir/Parser/*.h",
]),
includes = ["include"],
deps = [
":AsmParser",
":BytecodeReader",
":IR",
":Support",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "LLVMDialectInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/LLVMIR/LLVMInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/LLVMIR/LLVMInterfaces.cpp.inc",
),
(
["-gen-type-interface-decls"],
"include/mlir/Dialect/LLVMIR/LLVMTypeInterfaces.h.inc",
),
(
["-gen-type-interface-defs"],
"include/mlir/Dialect/LLVMIR/LLVMTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMInterfaces.td",
deps = [":LLVMOpsTdFiles"],
)
cc_library(
name = "LLVMDialect",
srcs = glob(
[
"lib/Dialect/LLVMIR/IR/*.cpp",
"lib/Dialect/LLVMIR/IR/*.h",
],
exclude = [
"lib/Dialect/LLVMIR/IR/*AMX*.cpp",
"lib/Dialect/LLVMIR/IR/*AMX*.h",
"lib/Dialect/LLVMIR/IR/*ArmSVE*.cpp",
"lib/Dialect/LLVMIR/IR/*ArmSVE*.h",
"lib/Dialect/LLVMIR/IR/NVVM*.cpp",
"lib/Dialect/LLVMIR/IR/NVVM*.h",
"lib/Dialect/LLVMIR/IR/ROCDL*.cpp",
"lib/Dialect/LLVMIR/IR/ROCDL*.h",
"lib/Dialect/LLVMIR/IR/*X86Vector*.cpp",
"lib/Dialect/LLVMIR/IR/*X86Vector*.h",
],
),
hdrs = glob(
["include/mlir/Dialect/LLVMIR/*.h"],
exclude = [
"include/mlir/Dialect/LLVMIR/*AMX*.h",
"include/mlir/Dialect/LLVMIR/*ArmSVE*.h",
"include/mlir/Dialect/LLVMIR/NVVM*.h",
"include/mlir/Dialect/LLVMIR/ROCDL*.h",
"include/mlir/Dialect/LLVMIR/*X86Vector*.h",
],
) + [
"include/mlir/Transforms/InliningUtils.h",
"include/mlir/Transforms/Mem2Reg.h",
],
includes = ["include"],
deps = [
":CallOpInterfaces",
":ControlFlowInterfaces",
":DataLayoutInterfaces",
":IR",
":InferTypeOpInterface",
":LLVMDialectInterfaceIncGen",
":LLVMIntrinsicOpsIncGen",
":LLVMOpsIncGen",
":LLVMTypesIncGen",
":MemorySlotInterfaces",
":MemorySlotInterfacesIncGen",
":SideEffectInterfaces",
":Support",
"//llvm:AsmParser",
"//llvm:BinaryFormat",
"//llvm:BitReader",
"//llvm:BitWriter",
"//llvm:Core",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "LLVMPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=LLVM",
],
"include/mlir/Dialect/LLVMIR/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "LLVMIRTransforms",
srcs = glob([
"lib/Dialect/LLVMIR/Transforms/*.cpp",
"lib/Dialect/LLVMIR/Transforms/*.h",
]),
hdrs = glob(["include/mlir/Dialect/LLVMIR/Transforms/*.h"]),
includes = ["include"],
deps = [
":FuncDialect",
":IR",
":LLVMDialect",
":LLVMPassIncGen",
":NVVMDialect",
":Pass",
":Transforms",
"//llvm:BinaryFormat",
"//llvm:Support",
],
)
td_library(
name = "GPUOpsTdFiles",
srcs = [
"include/mlir/Dialect/GPU/IR/GPUBase.td",
"include/mlir/Dialect/GPU/IR/GPUOps.td",
"include/mlir/Dialect/GPU/IR/ParallelLoopMapperAttr.td",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
"include/mlir/Dialect/GPU/TransformOps/GPUDeviceMappingAttr.td",
],
includes = ["include"],
deps = [
":DLTIDialectTdFiles",
":DataLayoutInterfacesTdFiles",
2022-01-19 14:14:36 +01:00
":FunctionInterfacesTdFiles",
":InferIntRangeInterfaceTdFiles",
":LLVMOpsTdFiles",
":OpBaseTdFiles",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
":SCFTdFiles",
":SideEffectInterfacesTdFiles",
],
)
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
gentbl_cc_library(
name = "GPUDeviceMapperEnumsGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/GPU/TransformOps/GPUDeviceMapperEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/GPU/TransformOps/GPUDeviceMapperEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/GPU/TransformOps/GPUDeviceMappingAttr.td",
deps = [
":GPUOpsTdFiles",
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "GPUBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/GPU/IR/GPUOpInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/GPU/IR/GPUOpInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/GPU/IR/GPUBase.td",
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "GPUOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
2022-01-18 22:39:24 +00:00
(
[
"-gen-dialect-decls",
"-dialect=gpu",
],
"include/mlir/Dialect/GPU/IR/GPUOpsDialect.h.inc",
2022-01-18 22:39:24 +00:00
),
(
[
"-gen-dialect-defs",
"-dialect=gpu",
],
"include/mlir/Dialect/GPU/IR/GPUOpsDialect.cpp.inc",
2022-01-18 22:39:24 +00:00
),
(
["-gen-op-decls"],
"include/mlir/Dialect/GPU/IR/GPUOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/GPU/IR/GPUOps.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/GPU/IR/GPUOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/GPU/IR/GPUOpsEnums.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/GPU/IR/GPUOpsAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/GPU/IR/GPUOpsAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/GPU/IR/GPUOps.td",
deps = [
":DLTIDialectTdFiles",
":GPUOpsTdFiles",
],
)
cc_library(
name = "GPUDialect",
srcs = glob(
[
"lib/Dialect/GPU/IR/*.cpp",
"lib/Dialect/GPU/IR/*.h",
],
),
hdrs = glob(["include/mlir/Dialect/GPU/IR/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":DLTIDialect",
":GPUBaseIncGen",
":GPUOpsIncGen",
":IR",
":InferIntRangeInterface",
":InferTypeOpInterface",
":LLVMDialect",
":MemRefDialect",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
":SCFDialect",
":SideEffectInterfaces",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "GPUPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=GPU",
],
"include/mlir/Dialect/GPU/Transforms/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=GPU",
],
"include/mlir/Dialect/GPU/Transforms/Passes.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=GPU",
],
"include/mlir/Dialect/GPU/Transforms/Passes.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/GPU/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "GPUTransforms",
srcs = glob(
[
"lib/Dialect/GPU/Transforms/*.cpp",
"lib/Dialect/GPU/Transforms/*.h",
],
exclude = [
"lib/Dialect/GPU/Transforms/SerializeToCubin.cpp",
],
),
hdrs = glob(["include/mlir/Dialect/GPU/Transforms/*.h"]),
includes = ["include"],
local_defines = if_cuda_available(["MLIR_GPU_TO_CUBIN_PASS_ENABLE"]),
deps = [
":AffineUtils",
":ArithDialect",
":AsmParser",
":AsyncDialect",
":ControlFlowDialect",
":DLTIDialect",
":ExecutionEngineUtils",
":FuncDialect",
":GPUDialect",
":GPUPassIncGen",
":GPUToLLVMIRTranslation",
":IR",
":IndexDialect",
":LLVMToLLVMIRTranslation",
":MemRefDialect",
":Pass",
":ROCDLToLLVMIRTranslation",
":SCFDialect",
":SerializeToCubin_stub",
":SideEffectInterfaces",
":Support",
":ToLLVMIRTranslation",
":Transforms",
"//llvm:Core",
"//llvm:MC",
"//llvm:Support",
"//llvm:Target",
] + if_cuda_available([
":NVVMToLLVMIRTranslation",
"//llvm:NVPTXCodeGen",
]),
)
cc_library(
name = "SerializeToCubin",
srcs = [
"lib/Dialect/GPU/Transforms/SerializeToCubin.cpp",
],
local_defines = if_cuda_available(["MLIR_GPU_TO_CUBIN_PASS_ENABLE"]),
deps = [
":GPUDialect",
":GPUPassIncGen",
":GPUTransforms",
":NVVMToLLVMIRTranslation",
":Pass",
":Support",
":ToLLVMIRTranslation",
"//llvm:Support",
] + if_cuda_available([
"@cuda//:cuda_headers",
"@cuda//:libcuda",
]),
)
write_file(
name = "SerializeToCubin_stub_cc",
out = "SerializeToCubin_stub.cc",
content = [
"""
#include "mlir/Dialect/GPU/Transforms/Passes.h"
// Provide a weak registration stub in case the real SerializeToCubin is not
// linked in.
#if defined(_MSC_VER)
// This might not work correctly, but it avoids a compilation error because
// MSVC does not support __attribute__((weak)).
void mlir::registerGpuSerializeToCubinPass() {}
#else
__attribute__((weak)) void mlir::registerGpuSerializeToCubinPass() {}
#endif
""",
],
)
cc_library(
name = "SerializeToCubin_stub",
srcs = [":SerializeToCubin_stub_cc"],
hdrs = glob(["include/mlir/Dialect/GPU/Transforms/*.h"]),
includes = ["include"],
deps = [
":GPUDialect",
":GPUPassIncGen",
":Pass",
":Support",
"//llvm:Support",
],
)
td_library(
name = "GPUTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td",
],
includes = ["include"],
deps = [
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "GPUTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td",
deps = [
":GPUTransformOpsTdFiles",
],
)
cc_library(
name = "GPUTransformOps",
srcs = glob([
"lib/Dialect/GPU/TransformOps/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/GPU/TransformOps/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":AsmParser",
":ControlFlowDialect",
":DialectUtils",
":FuncDialect",
":GPUDialect",
":GPUTransformOpsIncGen",
":GPUTransforms",
":IR",
":MemRefDialect",
":Parser",
":SCFDialect",
":SideEffectInterfaces",
":Support",
":TransformDialect",
":TransformUtils",
":VectorDialect",
":VectorTransforms",
"//llvm:Support",
],
)
td_library(
name = "LLVMOpsTdFiles",
srcs = [
"include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td",
2023-04-14 11:11:39 +02:00
"include/mlir/Dialect/LLVMIR/LLVMDialect.td",
"include/mlir/Dialect/LLVMIR/LLVMEnums.td",
"include/mlir/Dialect/LLVMIR/LLVMInterfaces.td",
"include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td",
"include/mlir/Dialect/LLVMIR/LLVMOpBase.td",
"include/mlir/Dialect/LLVMIR/LLVMOps.td",
"include/mlir/Dialect/LLVMIR/LLVMTypes.td",
],
includes = ["include"],
deps = [
":CallInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":DataLayoutInterfacesTdFiles",
2022-01-19 14:14:36 +01:00
":FunctionInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":MemorySlotInterfacesTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
cc_library(
name = "GPUCommonTransforms",
srcs = [
"lib/Conversion/GPUCommon/GPUOpsLowering.cpp",
],
hdrs = [
"include/mlir/Conversion/GPUCommon/GPUCommonPass.h",
"lib/Conversion/GPUCommon/GPUOpsLowering.h",
"lib/Conversion/GPUCommon/IndexIntrinsicsOpLowering.h",
"lib/Conversion/GPUCommon/OpToFuncCallLowering.h",
],
deps = [
":ConversionPassIncGen",
":FuncDialect",
":GPUDialect",
":GPUTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Support",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "GPUToNVVMGen",
strip_include_prefix = "lib/Conversion/GPUToNVVM",
tbl_outs = [
(
["-gen-rewriters"],
"lib/Conversion/GPUToNVVM/GPUToNVVM.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Conversion/GPUToNVVM/GPUToNVVM.td",
deps = [
":GPUOpsTdFiles",
":NVVMOpsTdFiles",
],
)
cc_library(
name = "GPUToNVVMTransforms",
srcs = glob([
"lib/Conversion/GPUToNVVM/*.cpp",
"lib/Conversion/GPUToNVVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/GPUToNVVM/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ArithToLLVM",
":ControlFlowDialect",
":ControlFlowToLLVM",
":ConversionPassIncGen",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":FuncToLLVM",
":GPUCommonTransforms",
":GPUDialect",
":GPUToNVVMGen",
":GPUTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MathDialect",
":MemRefDialect",
":MemRefToLLVM",
":NVVMDialect",
":Pass",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "AMDGPUToROCDL",
srcs = glob([
"lib/Conversion/AMDGPUToROCDL/*.cpp",
"lib/Conversion/AMDGPUToROCDL/*.h",
2023-03-28 13:11:47 -07:00
]) + ["include/mlir/Conversion/GPUToROCDL/Runtimes.h"],
hdrs = glob([
"include/mlir/Conversion/AMDGPUToROCDL/*.h",
]),
includes = ["include"],
deps = [
":AMDGPUDialect",
":AMDGPUUtils",
":ConversionPassIncGen",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":ROCDLDialect",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "NVGPUToNVVM",
srcs = glob([
"lib/Conversion/NVGPUToNVVM/*.cpp",
"lib/Conversion/NVGPUToNVVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/NVGPUToNVVM/*.h",
]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":GPUCommonTransforms",
":GPUDialect",
2023-07-21 13:33:54 +02:00
":GPUToGPURuntimeTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefDialect",
":NVGPUDialect",
":NVVMDialect",
":Pass",
"//llvm:Support",
],
)
cc_library(
name = "VectorToSPIRV",
srcs = glob([
"lib/Conversion/VectorToSPIRV/*.cpp",
"lib/Conversion/VectorToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/VectorToSPIRV/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":IR",
":Pass",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
":VectorDialect",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "GPUToROCDLTGen",
strip_include_prefix = "lib/Conversion/GPUToROCDL",
tbl_outs = [
(
["-gen-rewriters"],
"lib/Conversion/GPUToROCDL/GPUToROCDL.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Conversion/GPUToROCDL/GPUToROCDL.td",
deps = [
":GPUOpsTdFiles",
":ROCDLOpsTdFiles",
],
)
cc_library(
name = "GPUToROCDLTransforms",
srcs = [
"include/mlir/Conversion/GPUToROCDL/Runtimes.h",
"lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp",
],
hdrs = ["include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h"],
includes = ["include"],
deps = [
":AMDGPUToROCDL",
":ArithToLLVM",
":ControlFlowDialect",
2022-02-08 08:48:10 -08:00
":ControlFlowToLLVM",
":ConversionPassIncGen",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":FuncToLLVM",
":GPUCommonTransforms",
":GPUDialect",
":GPUToROCDLTGen",
":GPUTransforms",
2022-04-05 10:14:28 +02:00
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MathDialect",
":MemRefDialect",
":MemRefToLLVM",
":Pass",
":ROCDLDialect",
":Transforms",
":VectorDialect",
":VectorToLLVM",
":VectorToSCF",
"//llvm:Support",
],
)
cc_library(
name = "GPUToVulkanTransforms",
srcs = [
"lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp",
"lib/Conversion/GPUToVulkan/ConvertLaunchFuncToVulkanCalls.cpp",
],
hdrs = ["include/mlir/Conversion/GPUToVulkan/ConvertGPUToVulkanPass.h"],
includes = ["include"],
deps = [
":ConversionPassIncGen",
":FuncDialect",
":GPUDialect",
":IR",
":LLVMDialect",
":Pass",
":SPIRVDialect",
":SPIRVSerialization",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "GPUToGPURuntimeTransforms",
srcs = [
"lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp",
],
hdrs = ["include/mlir/Conversion/GPUCommon/GPUCommonPass.h"],
includes = ["include"],
deps = [
":ArithToLLVM",
":AsyncDialect",
":AsyncToLLVM",
":ControlFlowToLLVM",
":ConversionPassIncGen",
":FuncToLLVM",
":GPUDialect",
":GPUTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefDialect",
":MemRefToLLVM",
":Support",
":VectorToLLVM",
"//llvm:Support",
],
)
cc_library(
name = "GPUToSPIRV",
srcs = glob([
"lib/Conversion/GPUToSPIRV/*.cpp",
"lib/Conversion/GPUToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/GPUToSPIRV/*.h",
]),
includes = [
"include",
"lib/Conversions/GPUToSPIRV",
],
deps = [
":ArithToSPIRV",
":ConversionPassIncGen",
":FuncToSPIRV",
":GPUDialect",
":IR",
":MemRefToSPIRV",
":Pass",
":SCFDialect",
":SCFToSPIRV",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
":VectorToSPIRV",
"//llvm:Support",
],
)
cc_library(
name = "PDLToPDLInterp",
srcs = glob([
"lib/Conversion/PDLToPDLInterp/*.cpp",
"lib/Conversion/PDLToPDLInterp/*.h",
]),
hdrs = [
"include/mlir/Conversion/PDLToPDLInterp/PDLToPDLInterp.h",
"lib/Conversion/PDLToPDLInterp/RootOrdering.h",
],
includes = ["include"],
deps = [
":ConversionPassIncGen",
":IR",
":InferTypeOpInterface",
":PDLDialect",
":PDLInterpDialect",
":Pass",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVToLLVM",
srcs = glob([
"lib/Conversion/SPIRVToLLVM/*.cpp",
]),
hdrs = glob([
"include/mlir/Conversion/SPIRVToLLVM/*.h",
]),
includes = ["include"],
deps = [
":ArithToLLVM",
":ConversionPassIncGen",
":FuncDialect",
":FuncToLLVM",
":GPUDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefToLLVM",
":Pass",
":SPIRVDialect",
":SPIRVUtils",
":Support",
":Transforms",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "LLVMOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/LLVMIR/LLVMOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/LLVMIR/LLVMOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/LLVMIR/LLVMOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/LLVMIR/LLVMOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/LLVMIR/LLVMOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/LLVMIR/LLVMOpsEnums.cpp.inc",
),
(
[
"--gen-attrdef-decls",
"-attrdefs-dialect=llvm",
],
"include/mlir/Dialect/LLVMIR/LLVMOpsAttrDefs.h.inc",
),
(
[
"--gen-attrdef-defs",
"-attrdefs-dialect=llvm",
],
"include/mlir/Dialect/LLVMIR/LLVMOpsAttrDefs.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
deps = [":LLVMOpsTdFiles"],
)
gentbl_cc_library(
name = "LLVMTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-typedef-decls",
"-typedefs-dialect=llvm",
],
"include/mlir/Dialect/LLVMIR/LLVMTypes.h.inc",
),
(
[
"-gen-typedef-defs",
"-typedefs-dialect=llvm",
],
"include/mlir/Dialect/LLVMIR/LLVMTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMTypes.td",
deps = [":LLVMOpsTdFiles"],
)
gentbl_cc_library(
name = "LLVMIntrinsicOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td",
deps = [":LLVMOpsTdFiles"],
)
gentbl_cc_library(
name = "LLVMConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMConversions.inc",
),
(
["-gen-enum-to-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMConversionEnumsToLLVM.inc",
),
(
["-gen-enum-from-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMConversionEnumsFromLLVM.inc",
),
(
["-gen-op-from-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMOpFromLLVMIRConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMOps.td",
deps = [":LLVMOpsTdFiles"],
)
gentbl_cc_library(
name = "LLVMIntrinsicConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMIntrinsicConversions.inc",
),
2022-05-31 13:35:49 +02:00
(
["-gen-intr-from-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/LLVMIntrinsicFromLLVMIRConversions.inc",
),
(
["-gen-convertible-llvmir-intrinsics"],
"include/mlir/Dialect/LLVMIR/LLVMConvertibleLLVMIRIntrinsics.inc",
2022-05-31 13:35:49 +02:00
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td",
deps = [":LLVMOpsTdFiles"],
)
cc_library(
name = "NVVMDialect",
srcs = ["lib/Dialect/LLVMIR/IR/NVVMDialect.cpp"],
hdrs = ["include/mlir/Dialect/LLVMIR/NVVMDialect.h"],
includes = ["include"],
deps = [
":DialectUtils",
":IR",
":LLVMDialect",
":NVVMOpsIncGen",
":SideEffectInterfaces",
":Support",
"//llvm:AsmParser",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
name = "NVVMOpsTdFiles",
srcs = ["include/mlir/Dialect/LLVMIR/NVVMOps.td"],
includes = ["include"],
deps = [
":LLVMOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "NVVMOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/LLVMIR/NVVMOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/LLVMIR/NVVMOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/LLVMIR/NVVMOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/LLVMIR/NVVMOpsEnums.cpp.inc",
),
(
[
"-gen-attrdef-decls",
"-attrdefs-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsAttributes.h.inc",
),
(
[
"-gen-attrdef-defs",
"-attrdefs-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsAttributes.cpp.inc",
),
(
[
"-gen-op-interface-decls",
"-attrdefs-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsInterface.h.inc",
),
(
[
"-gen-op-interface-defs",
"-attrdefs-dialect=nvvm",
],
"include/mlir/Dialect/LLVMIR/NVVMOpsInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
deps = [":NVVMOpsTdFiles"],
)
gentbl_cc_library(
name = "NVVMConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/NVVMConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/NVVMOps.td",
deps = [":NVVMOpsTdFiles"],
)
cc_library(
name = "NVVMToLLVM",
srcs = glob(["lib/Conversion/NVVMToLLVM/NVVMToLLVM.cpp"]),
hdrs = glob(["include/mlir/Conversion/NVVMToLLVM/*.h"]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":FuncDialect",
":GPUDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefDialect",
":NVVMDialect",
":NVVMOpsIncGen",
":Pass",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "ROCDLDialect",
srcs = ["lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp"],
hdrs = ["include/mlir/Dialect/LLVMIR/ROCDLDialect.h"],
includes = ["include"],
deps = [
":IR",
":LLVMDialect",
":ROCDLOpsIncGen",
":SideEffectInterfaces",
"//llvm:AsmParser",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
name = "ROCDLOpsTdFiles",
srcs = ["include/mlir/Dialect/LLVMIR/ROCDLOps.td"],
includes = ["include"],
deps = [
":LLVMOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ROCDLOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/LLVMIR/ROCDLOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/LLVMIR/ROCDLOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=rocdl",
],
"include/mlir/Dialect/LLVMIR/ROCDLOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=rocdl",
],
"include/mlir/Dialect/LLVMIR/ROCDLOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
deps = [":ROCDLOpsTdFiles"],
)
gentbl_cc_library(
name = "ROCDLConversionIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-llvmir-conversions"],
"include/mlir/Dialect/LLVMIR/ROCDLConversions.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/LLVMIR/ROCDLOps.td",
deps = [":ROCDLOpsTdFiles"],
)
cc_library(
name = "PDLDialect",
srcs = glob([
"lib/Dialect/PDL/IR/*.cpp",
"lib/Dialect/PDL/IR/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/PDL/IR/*.h",
]),
includes = ["include"],
deps = [
":IR",
":InferTypeOpInterface",
":PDLOpsIncGen",
":PDLTypesIncGen",
":SideEffectInterfaces",
"//llvm:Support",
],
)
td_library(
name = "PDLDialectTdFiles",
srcs = [
"include/mlir/Dialect/PDL/IR/PDLDialect.td",
"include/mlir/Dialect/PDL/IR/PDLOps.td",
"include/mlir/Dialect/PDL/IR/PDLTypes.td",
],
deps = [
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "PDLOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/PDL/IR/PDLOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/PDL/IR/PDLOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/PDL/IR/PDLOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/PDL/IR/PDLOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/PDL/IR/PDLOps.td",
deps = [":PDLDialectTdFiles"],
)
gentbl_cc_library(
name = "PDLTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-typedef-decls"],
"include/mlir/Dialect/PDL/IR/PDLOpsTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/PDL/IR/PDLOpsTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/PDL/IR/PDLTypes.td",
deps = [":PDLDialectTdFiles"],
)
cc_library(
name = "PDLInterpDialect",
srcs = glob([
"lib/Dialect/PDLInterp/IR/*.cpp",
"lib/Dialect/PDLInterp/IR/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/PDLInterp/IR/*.h",
]),
includes = ["include"],
deps = [
":IR",
":InferTypeOpInterface",
":PDLDialect",
":PDLInterpOpsIncGen",
":SideEffectInterfaces",
"//llvm:Support",
],
)
td_library(
name = "PDLInterpOpsTdFiles",
srcs = ["include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td"],
includes = ["include"],
deps = [
":FunctionInterfacesTdFiles",
":OpBaseTdFiles",
":PDLDialectTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "PDLInterpOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=pdl_interp",
],
"include/mlir/Dialect/PDLInterp/IR/PDLInterpOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=pdl_interp",
],
"include/mlir/Dialect/PDLInterp/IR/PDLInterpOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td",
deps = [":PDLInterpOpsTdFiles"],
)
td_library(
name = "SPIRVOpsTdFiles",
srcs = glob(["include/mlir/Dialect/SPIRV/IR/*.td"]),
includes = ["include"],
deps = [
":BuiltinDialectTdFiles",
":CallInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
2022-01-19 14:14:36 +01:00
":FunctionInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "SPIRVOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVOpsDialect.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/SPIRV/SPIRVOps.md",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVEnums.cpp.inc",
),
(
["-gen-spirv-enum-avail-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVEnumAvailability.h.inc",
),
(
["-gen-spirv-enum-avail-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVEnumAvailability.cpp.inc",
),
(
["-gen-spirv-capability-implication"],
"include/mlir/Dialect/SPIRV/IR/SPIRVCapabilityImplication.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
deps = [":SPIRVOpsTdFiles"],
)
gentbl_cc_library(
name = "SPIRVAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.td",
deps = [":SPIRVOpsTdFiles"],
)
gentbl_cc_library(
name = "SPIRVCanonicalizationIncGen",
strip_include_prefix = "lib/Dialect/SPIRV/IR",
tbl_outs = [
(
["-gen-rewriters"],
"lib/Dialect/SPIRV/IR/SPIRVCanonicalization.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Dialect/SPIRV/IR/SPIRVCanonicalization.td",
deps = [":SPIRVOpsTdFiles"],
)
gentbl_cc_library(
name = "SPIRVAvailabilityIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-avail-interface-decls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVAvailability.h.inc",
),
(
["-gen-avail-interface-defs"],
"include/mlir/Dialect/SPIRV/IR/SPIRVAvailability.cpp.inc",
),
(
["-gen-spirv-avail-impls"],
"include/mlir/Dialect/SPIRV/IR/SPIRVOpAvailabilityImpl.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
deps = [":SPIRVOpsTdFiles"],
)
gentbl_cc_library(
name = "SPIRVAttrUtilsGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-spirv-attr-utils"],
"include/mlir/Dialect/SPIRV/IR/SPIRVAttrUtils.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVBase.td",
deps = [":SPIRVOpsTdFiles"],
)
gentbl_cc_library(
name = "SPIRVSerializationGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-spirv-serialization"],
"include/mlir/Dialect/SPIRV/IR/SPIRVSerialization.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/IR/SPIRVOps.td",
deps = [":SPIRVOpsTdFiles"],
)
cc_library(
name = "SPIRVDialect",
srcs = glob([
"lib/Dialect/SPIRV/IR/*.cpp",
"lib/Dialect/SPIRV/IR/*.h",
]) + ["include/mlir/Transforms/InliningUtils.h"],
hdrs = glob([
"include/mlir/Dialect/SPIRV/IR/*.h",
]),
includes = ["include"],
deps = [
":CommonFolders",
":ControlFlowInterfaces",
":IR",
":InferTypeOpInterface",
":Parser",
":SPIRVAttrUtilsGen",
":SPIRVAttributesIncGen",
":SPIRVAvailabilityIncGen",
":SPIRVCanonicalizationIncGen",
":SPIRVOpsIncGen",
":SPIRVSerializationGen",
":SideEffectInterfaces",
":Support",
":Transforms",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "SPIRVPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=SPIRV",
],
"include/mlir/Dialect/SPIRV/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/SPIRV/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "SPIRVUtils",
srcs = glob([
"lib/Dialect/SPIRV/Utils/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/SPIRV/Utils/*.h",
]),
includes = ["include"],
deps = [
":SPIRVDialect",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVConversion",
srcs = ["lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp"],
hdrs = ["include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"],
includes = ["include"],
deps = [
2022-03-17 09:24:53 +01:00
":FuncDialect",
":SPIRVDialect",
":TransformUtils",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVTransforms",
srcs = glob(
[
"lib/Dialect/SPIRV/Transforms/*.cpp",
"lib/Dialect/SPIRV/Transforms/*.h",
],
exclude = ["lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp"],
),
hdrs = glob(
["include/mlir/Dialect/SPIRV/Transforms/*.h"],
exclude = ["include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"],
),
includes = ["include"],
deps = [
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":Pass",
":SPIRVConversion",
":SPIRVDialect",
":SPIRVPassIncGen",
":SPIRVUtils",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVCommonConversion",
hdrs = ["lib/Conversion/SPIRVCommon/Pattern.h"],
includes = ["include"],
deps = [
":IR",
":SPIRVDialect",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "MathToSPIRV",
srcs = glob([
"lib/Conversion/MathToSPIRV/*.cpp",
"lib/Conversion/MathToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/MathToSPIRV/*.h",
]),
includes = [
"include",
"lib/Conversion/MathToSPIRV",
],
deps = [
":ConversionPassIncGen",
":IR",
":MathDialect",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "FuncToSPIRV",
srcs = glob([
"lib/Conversion/FuncToSPIRV/*.cpp",
"lib/Conversion/FuncToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/FuncToSPIRV/*.h",
]),
includes = [
"include",
"lib/Conversion/FuncToSPIRV",
],
deps = [
":ControlFlowToSPIRV",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MathToSPIRV",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":SPIRVUtils",
":Support",
":TensorDialect",
":Transforms",
":VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "TensorToLinalg",
srcs = glob([
"lib/Conversion/TensorToLinalg/*.cpp",
"lib/Conversion/TensorToLinalg/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TensorToLinalg/*.h",
]),
includes = [
"include",
"lib/Conversion/TensorToLinalg",
],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LinalgDialect",
":LinalgTransforms",
":Pass",
":Support",
":TensorDialect",
":Transforms",
":VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "TensorToSPIRV",
srcs = glob([
"lib/Conversion/TensorToSPIRV/*.cpp",
"lib/Conversion/TensorToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TensorToSPIRV/*.h",
]),
includes = [
"include",
"lib/Conversion/TensorToSPIRV",
],
deps = [
":ArithToSPIRV",
":ControlFlowToSPIRV",
":ConversionPassIncGen",
":FuncDialect",
2022-03-03 00:18:54 +00:00
":FuncToSPIRV",
":IR",
":MathToSPIRV",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":SPIRVUtils",
":Support",
":TensorDialect",
":Transforms",
":VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVBinaryUtils",
srcs = ["lib/Target/SPIRV/SPIRVBinaryUtils.cpp"],
hdrs = ["include/mlir/Target/SPIRV/SPIRVBinaryUtils.h"],
includes = ["include"],
deps = [
":SPIRVAttrUtilsGen",
":SPIRVDialect",
":SPIRVOpsIncGen",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVSerialization",
srcs = [
"lib/Target/SPIRV/Serialization/Serialization.cpp",
"lib/Target/SPIRV/Serialization/SerializeOps.cpp",
"lib/Target/SPIRV/Serialization/Serializer.cpp",
"lib/Target/SPIRV/Serialization/Serializer.h",
],
hdrs = ["include/mlir/Target/SPIRV/Serialization.h"],
includes = ["include"],
deps = [
":IR",
":SPIRVAttrUtilsGen",
":SPIRVBinaryUtils",
":SPIRVDialect",
":SPIRVOpsIncGen",
":SPIRVSerializationGen",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVDeserialization",
srcs = glob([
"lib/Target/SPIRV/Deserialization/*.cpp",
"lib/Target/SPIRV/Deserialization/*.h",
]),
hdrs = ["include/mlir/Target/SPIRV/Deserialization.h"],
includes = ["include"],
deps = [
":IR",
":SPIRVAttrUtilsGen",
":SPIRVBinaryUtils",
":SPIRVDialect",
":SPIRVOpsIncGen",
":SPIRVSerializationGen",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVModuleCombiner",
srcs = glob(
["lib/Dialect/SPIRV/Linking/ModuleCombiner/*.cpp"],
),
hdrs = ["include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h"],
includes = ["include"],
deps = [
":IR",
":SPIRVDialect",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "SPIRVTranslateRegistration",
srcs = ["lib/Target/SPIRV/TranslateRegistration.cpp"],
includes = ["include"],
deps = [
":IR",
":Parser",
":SPIRVDeserialization",
":SPIRVDialect",
":SPIRVSerialization",
":Support",
":TranslateLib",
"//llvm:Support",
],
)
td_library(
name = "TensorOpsTdFiles",
srcs = [
"include/mlir/Dialect/Tensor/IR/TensorBase.td",
"include/mlir/Dialect/Tensor/IR/TensorOps.td",
],
includes = ["include"],
deps = [
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":DestinationStyleOpInterfaceTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":ParallelCombiningOpInterfaceTdFiles",
":ShapedOpInterfacesTdFiles",
":SideEffectInterfacesTdFiles",
":TilingInterfaceTdFiles",
":ViewLikeInterfaceTdFiles",
],
)
gentbl_cc_library(
name = "TensorOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=tensor",
],
"include/mlir/Dialect/Tensor/IR/TensorOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=tensor",
],
"include/mlir/Dialect/Tensor/IR/TensorOpsDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/Tensor/IR/TensorOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Tensor/IR/TensorOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tensor/IR/TensorOps.td",
deps = [":TensorOpsTdFiles"],
)
cc_library(
name = "TensorDialect",
srcs = [
"include/mlir/Transforms/InliningUtils.h",
"lib/Dialect/Tensor/IR/TensorDialect.cpp",
"lib/Dialect/Tensor/IR/TensorOps.cpp",
"lib/Dialect/Tensor/IR/ValueBoundsOpInterfaceImpl.cpp",
],
hdrs = [
"include/mlir/Dialect/Tensor/IR/Tensor.h",
"include/mlir/Dialect/Tensor/IR/ValueBoundsOpInterfaceImpl.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":ArithUtils",
":CastInterfaces",
":ComplexDialect",
":ControlFlowInterfaces",
":DestinationStyleOpInterface",
":DialectUtils",
":IR",
":InferTypeOpInterface",
":ParallelCombiningOpInterface",
":ShapedOpInterfaces",
":SideEffectInterfaces",
":Support",
":TensorOpsIncGen",
":TilingInterface",
":ValueBoundsOpInterface",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "TensorInferTypeOpInterfaceImpl",
srcs = ["lib/Dialect/Tensor/IR/TensorInferTypeOpInterfaceImpl.cpp"],
hdrs = ["include/mlir/Dialect/Tensor/IR/TensorInferTypeOpInterfaceImpl.h"],
includes = ["include"],
deps = [
":AffineDialect",
":ArithUtils",
":DialectUtils",
":IR",
":InferTypeOpInterface",
":TensorDialect",
"//llvm:Support",
],
)
cc_library(
name = "TensorTilingInterfaceImpl",
srcs = ["lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp"],
hdrs = ["include/mlir/Dialect/Tensor/IR/TensorTilingInterfaceImpl.h"],
includes = ["include"],
deps = [
":AffineDialect",
":AffineUtils",
":ArithUtils",
":DialectUtils",
":IR",
":LinalgDialect",
":LinalgUtils",
":SCFDialect",
":TensorDialect",
":TensorUtils",
":TilingInterface",
2023-04-13 14:58:11 +02:00
":ValueBoundsOpInterface",
"//llvm:Support",
],
)
cc_library(
name = "TensorUtils",
srcs = ["lib/Dialect/Tensor/Utils/Utils.cpp"],
hdrs = ["include/mlir/Dialect/Tensor/Utils/Utils.h"],
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":ArithUtils",
":DialectUtils",
":TensorDialect",
":ValueBoundsOpInterface",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "TensorPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Tensor",
],
"include/mlir/Dialect/Tensor/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tensor/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "TensorTransforms",
srcs = glob(
[
"lib/Dialect/Tensor/Transforms/*.cpp",
"lib/Dialect/Tensor/Transforms/*.h",
],
),
hdrs = [
"include/mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h",
"include/mlir/Dialect/Tensor/Transforms/Passes.h",
2022-09-19 21:20:12 +02:00
"include/mlir/Dialect/Tensor/Transforms/TransformUtils.h",
"include/mlir/Dialect/Tensor/Transforms/Transforms.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":AffineTransforms",
":AffineUtils",
":ArithDialect",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":DialectUtils",
":FuncDialect",
":IR",
":LinalgDialect",
":MemRefDialect",
":Pass",
":SCFDialect",
":TensorDialect",
":TensorPassIncGen",
":TensorUtils",
":TilingInterface",
":Transforms",
":ValueBoundsOpInterface",
":VectorDialect",
"//llvm:Support",
],
)
td_library(
name = "TensorTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.td",
],
includes = ["include"],
deps = [
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "TensorTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tensor/TransformOps/TensorTransformOps.td",
deps = [
":TensorTransformOpsTdFiles",
],
)
cc_library(
name = "TensorTransformOps",
srcs = glob(["lib/Dialect/Tensor/TransformOps/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Tensor/TransformOps/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":IR",
":SCFDialect",
":TensorDialect",
":TensorTransformOpsIncGen",
":TensorTransforms",
":TensorUtils",
":TransformDialect",
":ValueBoundsOpInterface",
"//llvm:Support",
],
)
cc_library(
name = "Rewrite",
srcs = glob([
"lib/Rewrite/*.cpp",
"lib/Rewrite/*.h",
]),
hdrs = glob(["include/mlir/Rewrite/*.h"]),
includes = ["include"],
deps = [
":Analysis",
":IR",
":PDLDialect",
":PDLInterpDialect",
":PDLToPDLInterp",
":Pass",
":SideEffectInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "TransformUtils",
srcs = glob([
"lib/Transforms/Utils/*.cpp",
"lib/Transforms/Utils/*.h",
]),
hdrs = glob(
[
"include/mlir/Transforms/*.h",
],
exclude = ["include/mlir/Transforms/Passes.h"],
),
includes = ["include"],
deps = [
":ControlFlowInterfaces",
":IR",
":LoopLikeInterface",
":MemorySlotInterfaces",
":Rewrite",
":SideEffectInterfaces",
":Support",
":TransformsPassIncGen",
":config",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "DerivedAttributeOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/DerivedAttributeOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/DerivedAttributeOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/DerivedAttributeOpInterface.td",
deps = [":DerivedAttributeOpInterfaceTdFiles"],
)
cc_library(
name = "DerivedAttributeOpInterface",
srcs = ["lib/Interfaces/DerivedAttributeOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/DerivedAttributeOpInterface.h"],
includes = ["include"],
deps = [
":DerivedAttributeOpInterfaceIncGen",
":IR",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "DestinationStyleOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/DestinationStyleOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/DestinationStyleOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/DestinationStyleOpInterface.td",
deps = [":DestinationStyleOpInterfaceTdFiles"],
)
cc_library(
name = "DestinationStyleOpInterface",
srcs = ["lib/Interfaces/DestinationStyleOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/DestinationStyleOpInterface.h"],
includes = ["include"],
deps = [
":DestinationStyleOpInterfaceIncGen",
":IR",
"//llvm:Support",
],
)
2022-06-03 20:43:02 +02:00
gentbl_cc_library(
name = "InferIntRangeInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/InferIntRangeInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/InferIntRangeInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/InferIntRangeInterface.td",
deps = [":InferIntRangeInterfaceTdFiles"],
)
cc_library(
name = "InferIntRangeInterface",
srcs = ["lib/Interfaces/InferIntRangeInterface.cpp"],
hdrs = ["include/mlir/Interfaces/InferIntRangeInterface.h"],
includes = ["include"],
deps = [
":IR",
":InferIntRangeInterfaceIncGen",
"//llvm:Support",
],
)
td_library(
name = "DataLayoutInterfacesTdFiles",
srcs = ["include/mlir/Interfaces/DataLayoutInterfaces.td"],
includes = ["include"],
)
gentbl_cc_library(
name = "DataLayoutInterfacesIncGen",
tbl_outs = [
(
["-gen-attr-interface-decls"],
"include/mlir/Interfaces/DataLayoutAttrInterface.h.inc",
),
(
["-gen-attr-interface-defs"],
"include/mlir/Interfaces/DataLayoutAttrInterface.cpp.inc",
),
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/DataLayoutOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/DataLayoutOpInterface.cpp.inc",
),
(
["-gen-type-interface-decls"],
"include/mlir/Interfaces/DataLayoutTypeInterface.h.inc",
),
(
["-gen-type-interface-defs"],
"include/mlir/Interfaces/DataLayoutTypeInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/DataLayoutInterfaces.td",
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "LoopLikeInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/LoopLikeInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/LoopLikeInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/LoopLikeInterface.td",
deps = [":LoopLikeInterfaceTdFiles"],
)
gentbl_cc_library(
name = "MemorySlotInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/MemorySlotOpInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/MemorySlotOpInterfaces.cpp.inc",
),
(
["-gen-type-interface-decls"],
"include/mlir/Interfaces/MemorySlotTypeInterfaces.h.inc",
),
(
["-gen-type-interface-defs"],
"include/mlir/Interfaces/MemorySlotTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/MemorySlotInterfaces.td",
deps = [":MemorySlotInterfacesTdFiles"],
)
gentbl_cc_library(
name = "ShapedOpInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/ShapedOpInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/ShapedOpInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/ShapedOpInterfaces.td",
deps = [":ShapedOpInterfacesTdFiles"],
)
gentbl_cc_library(
name = "ParallelCombiningOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/ParallelCombiningOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/ParallelCombiningOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/ParallelCombiningOpInterface.td",
deps = [":ParallelCombiningOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "RuntimeVerifiableOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/RuntimeVerifiableOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/RuntimeVerifiableOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/RuntimeVerifiableOpInterface.td",
deps = [":RuntimeVerifiableOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "VectorInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/VectorInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/VectorInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/VectorInterfaces.td",
deps = [":VectorInterfacesTdFiles"],
)
gentbl_cc_library(
name = "ViewLikeInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/ViewLikeInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/ViewLikeInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/ViewLikeInterface.td",
deps = [":ViewLikeInterfaceTdFiles"],
)
gentbl_cc_library(
name = "CopyOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/CopyOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/CopyOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/CopyOpInterface.td",
deps = [":CopyOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "TransformsPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Transforms",
],
"include/mlir/Transforms/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=Transforms",
],
"include/mlir/Transforms/Transforms.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=Transforms",
],
"include/mlir/Transforms/Transforms.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Transforms/Passes.td",
deps = [
":PassBaseTdFiles",
":RewritePassBaseTdFiles",
],
)
cc_library(
name = "Transforms",
srcs = glob([
"lib/Transforms/*.cpp",
"lib/Transforms/*.h",
]),
hdrs = glob(["include/mlir/Transforms/*.h"]),
includes = ["include"],
deps = [
":Analysis",
":ControlFlowInterfaces",
":IR",
":LoopLikeInterface",
":MemorySlotInterfaces",
":Pass",
":Rewrite",
":RuntimeVerifiableOpInterface",
":SideEffectInterfaces",
":Support",
":TransformUtils",
":TransformsPassIncGen",
"//llvm:Support",
],
)
cc_library(
name = "CommonFolders",
srcs = [
],
hdrs = ["include/mlir/Dialect/CommonFolders.h"],
includes = ["include"],
deps = [
":IR",
"//llvm:Support",
],
)
cc_library(
name = "SCFToGPU",
srcs = glob(["lib/Conversion/SCFToGPU/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/SCFToGPU/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":AffineToStandard",
":ArithDialect",
":ComplexDialect",
":ConversionPassIncGen",
":FuncDialect",
":GPUDialect",
":GPUTransforms",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":SideEffectInterfaces",
":Support",
":TransformUtils",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "SCFToSPIRV",
srcs = glob([
"lib/Conversion/SCFToSPIRV/*.cpp",
"lib/Conversion/SCFToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/SCFToSPIRV/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithToSPIRV",
":ConversionPassIncGen",
":FuncDialect",
":FuncToSPIRV",
":IR",
":MemRefToSPIRV",
":Pass",
":SCFDialect",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":TransformUtils",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "SCFToOpenMP",
srcs = [
"lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp",
],
hdrs = ["include/mlir/Conversion/SCFToOpenMP/SCFToOpenMP.h"],
includes = ["include"],
deps = [
":AffineAnalysis",
":Analysis",
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LLVMDialect",
2022-03-01 10:43:27 -08:00
":MemRefDialect",
":OpenMPDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
],
)
cc_library(
name = "SCFToControlFlow",
srcs = [
"lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp",
],
hdrs = ["include/mlir/Conversion/SCFToControlFlow/SCFToControlFlow.h"],
includes = ["include"],
deps = [
":ArithDialect",
":ControlFlowDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LLVMDialect",
":Pass",
":SCFDialect",
":Support",
":TransformUtils",
":Transforms",
],
)
cc_library(
name = "LLVMCommonConversion",
srcs = glob([
"lib/Conversion/LLVMCommon/*.cpp",
]) + ["lib/Conversion/LLVMCommon/MemRefDescriptor.h"],
hdrs = glob(["include/mlir/Conversion/LLVMCommon/*.h"]),
includes = ["include"],
deps = [
":IR",
":LLVMDialect",
":Support",
":Transforms",
"//llvm:Core",
],
)
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion Conversion to the LLVM dialect is being refactored to be more progressive and is now performed as a series of independent passes converting different dialects. These passes may produce `unrealized_conversion_cast` operations that represent pending conversions between built-in and LLVM dialect types. Historically, a more monolithic Standard-to-LLVM conversion pass did not need these casts as all operations were converted in one shot. Previous refactorings have led to the requirement of running the Standard-to-LLVM conversion pass to clean up `unrealized_conversion_cast`s even though the IR had no standard operations in it. The pass must have been also run the last among all to-LLVM passes, in contradiction with the partial conversion logic. Additionally, the way it was set up could produce invalid operations by removing casts between LLVM and built-in types even when the consumer did not accept the uncasted type, or could lead to cryptic conversion errors (recursive application of the rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure to eliminate casts). In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not specific to to-LLVM conversions and can be factored out into a separate type reconciliation pass, which is achieved in this commit. While the cast operation itself has a folder pattern, it is insufficient in most conversion passes as the folder only applies to the second cast. Without complex legality setup in the conversion target, the conversion infra will either consider the cast operations valid and not fold them (a separate canonicalization would be necessary to trigger the folding), or consider the first cast invalid upon generation and stop with error. The pattern provided by the reconciliation pass applies to the first cast operation instead. Furthermore, having a separate pass makes it clear when `unrealized_conversion_cast`s could not have been eliminated since it is the only reason why this pass can fail. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D109507
2021-09-09 16:06:10 +02:00
cc_library(
name = "ReconcileUnrealizedCasts",
srcs = glob(["lib/Conversion/ReconcileUnrealizedCasts/*.cpp"]),
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion Conversion to the LLVM dialect is being refactored to be more progressive and is now performed as a series of independent passes converting different dialects. These passes may produce `unrealized_conversion_cast` operations that represent pending conversions between built-in and LLVM dialect types. Historically, a more monolithic Standard-to-LLVM conversion pass did not need these casts as all operations were converted in one shot. Previous refactorings have led to the requirement of running the Standard-to-LLVM conversion pass to clean up `unrealized_conversion_cast`s even though the IR had no standard operations in it. The pass must have been also run the last among all to-LLVM passes, in contradiction with the partial conversion logic. Additionally, the way it was set up could produce invalid operations by removing casts between LLVM and built-in types even when the consumer did not accept the uncasted type, or could lead to cryptic conversion errors (recursive application of the rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure to eliminate casts). In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not specific to to-LLVM conversions and can be factored out into a separate type reconciliation pass, which is achieved in this commit. While the cast operation itself has a folder pattern, it is insufficient in most conversion passes as the folder only applies to the second cast. Without complex legality setup in the conversion target, the conversion infra will either consider the cast operations valid and not fold them (a separate canonicalization would be necessary to trigger the folding), or consider the first cast invalid upon generation and stop with error. The pattern provided by the reconciliation pass applies to the first cast operation instead. Furthermore, having a separate pass makes it clear when `unrealized_conversion_cast`s could not have been eliminated since it is the only reason why this pass can fail. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D109507
2021-09-09 16:06:10 +02:00
hdrs = glob(["include/mlir/Conversion/ReconcileUnrealizedCasts/*.h"]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":IR",
":Pass",
":TransformUtils",
],
)
cc_library(
name = "FuncToLLVM",
srcs = [
"lib/Conversion/FuncToLLVM/FuncToLLVM.cpp",
],
hdrs = [
"include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVM.h",
"include/mlir/Conversion/FuncToLLVM/ConvertFuncToLLVMPass.h",
],
includes = ["include"],
deps = [
":Analysis",
":ArithToLLVM",
":ControlFlowToLLVM",
":ConversionPassIncGen",
":DataLayoutInterfaces",
":DialectUtils",
":FuncDialect",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MathDialect",
":MemRefDialect",
":Parser",
":Pass",
":Support",
":TransformUtils",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ControlFlowToLLVM",
srcs = [
"lib/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.cpp",
],
hdrs = [
"include/mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h",
],
includes = ["include"],
deps = [
":Analysis",
":ArithToLLVM",
":ControlFlowDialect",
":ConversionPassIncGen",
":DataLayoutInterfaces",
":DialectUtils",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MathDialect",
":MemRefDialect",
":Parser",
":Pass",
":Support",
":TransformUtils",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ControlFlowToSPIRV",
srcs = glob(["lib/Conversion/ControlFlowToSPIRV/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/ControlFlowToSPIRV/*.h"]),
includes = ["include"],
deps = [
":ControlFlowDialect",
":ConversionPassIncGen",
":IR",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":SPIRVUtils",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "MemRefToLLVM",
srcs = glob(["lib/Conversion/MemRefToLLVM/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/MemRefToLLVM/*.h"]),
includes = ["include"],
deps = [
":Analysis",
":ArithDialect",
":ConversionPassIncGen",
":DataLayoutInterfaces",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefDialect",
":MemRefUtils",
":Pass",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "MemRefToSPIRV",
srcs = glob([
"lib/Conversion/MemRefToSPIRV/*.cpp",
"lib/Conversion/MemRefToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/MemRefToSPIRV/*.h",
]),
includes = [
"include",
"lib/Conversion/MemRefToSPIRV",
],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
"//llvm:Support",
],
)
2022-11-04 19:06:44 +01:00
cc_library(
name = "ArithAttrToLLVMConversion",
srcs = glob(["lib/Conversion/ArithCommon/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/ArithCommon/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":LLVMDialect",
],
)
cc_library(
name = "ArithToLLVM",
srcs = glob(["lib/Conversion/ArithToLLVM/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/ArithToLLVM/*.h"]),
includes = ["include"],
deps = [
":Analysis",
2022-11-04 19:06:44 +01:00
":ArithAttrToLLVMConversion",
":ArithDialect",
":ConversionPassIncGen",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":Support",
":Transforms",
],
)
cc_library(
name = "ArithToSPIRV",
srcs = glob(["lib/Conversion/ArithToSPIRV/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/ArithToSPIRV/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":FuncToSPIRV",
":IR",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "MathToLLVM",
srcs = glob(["lib/Conversion/MathToLLVM/*.cpp"]),
hdrs = glob(["include/mlir/Conversion/MathToLLVM/*.h"]),
includes = ["include"],
deps = [
":Analysis",
2022-11-04 19:06:44 +01:00
":ArithAttrToLLVMConversion",
":ConversionPassIncGen",
":DataLayoutInterfaces",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MathDialect",
":Pass",
":Support",
":Transforms",
],
)
2022-08-26 09:04:50 +02:00
cc_library(
name = "MathToFuncs",
srcs = glob(["lib/Conversion/MathToFuncs/*.cpp"]),
2022-08-26 09:04:50 +02:00
hdrs = glob(["include/mlir/Conversion/MathToFuncs/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
2022-08-26 09:04:50 +02:00
":ControlFlowDialect",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":IR",
":LLVMDialect",
":MathDialect",
":Pass",
2023-04-13 14:58:11 +02:00
":SCFDialect",
2022-08-26 09:04:50 +02:00
":Transforms",
":VectorDialect",
":VectorUtils",
"//llvm:Support",
2022-08-26 09:04:50 +02:00
],
)
gentbl_cc_library(
name = "BytecodeOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Bytecode/BytecodeOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Bytecode/BytecodeOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Bytecode/BytecodeOpInterface.td",
deps = [":BytecodeOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "CallOpInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/CallInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/CallInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/CallInterfaces.td",
deps = [":CallInterfacesTdFiles"],
)
cc_library(
name = "CallOpInterfaces",
srcs = ["lib/Interfaces/CallInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/CallInterfaces.h"],
includes = ["include"],
deps = [
":CallOpInterfacesIncGen",
":IR",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "CastInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/CastInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/CastInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/CastInterfaces.td",
deps = [":CastInterfacesTdFiles"],
)
cc_library(
name = "CastInterfaces",
srcs = ["lib/Interfaces/CastInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/CastInterfaces.h"],
includes = ["include"],
deps = [
":CastInterfacesIncGen",
":IR",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ControlFlowInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/ControlFlowInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/ControlFlowInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/ControlFlowInterfaces.td",
deps = [":ControlFlowInterfacesTdFiles"],
)
cc_library(
name = "ControlFlowInterfaces",
srcs = ["lib/Interfaces/ControlFlowInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/ControlFlowInterfaces.h"],
includes = ["include"],
deps = [
":ControlFlowInterfacesIncGen",
":IR",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "InferTypeOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/InferTypeOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/InferTypeOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/InferTypeOpInterface.td",
deps = [":InferTypeOpInterfaceTdFiles"],
)
cc_library(
name = "InferTypeOpInterface",
srcs = ["lib/Interfaces/InferTypeOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/InferTypeOpInterface.h"],
includes = ["include"],
deps = [
":IR",
":InferTypeOpInterfaceIncGen",
":Support",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "SideEffectInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/SideEffectInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/SideEffectInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/SideEffectInterfaces.td",
deps = [":SideEffectInterfacesTdFiles"],
)
cc_library(
name = "SideEffectInterfaces",
srcs = ["lib/Interfaces/SideEffectInterfaces.cpp"],
hdrs = ["include/mlir/Interfaces/SideEffectInterfaces.h"],
includes = ["include"],
deps = [
":IR",
":SideEffectInterfacesIncGen",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "TilingInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/TilingInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/TilingInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/TilingInterface.td",
deps = [":TilingInterfaceTdFiles"],
)
cc_library(
name = "Analysis",
srcs = glob(
[
"lib/Analysis/*.cpp",
"lib/Analysis/*.h",
"lib/Analysis/*/*.cpp",
"lib/Analysis/*/*.h",
],
),
hdrs = glob(
[
"include/mlir/Analysis/*.h",
"include/mlir/Analysis/*/*.h",
],
),
includes = ["include"],
deps = [
":ArithDialect",
":CallOpInterfaces",
":ControlFlowInterfaces",
":DataLayoutInterfaces",
":IR",
2022-06-03 20:43:02 +02:00
":InferIntRangeInterface",
":LoopLikeInterface",
":Pass",
":SideEffectInterfaces",
":Support",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "TranslateLib",
srcs = glob([
"lib/Tools/mlir-translate/*.cpp",
]) + [
"include/mlir/Tools/ParseUtilities.h",
],
hdrs = glob(["include/mlir/Tools/mlir-translate/*.h"]),
includes = ["include"],
deps = [
":IR",
":Parser",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "ToLLVMIRTranslation",
srcs = [
"lib/Target/LLVMIR/DebugTranslation.cpp",
"lib/Target/LLVMIR/DebugTranslation.h",
"lib/Target/LLVMIR/LoopAnnotationTranslation.cpp",
2023-02-08 13:05:19 +01:00
"lib/Target/LLVMIR/LoopAnnotationTranslation.h",
"lib/Target/LLVMIR/ModuleTranslation.cpp",
"lib/Target/LLVMIR/TypeToLLVM.cpp",
],
hdrs = [
"include/mlir/Target/LLVMIR/Export.h",
"include/mlir/Target/LLVMIR/LLVMTranslationInterface.h",
"include/mlir/Target/LLVMIR/ModuleTranslation.h",
"include/mlir/Target/LLVMIR/TypeToLLVM.h",
"lib/Target/LLVMIR/AttrKindDetail.h",
],
includes = ["include"],
deps = [
":DLTIDialect",
":IR",
":LLVMConversionIncGen",
":LLVMDialect",
":LLVMIRTransforms",
":LLVMIntrinsicConversionIncGen",
":OpenMPDialect",
":Support",
"//llvm:Core",
"//llvm:FrontendOpenMP",
"//llvm:Support",
"//llvm:TransformUtils",
],
)
cc_library(
name = "AMXToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/AMX/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/AMX/*.h"]),
includes = ["include"],
deps = [
":AMXConversionIncGen",
":AMXDialect",
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "X86VectorToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/X86Vector/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/X86Vector/*.h"]),
includes = ["include"],
deps = [
":IR",
":ToLLVMIRTranslation",
":X86VectorConversionIncGen",
":X86VectorDialect",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ArmNeonToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/ArmNeon/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ArmNeon/*.h"]),
includes = ["include"],
deps = [
":ArmNeonConversionIncGen",
":ArmNeonDialect",
":ArmNeonIncGen",
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ArmSMEToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/ArmSME/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ArmSME/*.h"]),
includes = ["include"],
deps = [
":ArmSMEConversionIncGen",
":ArmSMEDialect",
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ArmSVEToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/ArmSVE/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ArmSVE/*.h"]),
includes = ["include"],
deps = [
":ArmSVEConversionIncGen",
":ArmSVEDialect",
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "NVVMToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/NVVM/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/NVVM/*.h"]),
includes = ["include"],
deps = [
":DialectUtils",
":IR",
":NVVMConversionIncGen",
":NVVMDialect",
":Support",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ROCDLToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/ROCDL/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/ROCDL/*.h"]),
includes = ["include"],
deps = [
":IR",
":ROCDLConversionIncGen",
":ROCDLDialect",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "GPUToLLVMIRTranslation",
2023-03-28 13:11:47 -07:00
srcs = ["lib/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.cpp"],
hdrs = ["include/mlir/Target/LLVMIR/Dialect/GPU/GPUToLLVMIRTranslation.h"],
includes = ["include"],
deps = [
":GPUDialect",
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "BuiltinToLLVMIRTranslation",
2023-03-28 13:11:47 -07:00
srcs = ["lib/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.cpp"],
hdrs = ["include/mlir/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.h"],
includes = ["include"],
deps = [
":IR",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "LLVMToLLVMIRTranslation",
2023-01-02 13:05:26 +01:00
srcs = ["lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp"],
hdrs = ["include/mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"],
includes = ["include"],
deps = [
":IR",
":LLVMConversionIncGen",
":LLVMDialect",
":LLVMIntrinsicConversionIncGen",
":Support",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "OpenMPCommon",
srcs = ["lib/Target/LLVMIR/Dialect/OpenMPCommon.cpp"],
hdrs = ["include/mlir/Target/LLVMIR/Dialect/OpenMPCommon.h"],
includes = ["include"],
deps = [
":IR",
":Support",
"//llvm:Core",
"//llvm:FrontendOpenMP",
],
)
2023-01-02 13:05:26 +01:00
cc_library(
name = "LLVMIRToLLVMTranslation",
srcs = ["lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp"],
hdrs = ["include/mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.h"],
includes = ["include"],
deps = [
":FromLLVMIRTranslation",
":LLVMConversionIncGen",
":LLVMDialect",
":LLVMIntrinsicConversionIncGen",
":Support",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "OpenACCToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/OpenACC/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/OpenACC/*.h"]),
includes = ["include"],
deps = [
":IR",
":LLVMDialect",
":OpenACCDialect",
":OpenACCToLLVM",
":OpenMPCommon",
":Support",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:FrontendOpenMP",
"//llvm:Support",
],
)
cc_library(
name = "OpenMPToLLVMIRTranslation",
srcs = glob(["lib/Target/LLVMIR/Dialect/OpenMP/*.cpp"]),
hdrs = glob(["include/mlir/Target/LLVMIR/Dialect/OpenMP/*.h"]),
includes = ["include"],
deps = [
":IR",
2023-07-17 10:47:51 +02:00
":LLVMDialect",
":OpenMPCommon",
":OpenMPDialect",
":Support",
":ToLLVMIRTranslation",
2023-04-26 13:47:00 -04:00
":Transforms",
"//llvm:Core",
"//llvm:FrontendOpenMP",
"//llvm:Support",
],
)
cc_library(
name = "AllToLLVMIRTranslations",
hdrs = ["include/mlir/Target/LLVMIR/Dialect/All.h"],
includes = ["include"],
deps = [
":AMXToLLVMIRTranslation",
":ArmNeonToLLVMIRTranslation",
":ArmSMEToLLVMIRTranslation",
":ArmSVEToLLVMIRTranslation",
":BuiltinToLLVMIRTranslation",
":GPUToLLVMIRTranslation",
2023-01-02 13:05:26 +01:00
":LLVMIRToLLVMTranslation",
":LLVMToLLVMIRTranslation",
":NVVMToLLVMIRTranslation",
":OpenACCToLLVMIRTranslation",
":OpenMPToLLVMIRTranslation",
":ROCDLToLLVMIRTranslation",
":X86VectorToLLVMIRTranslation",
],
)
cc_library(
name = "ToLLVMIRTranslationRegistration",
srcs = ["lib/Target/LLVMIR/ConvertToLLVMIR.cpp"],
includes = ["include"],
deps = [
":AllToLLVMIRTranslations",
":DLTIDialect",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
":ToLLVMIRTranslation",
":TranslateLib",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "FromLLVMIRTranslation",
srcs = [
2023-03-31 14:20:01 +02:00
"lib/Target/LLVMIR/DataLayoutImporter.cpp",
"lib/Target/LLVMIR/DataLayoutImporter.h",
"lib/Target/LLVMIR/DebugImporter.cpp",
"lib/Target/LLVMIR/LoopAnnotationImporter.cpp",
"lib/Target/LLVMIR/LoopAnnotationImporter.h",
"lib/Target/LLVMIR/ModuleImport.cpp",
"lib/Target/LLVMIR/TypeFromLLVM.cpp",
],
hdrs = [
"include/mlir/Target/LLVMIR/Import.h",
2023-01-02 13:05:26 +01:00
"include/mlir/Target/LLVMIR/LLVMImportInterface.h",
"include/mlir/Target/LLVMIR/ModuleImport.h",
"include/mlir/Target/LLVMIR/TypeFromLLVM.h",
"lib/Target/LLVMIR/AttrKindDetail.h",
"lib/Target/LLVMIR/DebugImporter.h",
],
includes = ["include"],
deps = [
":DLTIDialect",
":IR",
":LLVMConversionIncGen",
":LLVMDialect",
2022-05-31 13:35:49 +02:00
":LLVMIntrinsicConversionIncGen",
":Support",
":TranslateLib",
"//llvm:Core",
"//llvm:IRPrinter",
"//llvm:IRReader",
"//llvm:Support",
],
)
2023-01-02 13:05:26 +01:00
cc_library(
name = "FromLLVMIRTranslationRegistration",
srcs = [
"lib/Target/LLVMIR/ConvertFromLLVMIR.cpp",
],
deps = [
":AllToLLVMIRTranslations",
":DLTIDialect",
":FromLLVMIRTranslation",
":IR",
":TranslateLib",
"//llvm:Core",
"//llvm:IRReader",
"//llvm:Support",
],
)
cc_library(
name = "ExecutionEngine",
srcs = [
"include/mlir/ExecutionEngine/CRunnerUtils.h",
"lib/ExecutionEngine/ExecutionEngine.cpp",
],
hdrs = [
"include/mlir/ExecutionEngine/ExecutionEngine.h",
"include/mlir/ExecutionEngine/MemRefUtils.h",
],
includes = ["include"],
deps = [
":AllToLLVMIRTranslations",
":IR",
":LLVMDialect",
":Support",
":ToLLVMIRTranslation",
"//llvm:AllTargetsAsmParsers",
"//llvm:BitWriter",
"//llvm:Core",
"//llvm:ExecutionEngine",
"//llvm:MC",
"//llvm:OrcJIT",
"//llvm:Support",
"//llvm:Target", # fixdeps: keep
"//llvm:TargetParser",
"//llvm:TransformUtils",
"//llvm:X86CodeGen", # fixdeps: keep
"//llvm:X86Disassembler", # fixdeps: keep
],
)
cc_library(
name = "ExecutionEngineUtils",
srcs = ["lib/ExecutionEngine/OptUtils.cpp"],
hdrs = ["include/mlir/ExecutionEngine/OptUtils.h"],
includes = ["include"],
deps = [
"//llvm:Analysis",
"//llvm:Core",
"//llvm:Coroutines",
"//llvm:IPO",
"//llvm:Passes",
"//llvm:Support",
"//llvm:Target",
"//llvm:common_transforms",
],
)
2023-04-13 14:58:11 +02:00
cc_library(
name = "PluginsLib",
srcs = [
"lib/Tools/Plugins/DialectPlugin.cpp",
"lib/Tools/Plugins/PassPlugin.cpp",
],
hdrs = [
"include/mlir/Tools/Plugins/DialectPlugin.h",
"include/mlir/Tools/Plugins/PassPlugin.h",
],
includes = ["include"],
deps = [
":IR",
":Pass",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "MlirOptLib",
srcs = [
"include/mlir/Tools/ParseUtilities.h",
"lib/Tools/mlir-opt/MlirOptMain.cpp",
],
hdrs = ["include/mlir/Tools/mlir-opt/MlirOptMain.h"],
includes = ["include"],
deps = [
":BytecodeReader",
":BytecodeWriter",
2023-03-06 17:24:26 +01:00
":Debug",
":IR",
":IRDLDialect",
":Parser",
":Pass",
2023-04-13 14:58:11 +02:00
":PluginsLib",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "AllTranslations",
hdrs = ["include/mlir/InitAllTranslations.h"],
deps = [
2023-01-02 13:05:26 +01:00
":FromLLVMIRTranslationRegistration",
":SPIRVTranslateRegistration",
":TargetCpp",
":ToLLVMIRTranslationRegistration",
],
)
cc_library(
name = "MlirTranslateMain",
srcs = ["tools/mlir-translate/mlir-translate.cpp"],
deps = [
":AllPassesAndDialects",
":AllTranslations",
":Support",
":TranslateLib",
"//llvm:Support",
],
)
cc_binary(
name = "mlir-translate",
deps = [":MlirTranslateMain"],
)
cc_library(
name = "AllPassesAndDialects",
hdrs = [
"include/mlir/InitAllDialects.h",
"include/mlir/InitAllPasses.h",
],
deps = [
":AMDGPUDialect",
":AMDGPUToROCDL",
":AMDGPUTransforms",
":AMXDialect",
":AMXTransforms",
":AffineDialect",
":AffinePassIncGen",
":AffineToStandard",
2022-11-21 10:20:19 +01:00
":AffineTransformOps",
":AffineTransforms",
":ArithDialect",
":ArithToLLVM",
":ArithToSPIRV",
":ArithTransforms",
":ArithValueBoundsOpInterfaceImpl",
":ArmNeonDialect",
":ArmSMEDialect",
":ArmSMETransforms",
":ArmSVEDialect",
":ArmSVETransforms",
":AsyncDialect",
":AsyncPassIncGen",
":AsyncToLLVM",
":AsyncTransforms",
":BufferizationDialect",
":BufferizationTransformOps",
":BufferizationTransforms",
":CastInterfaces",
":ComplexDialect",
":ComplexToLLVM",
":ComplexToLibm",
":ComplexToSPIRV",
":ControlFlowDialect",
":ConversionPasses",
":DLTIDialect",
":EmitCDialect",
":FuncDialect",
":FuncToLLVM",
":FuncToSPIRV",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":FuncTransformsPassIncGen",
":GPUDialect",
":GPUPassIncGen",
":GPUToGPURuntimeTransforms",
":GPUToNVVMTransforms",
":GPUToROCDLTransforms",
":GPUToSPIRV",
":GPUToVulkanTransforms",
":GPUTransformOps",
":GPUTransforms",
":IR",
":IRDLDialect",
":IndexDialect",
":LLVMDialect",
":LLVMIRTransforms",
":LLVMPassIncGen",
":LinalgDialect",
":LinalgPassIncGen",
":LinalgToStandard",
":LinalgTransformOps",
":LinalgTransforms",
":MLProgramDialect",
":MathDialect",
2022-08-26 09:04:50 +02:00
":MathToFuncs",
":MathToLLVM",
":MathToLibm",
":MathToSPIRV",
":MathTransforms",
":MemRefDialect",
":MemRefToLLVM",
":MemRefToSPIRV",
":MemRefTransformOps",
":MemRefTransforms",
":NVGPUDialect",
":NVGPUPassIncGen",
":NVGPUToNVVM",
":NVGPUTransformOps",
":NVGPUTransforms",
":NVVMDialect",
":OpenACCDialect",
":OpenMPDialect",
":OpenMPToLLVM",
":PDLDialect",
":PDLInterpDialect",
":PDLToPDLInterp",
":QuantOps",
":ROCDLDialect",
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion Conversion to the LLVM dialect is being refactored to be more progressive and is now performed as a series of independent passes converting different dialects. These passes may produce `unrealized_conversion_cast` operations that represent pending conversions between built-in and LLVM dialect types. Historically, a more monolithic Standard-to-LLVM conversion pass did not need these casts as all operations were converted in one shot. Previous refactorings have led to the requirement of running the Standard-to-LLVM conversion pass to clean up `unrealized_conversion_cast`s even though the IR had no standard operations in it. The pass must have been also run the last among all to-LLVM passes, in contradiction with the partial conversion logic. Additionally, the way it was set up could produce invalid operations by removing casts between LLVM and built-in types even when the consumer did not accept the uncasted type, or could lead to cryptic conversion errors (recursive application of the rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure to eliminate casts). In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not specific to to-LLVM conversions and can be factored out into a separate type reconciliation pass, which is achieved in this commit. While the cast operation itself has a folder pattern, it is insufficient in most conversion passes as the folder only applies to the second cast. Without complex legality setup in the conversion target, the conversion infra will either consider the cast operations valid and not fold them (a separate canonicalization would be necessary to trigger the folding), or consider the first cast invalid upon generation and stop with error. The pattern provided by the reconciliation pass applies to the first cast operation instead. Furthermore, having a separate pass makes it clear when `unrealized_conversion_cast`s could not have been eliminated since it is the only reason why this pass can fail. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D109507
2021-09-09 16:06:10 +02:00
":ReconcileUnrealizedCasts",
":SCFDialect",
":SCFPassIncGen",
":SCFToControlFlow",
":SCFToGPU",
":SCFTransformOps",
":SCFTransforms",
":SDBM",
":SPIRVDialect",
":SPIRVPassIncGen",
":SPIRVToLLVM",
":SPIRVTransforms",
":ShapeDialect",
":ShapeToStandard",
":ShapeTransforms",
":ShapeTransformsPassIncGen",
":SparseTensorDialect",
":SparseTensorPipelines",
":SparseTensorTransforms",
":TensorDialect",
":TensorInferTypeOpInterfaceImpl",
":TensorTilingInterfaceImpl",
":TensorTransformOps",
":TensorTransforms",
":TosaDialect",
":TosaToLinalg",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
":TransformDialect",
":TransformDialectTransforms",
":TransformPDLExtension",
":Transforms",
":TransformsPassIncGen",
2023-07-20 17:05:28 +02:00
":UBDialect",
":VectorDialect",
":VectorToLLVM",
":VectorToSCF",
":VectorToSPIRV",
":VectorTransformOps",
":VectorTransforms",
":X86VectorDialect",
":X86VectorTransforms",
],
)
cc_binary(
name = "mlir-lsp-server",
srcs = ["tools/mlir-lsp-server/mlir-lsp-server.cpp"],
includes = ["include"],
deps = [
":AllPassesAndDialects",
":BytecodeWriter",
":IR",
":MlirLspServerLib",
":Parser",
],
)
cc_binary(
name = "mlir-opt",
srcs = ["tools/mlir-opt/mlir-opt.cpp"],
local_defines = ["MLIR_INCLUDE_TESTS"],
deps = [
":AllExtensions",
":AllPassesAndDialects",
":Analysis",
":IR",
":MlirOptLib",
":OpenMPDialect",
":Pass",
":QuantOps",
":SCFToGPU",
":SerializeToCubin",
":Support",
":Transforms",
"//llvm:AllTargetsCodeGens",
"//llvm:Support",
"//mlir/test:TestAffine",
"//mlir/test:TestAnalysis",
"//mlir/test:TestArith",
"//mlir/test:TestBufferization",
"//mlir/test:TestControlFlow",
"//mlir/test:TestDLTI",
"//mlir/test:TestDialect",
2022-03-02 00:07:56 +01:00
"//mlir/test:TestFunc",
"//mlir/test:TestFuncToLLVM",
"//mlir/test:TestGPU",
"//mlir/test:TestIR",
"//mlir/test:TestLLVM",
"//mlir/test:TestLinalg",
2023-02-10 19:02:01 +01:00
"//mlir/test:TestLoopLikeInterface",
"//mlir/test:TestMath",
"//mlir/test:TestMemRef",
"//mlir/test:TestNVGPU",
"//mlir/test:TestOneToNTypeConversion",
"//mlir/test:TestPDLL",
"//mlir/test:TestPass",
"//mlir/test:TestReducer",
"//mlir/test:TestRewrite",
"//mlir/test:TestSCF",
"//mlir/test:TestSPIRV",
"//mlir/test:TestShapeDialect",
"//mlir/test:TestTensor",
2022-09-19 21:20:12 +02:00
"//mlir/test:TestTestDynDialect",
"//mlir/test:TestTilingInterface",
"//mlir/test:TestTosaDialect",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
"//mlir/test:TestTransformDialect",
"//mlir/test:TestTransforms",
"//mlir/test:TestTypeDialect",
"//mlir/test:TestVector",
"//mlir/test:TestVectorToSPIRV",
],
)
cc_library(
name = "MlirJitRunner",
srcs = ["lib/ExecutionEngine/JitRunner.cpp"],
hdrs = [
"include/mlir/ExecutionEngine/JitRunner.h",
"include/mlir/Tools/ParseUtilities.h",
],
includes = ["include"],
deps = [
":AllPassesAndDialects",
":ExecutionEngine",
":ExecutionEngineUtils",
":IR",
":LLVMDialect",
":LLVMToLLVMIRTranslation",
":OpenACCToLLVMIRTranslation",
":OpenMPToLLVMIRTranslation",
":Parser",
":SCFToControlFlow",
":Support",
"//llvm:Core",
"//llvm:OrcJIT",
"//llvm:Support",
],
)
cc_library(
name = "mlir_async_runtime_api",
hdrs = ["include/mlir/ExecutionEngine/AsyncRuntime.h"],
includes = ["include"],
)
cc_library(
name = "_mlir_async_runtime",
srcs = ["lib/ExecutionEngine/AsyncRuntime.cpp"],
copts = ["-Dmlir_async_runtime_EXPORTS"],
deps = [
":mlir_async_runtime_api",
"//llvm:Support",
],
)
# Indirection to avoid 'libmlir_async_runtime.so' filename clash.
alias(
name = "mlir_async_runtime",
actual = "_mlir_async_runtime",
)
cc_binary(
name = "libmlir_async_runtime.so",
linkshared = True,
linkstatic = False,
deps = [":mlir_async_runtime"],
)
cc_library(
name = "_mlir_float16_utils",
srcs = ["lib/ExecutionEngine/Float16bits.cpp"],
hdrs = ["include/mlir/ExecutionEngine/Float16bits.h"],
copts = ["-Dmlir_float16_utils_EXPORTS"],
includes = ["include"],
)
# Indirection to avoid 'libmlir_float16_utils.so' filename clash.
alias(
name = "mlir_float16_utils",
actual = "_mlir_float16_utils",
)
cc_binary(
name = "libmlir_float16_utils.so",
linkshared = True,
linkstatic = False,
deps = [":mlir_float16_utils"],
)
# Unlike mlir_float16_utils, mlir_c_runner_utils, etc, we do *not* make
# this a shared library: because on the CMake side, doing so causes issues
# when building on Windows. In particular, various functions take/return
# `std::vector` but that class is not designed with dllimport/dllexport
# pragma, therefore it cannot be safely/correctly used across DLL boundaries.
# Consequently, we avoid using the "mlir_xxx_utils" naming scheme,
# since that is reserved/intended for shared libraries only.
cc_library(
name = "SparseTensorRuntime",
srcs = [
"lib/ExecutionEngine/SparseTensor/File.cpp",
"lib/ExecutionEngine/SparseTensor/NNZ.cpp",
"lib/ExecutionEngine/SparseTensor/PermutationRef.cpp",
"lib/ExecutionEngine/SparseTensor/Storage.cpp",
],
hdrs = [
"include/mlir/ExecutionEngine/SparseTensor/ArithmeticUtils.h",
"include/mlir/ExecutionEngine/SparseTensor/Attributes.h",
"include/mlir/ExecutionEngine/SparseTensor/COO.h",
"include/mlir/ExecutionEngine/SparseTensor/ErrorHandling.h",
"include/mlir/ExecutionEngine/SparseTensor/File.h",
"include/mlir/ExecutionEngine/SparseTensor/PermutationRef.h",
"include/mlir/ExecutionEngine/SparseTensor/Storage.h",
],
includes = ["include"],
deps = [
":SparseTensorEnums",
":mlir_float16_utils",
],
)
cc_library(
name = "_mlir_c_runner_utils",
srcs = [
"lib/ExecutionEngine/CRunnerUtils.cpp",
"lib/ExecutionEngine/SparseTensorRuntime.cpp",
],
hdrs = [
"include/mlir/ExecutionEngine/CRunnerUtils.h",
"include/mlir/ExecutionEngine/Msan.h",
"include/mlir/ExecutionEngine/SparseTensorRuntime.h",
],
includes = ["include"],
deps = [
":SparseTensorEnums",
":SparseTensorRuntime",
":mlir_float16_utils",
"//llvm:Support",
],
)
# Indirection to avoid 'libmlir_c_runner_utils.so' filename clash.
alias(
name = "mlir_c_runner_utils",
actual = "_mlir_c_runner_utils",
)
cc_headers_only(
name = "mlir_c_runner_utils_hdrs",
src = ":mlir_c_runner_utils",
)
cc_binary(
name = "libmlir_c_runner_utils.so",
linkshared = True,
linkstatic = False,
deps = [":mlir_c_runner_utils"],
)
cc_library(
name = "_mlir_runner_utils",
srcs = ["lib/ExecutionEngine/RunnerUtils.cpp"],
hdrs = ["include/mlir/ExecutionEngine/RunnerUtils.h"],
includes = ["include"],
deps = [
":mlir_c_runner_utils",
"//llvm:Support",
],
)
# Indirection to avoid 'libmlir_runner_utils.so' filename clash.
alias(
name = "mlir_runner_utils",
actual = "_mlir_runner_utils",
)
cc_headers_only(
name = "mlir_runner_utils_hdrs",
src = ":mlir_runner_utils",
)
cc_binary(
name = "libmlir_runner_utils.so",
linkshared = True,
linkstatic = False,
deps = [":mlir_runner_utils"],
)
cc_binary(
name = "mlir-cpu-runner",
srcs = ["tools/mlir-cpu-runner/mlir-cpu-runner.cpp"],
deps = [
":AllToLLVMIRTranslations",
":BuiltinToLLVMIRTranslation",
":ExecutionEngineUtils",
":IR",
":LLVMDialect",
":LLVMToLLVMIRTranslation",
":MlirJitRunner",
":OpenACCToLLVMIRTranslation",
":OpenMPToLLVMIRTranslation",
":ToLLVMIRTranslation",
"//llvm:AsmParser",
"//llvm:Support",
"//llvm:X86AsmParser",
],
)
# This target provides the headers from LLVM's Support target without any of
# the symbols. In particular, it does not contain the static registration code
# which may be executed by at most one shared library loaded by ORCJit. Direct
# dependencies need to avoid requiring symbols from LLVMSupport by adding
# copts = ["-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1"].
#
# Bazel links the dependencies' object files instead of the archives, which
# means that symbols are linked in even if none are used. The LLVM cmake build
# on the other hand links archives (or shared libraries, depending on
# BUILD_SHARED_LIBS), skipping them if none of the symbols are used.
# See also https://reviews.llvm.org/D95613.
cc_headers_only(
name = "LLVMSupportHeaders",
src = "//llvm:Support",
)
cc_library(
name = "_mlir_cuda_runtime",
srcs = ["lib/ExecutionEngine/CudaRuntimeWrappers.cpp"],
# Prevent needing EnableABIBreakingChecks symbol from LLVMSupport.
copts = ["-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1"],
# Here:
# MLIR_ENABLE_CUDA_CUSPARSE : enables cuSPARSE
# MLIR_ENABLE_CUDA_CUSPARSELT : enables cuSPARSElt
local_defines = ["MLIR_ENABLE_CUDA_CUSPARSE"],
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [
":LLVMSupportHeaders",
":mlir_c_runner_utils_hdrs",
"@cuda//:cuda_headers",
"@cuda//:cusparse_static",
"@cuda//:libcuda",
],
)
# Indirection to avoid 'libmlir_cuda_runtime.so' filename clash.
alias(
name = "mlir_cuda_runtime",
actual = "_mlir_cuda_runtime",
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
)
cc_binary(
name = "libmlir_cuda_runtime.so",
linkshared = True,
linkstatic = False,
tags = [
"manual", # External dependency
"nobuildkite", # TODO(gcmn): Add support for this target
],
deps = [":mlir_cuda_runtime"],
)
cc_library(
name = "VulkanRuntime",
srcs = ["tools/mlir-vulkan-runner/VulkanRuntime.cpp"],
hdrs = ["tools/mlir-vulkan-runner/VulkanRuntime.h"],
tags = [
"manual", # External dependency
],
deps = [
":FuncDialect",
":IR",
":Pass",
":SPIRVDialect",
":SideEffectInterfaces",
":Support",
"//llvm:Support",
"@vulkan_headers",
"@vulkan_sdk//:sdk",
],
)
cc_binary(
name = "libvulkan-runtime-wrappers.so",
srcs = ["tools/mlir-vulkan-runner/vulkan-runtime-wrappers.cpp"],
linkshared = True,
linkstatic = False,
tags = [
"manual", # External dependency
],
deps = [":VulkanRuntime"],
)
cc_binary(
name = "mlir-vulkan-runner",
srcs = ["tools/mlir-vulkan-runner/mlir-vulkan-runner.cpp"],
deps = [
":ArithDialect",
":BuiltinToLLVMIRTranslation",
":ExecutionEngineUtils",
":FuncDialect",
":FuncToLLVM",
":FuncToSPIRV",
":GPUDialect",
":GPUToSPIRV",
":GPUToVulkanTransforms",
":GPUTransforms",
":LLVMCommonConversion",
":LLVMDialect",
":LLVMIRTransforms",
":LLVMToLLVMIRTranslation",
":MemRefDialect",
":MemRefToLLVM",
":MemRefTransforms",
":MlirJitRunner",
":Pass",
[mlir] Factor type reconciliation out of Standard-to-LLVM conversion Conversion to the LLVM dialect is being refactored to be more progressive and is now performed as a series of independent passes converting different dialects. These passes may produce `unrealized_conversion_cast` operations that represent pending conversions between built-in and LLVM dialect types. Historically, a more monolithic Standard-to-LLVM conversion pass did not need these casts as all operations were converted in one shot. Previous refactorings have led to the requirement of running the Standard-to-LLVM conversion pass to clean up `unrealized_conversion_cast`s even though the IR had no standard operations in it. The pass must have been also run the last among all to-LLVM passes, in contradiction with the partial conversion logic. Additionally, the way it was set up could produce invalid operations by removing casts between LLVM and built-in types even when the consumer did not accept the uncasted type, or could lead to cryptic conversion errors (recursive application of the rewrite pattern on `unrealized_conversion_cast` as a means to indicate failure to eliminate casts). In fact, the need to eliminate A->B->A `unrealized_conversion_cast`s is not specific to to-LLVM conversions and can be factored out into a separate type reconciliation pass, which is achieved in this commit. While the cast operation itself has a folder pattern, it is insufficient in most conversion passes as the folder only applies to the second cast. Without complex legality setup in the conversion target, the conversion infra will either consider the cast operations valid and not fold them (a separate canonicalization would be necessary to trigger the folding), or consider the first cast invalid upon generation and stop with error. The pattern provided by the reconciliation pass applies to the first cast operation instead. Furthermore, having a separate pass makes it clear when `unrealized_conversion_cast`s could not have been eliminated since it is the only reason why this pass can fail. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D109507
2021-09-09 16:06:10 +02:00
":ReconcileUnrealizedCasts",
":SPIRVDialect",
":SPIRVTransforms",
":ToLLVMIRTranslation",
":VectorDialect",
":VectorToLLVM",
"//llvm:Support",
],
)
cc_binary(
name = "mlir-spirv-cpu-runner",
srcs = ["tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp"],
deps = [
":ArithDialect",
":BuiltinToLLVMIRTranslation",
":ExecutionEngineUtils",
":FuncDialect",
":FuncToLLVM",
":GPUDialect",
":GPUToSPIRV",
":GPUTransforms",
":LLVMDialect",
":LLVMToLLVMIRTranslation",
":MemRefDialect",
":MlirJitRunner",
":Pass",
":SPIRVConversion",
":SPIRVDialect",
":SPIRVToLLVM",
":SPIRVTransforms",
":ToLLVMIRTranslation",
"//llvm:Core",
"//llvm:Linker",
"//llvm:Support",
],
)
cc_library(
name = "TableGen",
srcs = glob(["lib/TableGen/*.cpp"]),
hdrs = glob(["include/mlir/TableGen/*.h"]),
includes = ["include"],
deps = [
":Support",
"//llvm:Support",
"//llvm:TableGen",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
cc_library(
name = "MlirTableGenMain",
srcs = glob(["lib/Tools/mlir-tblgen/*.cpp"]),
hdrs = glob(["include/mlir/Tools/mlir-tblgen/*.h"]),
includes = ["include"],
deps = [
":TableGen",
"//llvm:Support",
"//llvm:TableGen",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
"//llvm:config",
],
)
cc_binary(
name = "mlir-tblgen",
srcs = glob([
"tools/mlir-tblgen/*.h",
"tools/mlir-tblgen/*.cpp",
]),
deps = [
":MlirTableGenMain",
":Support",
":TableGen",
2023-05-03 00:42:24 +09:00
"//llvm:CodeGenTypes",
"//llvm:Support",
"//llvm:TableGen",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
"//llvm:config",
],
)
cc_binary(
name = "mlir-linalg-ods-yaml-gen",
srcs = [
"tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp",
],
deps = [
":AsmParser",
":IR",
":Support",
"//llvm:Support",
"//llvm:TableGen",
"//llvm:config",
],
)
## OpenACC dialect
# TODO(gcmn): This is sticking td files in a cc_library
gentbl_cc_library(
name = "AccCommonGen",
includes = ["/llvm/include"],
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-directive-decl",
"-directives-dialect=OpenACC",
],
"include/mlir/Dialect/OpenACC/AccCommon.td",
),
],
tblgen = ":mlir-tblgen",
td_file = "//llvm:include/llvm/Frontend/OpenACC/ACC.td",
deps = ["//llvm:acc_td_files"],
)
td_library(
name = "OpenAccOpsTdFiles",
srcs = [
"include/mlir/Dialect/OpenACC/AccCommon.td",
"include/mlir/Dialect/OpenACC/OpenACCBase.td",
"include/mlir/Dialect/OpenACC/OpenACCOps.td",
"include/mlir/Dialect/OpenACC/OpenACCOpsTypes.td",
"include/mlir/Dialect/OpenACC/OpenACCTypeInterfaces.td",
],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "OpenACCOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/OpenACC/OpenACCOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/OpenACC/OpenACCOps.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/OpenACC/OpenACCOpsEnums.cpp.inc",
),
(
[
"-gen-attrdef-decls",
"-attrdefs-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsAttributes.h.inc",
),
(
[
"-gen-attrdef-defs",
"-attrdefs-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsAttributes.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/OpenACC/OpenACCOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenACC/OpenACCOps.td",
deps = [
":BuiltinDialectTdFiles",
2023-05-16 18:27:12 +02:00
":ControlFlowInterfacesTdFiles",
":OpenAccOpsTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "OpenACCTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"--gen-typedef-decls",
"-typedefs-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsTypes.h.inc",
),
(
[
"--gen-typedef-defs",
"-typedefs-dialect=acc",
],
"include/mlir/Dialect/OpenACC/OpenACCOpsTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenACC/OpenACCOpsTypes.td",
deps = [":OpenAccOpsTdFiles"],
)
gentbl_cc_library(
name = "OpenACCTypeInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-type-interface-decls"],
"include/mlir/Dialect/OpenACC/OpenACCTypeInterfaces.h.inc",
),
(
["-gen-type-interface-defs"],
"include/mlir/Dialect/OpenACC/OpenACCTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenACC/OpenACCTypeInterfaces.td",
deps = [":OpenAccOpsTdFiles"],
)
cc_library(
name = "OpenACCDialect",
srcs = glob(
[
"lib/Dialect/OpenACC/IR/*.cpp",
"lib/Dialect/OpenACC/IR/*.h",
],
),
hdrs = glob([
"include/mlir/Dialect/OpenACC/*.h",
]),
includes = ["include"],
deps = [
":ControlFlowInterfaces",
":IR",
":LLVMDialect",
":MemRefDialect",
":OpenACCOpsIncGen",
":OpenACCTypeInterfacesIncGen",
":OpenACCTypesIncGen",
":Transforms",
"//llvm:Support",
],
)
## OpenMP dialect
# TODO(gcmn): This is sticking td files in a cc_library
gentbl_cc_library(
name = "OmpCommonTdGen",
includes = ["/llvm/include"],
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-directive-decl",
"-directives-dialect=OpenMP",
],
"include/mlir/Dialect/OpenMP/OmpCommon.td",
),
],
tblgen = ":mlir-tblgen",
td_file = "//llvm:include/llvm/Frontend/OpenMP/OMP.td",
deps = [
":OpBaseTdFiles",
"//llvm:omp_td_files",
],
)
td_library(
name = "OpenMPOpsTdFiles",
srcs = [
"include/mlir/Dialect/OpenMP/OmpCommon.td",
"include/mlir/Dialect/OpenMP/OpenMPOps.td",
"include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td",
"include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.td",
],
deps = [
":LLVMOpsTdFiles",
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "OpenMPOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/OpenMP/OpenMPOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/OpenMP/OpenMPOps.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/OpenMP/OpenMPOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/OpenMP/OpenMPOpsEnums.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=omp",
],
"include/mlir/Dialect/OpenMP/OpenMPOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=omp",
],
"include/mlir/Dialect/OpenMP/OpenMPOpsDialect.cpp.inc",
),
(
[
"-gen-attrdef-decls",
"-attrdefs-dialect=omp",
],
"include/mlir/Dialect/OpenMP/OpenMPOpsAttributes.h.inc",
),
(
[
"-gen-attrdef-defs",
"-attrdefs-dialect=omp",
],
"include/mlir/Dialect/OpenMP/OpenMPOpsAttributes.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/OpenMP/OpenMPOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenMP/OpenMPOps.td",
deps = [":OpenMPOpsTdFiles"],
)
gentbl_cc_library(
name = "OpenMPTypeInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-type-interface-decls"],
"include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.h.inc",
),
(
["-gen-type-interface-defs"],
"include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenMP/OpenMPTypeInterfaces.td",
deps = [":OpenMPOpsTdFiles"],
)
gentbl_cc_library(
name = "OpenMPInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td",
deps = [":OpenMPOpsTdFiles"],
)
cc_library(
name = "OpenMPDialect",
srcs = glob(
[
"lib/Dialect/OpenMP/IR/*.cpp",
"lib/Dialect/OpenMP/IR/*.h",
],
),
hdrs = glob(
[
"include/mlir/Dialect/OpenMP/*.h",
],
exclude = ["include/mlir/Dialect/OpenMP/OpenMPInterfaces.h"],
),
includes = ["include"],
textual_hdrs = [
"include/mlir/Dialect/OpenMP/OpenMPInterfaces.h",
],
deps = [
":ControlFlowInterfaces",
":FuncDialect",
":IR",
":LLVMDialect",
":OpenMPInterfacesIncGen",
":OpenMPOpsIncGen",
":OpenMPTypeInterfacesIncGen",
"//llvm:FrontendOpenMP",
"//llvm:Support",
],
)
cc_library(
name = "OpenACCToSCF",
srcs = glob([
"lib/Conversion/OpenACCToSCF/*.cpp",
"lib/Conversion/OpenACCToSCF/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/OpenACCToSCF/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":OpenACCDialect",
":OpenACCOpsIncGen",
":OpenACCTypesIncGen",
":Pass",
":SCFDialect",
":Transforms",
],
)
cc_library(
name = "OpenACCToLLVM",
srcs = glob([
"lib/Conversion/OpenACCToLLVM/*.cpp",
"lib/Conversion/OpenACCToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/OpenACCToLLVM/*.h",
]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":OpenACCDialect",
":Pass",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "OpenMPToLLVM",
srcs = glob([
"lib/Conversion/OpenMPToLLVM/*.cpp",
"lib/Conversion/OpenMPToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/OpenMPToLLVM/*.h",
]),
includes = ["include"],
deps = [
":ArithToLLVM",
":ControlFlowToLLVM",
":ConversionPassIncGen",
":FuncDialect",
":FuncToLLVM",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MemRefToLLVM",
":OpenMPDialect",
":Pass",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
name = "QuantizationOpsTdFiles",
srcs = [
"include/mlir/Dialect/Quant/QuantOps.td",
"include/mlir/Dialect/Quant/QuantOpsBase.td",
],
includes = ["include"],
deps = [
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "QuantOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Quant/QuantOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Quant/QuantOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/Quant/QuantOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/Quant/QuantOpsDialect.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/QuantOps/QuantOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Quant/QuantOps.td",
deps = [":QuantizationOpsTdFiles"],
)
gentbl_cc_library(
name = "QuantDialectBytecodeGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-bytecode",
"-bytecode-dialect=Quant",
],
"include/mlir/Dialect/Quant/QuantDialectBytecode.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Quant/QuantDialectBytecode.td",
deps = [
":BytecodeTdFiles",
],
)
cc_library(
name = "QuantOps",
srcs = [
"lib/Dialect/Quant/IR/QuantDialectBytecode.cpp",
"lib/Dialect/Quant/IR/QuantDialectBytecode.h",
"lib/Dialect/Quant/IR/QuantOps.cpp",
"lib/Dialect/Quant/IR/QuantTypes.cpp",
"lib/Dialect/Quant/IR/TypeDetail.h",
"lib/Dialect/Quant/IR/TypeParser.cpp",
"lib/Dialect/Quant/Utils/FakeQuantSupport.cpp",
"lib/Dialect/Quant/Utils/UniformSupport.cpp",
],
hdrs = [
"include/mlir/Dialect/Quant/FakeQuantSupport.h",
"include/mlir/Dialect/Quant/QuantOps.h",
"include/mlir/Dialect/Quant/QuantTypes.h",
"include/mlir/Dialect/Quant/UniformSupport.h",
],
includes = ["include"],
deps = [
":ArithDialect",
2022-03-17 09:24:53 +01:00
":FuncDialect",
":IR",
2022-04-28 22:51:27 +02:00
":InferTypeOpInterface",
":Pass",
":QuantDialectBytecodeGen",
":QuantOpsIncGen",
":SideEffectInterfaces",
":Support",
":TransformUtils",
"//llvm:Support",
],
)
td_library(
name = "IndexOpsTdFiles",
srcs = [
"include/mlir/Dialect/Index/IR/IndexDialect.td",
"include/mlir/Dialect/Index/IR/IndexEnums.td",
"include/mlir/Dialect/Index/IR/IndexOps.td",
],
includes = ["include"],
deps = [
":CastInterfacesTdFiles",
":InferIntRangeInterfaceTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "IndexOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Index/IR/IndexOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Index/IR/IndexOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=index",
],
"include/mlir/Dialect/Index/IR/IndexOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=index",
],
"include/mlir/Dialect/Index/IR/IndexOpsDialect.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/Index/IR/IndexOpsAttrDefs.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/Index/IR/IndexOpsAttrDefs.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Index/IR/IndexOps.td",
deps = [":IndexOpsTdFiles"],
)
gentbl_cc_library(
name = "IndexEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Index/IR/IndexEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Index/IR/IndexEnums.cpp.inc",
),
(
[
"-gen-attrdef-decls",
"-attrdefs-dialect=index",
],
"include/mlir/Dialect/Index/IR/IndexAttrs.h.inc",
),
(
[
"-gen-attrdef-defs",
"-attrdefs-dialect=index",
],
"include/mlir/Dialect/Index/IR/IndexAttrs.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Index/IR/IndexEnums.td",
deps = [":IndexOpsTdFiles"],
)
cc_library(
name = "IndexToLLVM",
srcs = glob([
"lib/Conversion/IndexToLLVM/*.cpp",
"lib/Conversion/IndexToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/IndexToLLVM/*.h",
]),
includes = ["include"],
deps = [
":Analysis",
":ConversionPassIncGen",
":IR",
":IndexDialect",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":Support",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "IndexDialect",
srcs = glob(["lib/Dialect/Index/IR/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Index/IR/*.h"]),
includes = ["include"],
deps = [
":CastInterfaces",
":IR",
":IndexEnumsIncGen",
":IndexOpsIncGen",
":InferIntRangeCommon",
":InferIntRangeInterface",
":InferTypeOpInterface",
"//llvm:Support",
],
)
td_library(
name = "LinalgOpsTdFiles",
srcs = [
"include/mlir/Dialect/Linalg/IR/LinalgBase.td",
"include/mlir/Dialect/Linalg/IR/LinalgEnums.td",
2023-07-19 11:10:53 +02:00
"include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td",
"include/mlir/Dialect/Linalg/IR/LinalgOps.td",
],
includes = ["include"],
deps = [
":ControlFlowInterfacesTdFiles",
":DestinationStyleOpInterfaceTdFiles",
":DialectUtilsTdFiles",
":InferTypeOpInterfaceTdFiles",
":LoopLikeInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":TilingInterfaceTdFiles",
":ViewLikeInterfaceTdFiles",
],
)
td_library(
name = "LinalgTransformOpsTdFiles",
srcs = glob([
"include/mlir/Dialect/Linalg/TransformOps/*.td",
]),
includes = ["include"],
deps = [
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
":SCFTdFiles",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "LinalgOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Linalg/IR/LinalgOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Linalg/IR/LinalgOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=linalg",
],
"include/mlir/Dialect/Linalg/IR/LinalgOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=linalg",
],
"include/mlir/Dialect/Linalg/IR/LinalgOpsDialect.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/Linalg/IR/LinalgOpsAttrDefs.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/Linalg/IR/LinalgOpsAttrDefs.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/IR/LinalgOps.td",
deps = [":LinalgOpsTdFiles"],
)
gentbl_cc_library(
name = "LinalgEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Linalg/IR/LinalgOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Linalg/IR/LinalgOpsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/IR/LinalgEnums.td",
deps = [":LinalgOpsTdFiles"],
)
gentbl_cc_library(
name = "LinalgMatchOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.td",
deps = [
":LinalgTransformEnumsIncGen",
":LinalgTransformOpsIncGen",
":LinalgTransformOpsTdFiles",
":SCFDeviceMappingInterfacesIncGen",
],
)
gentbl_cc_library(
name = "LinalgTransformEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOpsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/TransformOps/LinalgTransformEnums.td",
deps = [
":LinalgTransformOpsTdFiles",
":SCFDeviceMappingInterfacesIncGen",
],
)
gentbl_cc_library(
name = "LinalgTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td",
deps = [
":LinalgTransformEnumsIncGen",
":LinalgTransformOpsTdFiles",
[mlir] Introduce device mapper attribute for `thread_dim_map` and `mapped to dims` `scf.foreach_thread` defines mapping its loops to processors via an integer array, see an example below. A lowering can use this mapping. However, expressing mapping as an integer array is very confusing, especially when there are multiple levels of parallelism. In addition, the op does not verify the integer array. This change introduces device mapping attribute to make mapping descriptive and verifiable. Then it makes GPU transform dialect use it. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [0, 1]} } { thread_dim_mapping = [0, 1]} ``` It first introduces a `DeviceMappingInterface` which is an attribute interface. `scf.foreach_thread` defines its mapping via this interface. A lowering must define its attributes and implement this interface as well. This way gives us a clear validation. The change also introduces two new attributes (`#gpu.thread<x/y/z>` and `#gpu.block<x,y,z>` ). After this change, the above code prints as below, as seen here, this way clarifies the loop mappings. The change also implements consuming of these two new attribute by the transform dialect. Transform dialect binds the outermost loops to the thread blocks and innermost loops to threads. ``` scf.foreach_thread (%i, %j) in (%c1, %c2) { scf.foreach_thread (%i2, %j2) in (%c1, %c2) {...} { thread_dim_mapping = [#gpu.thread<x>, #gpu.thread<y>]} } { thread_dim_mapping = [#gpu.block<x>, #gpu.block<y>]} ``` Reviewed By: ftynse, nicolasvasilache Differential Revision: https://reviews.llvm.org/D137413
2022-11-10 17:55:49 +01:00
":SCFDeviceMappingInterfacesIncGen",
],
)
genlinalg(
name = "LinalgNamedStructuredOpsYamlIncGen",
src = "include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml",
linalg_outs = [
(
"-o-impl=$@",
"include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.cpp.inc",
),
(
"-o-ods-decl=$@",
"include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td",
),
],
linalggen = ":mlir-linalg-ods-yaml-gen",
)
td_library(
name = "LinalgStructuredOpsTdFiles",
srcs = [
"include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td",
"include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yamlgen.td",
"include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
],
includes = ["include"],
deps = [
":CopyOpInterfaceTdFiles",
":DestinationStyleOpInterface",
":LinalgOpsTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "LinalgStructuredOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td",
deps = [":LinalgStructuredOpsTdFiles"],
)
gentbl_cc_library(
name = "LinalgInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Linalg/IR/LinalgInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Linalg/IR/LinalgInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td",
deps = [":LinalgStructuredOpsTdFiles"],
)
td_library(
name = "BufferizableOpInterfaceTdFiles",
srcs = [
"include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td",
],
includes = ["include"],
deps = [
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "BufferizableOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td",
deps = [
":BufferizableOpInterfaceTdFiles",
],
)
td_library(
name = "LinalgDocTdFiles",
srcs = ["include/mlir/Dialect/Linalg/IR/LinalgDoc.td"],
includes = ["include"],
deps = [
":LinalgOpsTdFiles",
":LinalgStructuredOpsTdFiles",
],
)
gentbl_cc_library(
name = "LinalgDocIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-doc"],
"g3doc/Dialects/Linalg/LinalgOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/IR/LinalgDoc.td",
deps = [":LinalgDocTdFiles"],
)
cc_library(
name = "LinalgToStandard",
srcs = glob([
"lib/Conversion/LinalgToStandard/*.cpp",
"lib/Conversion/LinalgToStandard/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/LinalgToStandard/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LLVMDialect",
":LinalgDialect",
":LinalgTransforms",
":MemRefDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "LinalgDialect",
srcs = glob(["lib/Dialect/Linalg/IR/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Linalg/IR/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":ArithUtils",
":AsmParser",
":BufferizationDialect",
":ComplexDialect",
":ControlFlowInterfaces",
":CopyOpInterface",
":DestinationStyleOpInterface",
":DialectUtils",
":FuncDialect",
":IR",
":InferTypeOpInterface",
":LinalgEnumsIncGen",
":LinalgInterfacesIncGen",
":LinalgNamedStructuredOpsYamlIncGen",
":LinalgOpsIncGen",
":LinalgStructuredOpsIncGen",
":MathDialect",
":MemRefDialect",
":Parser",
":SCFDialect",
":SideEffectInterfaces",
":SparseTensorDialect",
":Support",
":TensorDialect",
":TilingInterface",
2023-04-13 14:58:11 +02:00
":ValueBoundsOpInterface",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "LinalgTransformOps",
srcs = glob([
"lib/Dialect/Linalg/TransformOps/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/Linalg/TransformOps/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":Analysis",
":ArithDialect",
":AsmParser",
":BufferizationTransforms",
":DialectUtils",
":FuncDialect",
2022-09-19 16:38:20 +02:00
":GPUDialect",
":IR",
":LinalgDialect",
":LinalgMatchOpsIncGen",
":LinalgTransformEnumsIncGen",
":LinalgTransformOpsIncGen",
":LinalgTransforms",
":LinalgUtils",
":SCFDialect",
":SCFTransforms",
":Support",
":TensorDialect",
":TensorUtils",
":TilingInterface",
":TransformDialect",
":TransformDialectUtils",
":TransformUtils",
":VectorDialect",
":VectorTransforms",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "LinalgPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Linalg",
],
"include/mlir/Dialect/Linalg/Passes.h.inc",
),
(
[
"-gen-pass-capi-header",
"--prefix=Linalg",
],
"include/mlir/Dialect/Linalg/Passes.capi.h.inc",
),
(
[
"-gen-pass-capi-impl",
"--prefix=Linalg",
],
"include/mlir/Dialect/Linalg/Passes.capi.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Linalg/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "LinalgUtils",
srcs = glob([
"lib/Dialect/Linalg/Utils/*.cpp",
"lib/Dialect/Linalg/Utils/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/Linalg/Utils/*.h",
]),
deps = [
":AffineAnalysis",
":AffineDialect",
":AffineUtils",
":Analysis",
":ArithDialect",
":ArithUtils",
":DialectUtils",
":FuncDialect",
":IR",
":LinalgDialect",
":MemRefDialect",
":Pass",
":SCFDialect",
":TensorDialect",
":TensorUtils",
"//llvm:Support",
],
)
cc_library(
name = "LinalgTransforms",
srcs = glob([
"lib/Dialect/Linalg/Transforms/*.cpp",
"lib/Dialect/Linalg/Transforms/*.h",
]),
hdrs = [
"include/mlir/Dialect/Linalg/Passes.h",
] + glob([
"include/mlir/Dialect/Linalg/Transforms/*.h",
]),
includes = ["include"],
deps = [
":AffineAnalysis",
":AffineDialect",
2023-04-13 14:58:11 +02:00
":AffineTransforms",
":AffineUtils",
":Analysis",
":ArithDialect",
":ArithTransforms",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":ComplexDialect",
":ControlFlowDialect",
":DestinationStyleOpInterface",
":DialectUtils",
":FuncDialect",
2022-03-02 00:07:56 +01:00
":FuncTransforms",
":GPUDialect",
":IR",
":LinalgDialect",
":LinalgPassIncGen",
":LinalgStructuredOpsIncGen",
":LinalgUtils",
":LoopLikeInterface",
":MaskableOpInterface",
":MathDialect",
":MemRefDialect",
":MemRefTransforms",
":Pass",
":SCFDialect",
":SCFTransforms",
":SCFUtils",
":SparseTensorDialect",
":Support",
":TensorDialect",
":TensorTilingInterfaceImpl",
":TensorTransforms",
":TensorUtils",
":TilingInterface",
":TransformUtils",
":Transforms",
2023-04-13 14:58:11 +02:00
":ValueBoundsOpInterface",
":VectorDialect",
":VectorToSCF",
":VectorTransforms",
":VectorUtils",
":X86VectorTransforms",
"//llvm:Support",
],
)
td_library(
name = "ValueBoundsOpInterfaceTdFiles",
srcs = [
"include/mlir/Interfaces/ValueBoundsOpInterface.td",
],
includes = ["include"],
deps = [
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "ValueBoundsOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Interfaces/ValueBoundsOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Interfaces/ValueBoundsOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Interfaces/ValueBoundsOpInterface.td",
deps = [
":ValueBoundsOpInterfaceTdFiles",
],
)
cc_library(
name = "ValueBoundsOpInterface",
srcs = ["lib/Interfaces/ValueBoundsOpInterface.cpp"],
hdrs = ["include/mlir/Interfaces/ValueBoundsOpInterface.h"],
includes = ["include"],
deps = [
":Analysis",
":DestinationStyleOpInterface",
":IR",
":Support",
":ValueBoundsOpInterfaceIncGen",
"//llvm:Support",
],
)
cc_library(
name = "ArithValueBoundsOpInterfaceImpl",
srcs = ["lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp"],
hdrs = ["include/mlir/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.h"],
includes = ["include"],
deps = [
":ArithDialect",
":IR",
":ValueBoundsOpInterface",
],
)
cc_library(
name = "TilingInterface",
srcs = ["lib/Interfaces/TilingInterface.cpp"],
hdrs = ["include/mlir/Interfaces/TilingInterface.h"],
includes = ["include"],
deps = [
":DialectUtils",
":IR",
":Support",
":TilingInterfaceIncGen",
":ViewLikeInterface",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# Vector dialect.
##---------------------------------------------------------------------------##
td_library(
name = "MaskingOpInterfaceTdFiles",
srcs = ["include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "MaskableOpInterfaceTdFiles",
srcs = ["include/mlir/Dialect/Vector/Interfaces/MaskableOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
td_library(
name = "VectorOpsTdFiles",
srcs = ["include/mlir/Dialect/Vector/IR/VectorOps.td"],
includes = ["include"],
deps = [
":ControlFlowInterfacesTdFiles",
":DestinationStyleOpInterfaceTdFiles",
":InferTypeOpInterfaceTdFiles",
":MaskableOpInterfaceTdFiles",
":MaskingOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":VectorInterfacesTdFiles",
":ViewLikeInterfaceTdFiles",
],
)
td_library(
name = "VectorTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td",
],
includes = ["include"],
deps = [
":PDLDialectTdFiles",
":SCFTdFiles",
":TransformDialectTdFiles",
2023-01-17 13:17:56 +01:00
":VectorTransformsTdFiles",
],
)
gentbl_cc_library(
name = "MaskableOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Vector/Interfaces/MaskableOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Vector/Interfaces/MaskableOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/Interfaces/MaskableOpInterface.td",
deps = [":MaskableOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "MaskingOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.td",
deps = [":MaskingOpInterfaceTdFiles"],
)
gentbl_cc_library(
name = "VectorOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Vector/IR/VectorOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Vector/IR/VectorOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=vector",
],
"include/mlir/Dialect/Vector/IR/VectorOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=vector",
],
"include/mlir/Dialect/Vector/IR/VectorOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/Vector/IR/VectorOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Vector/IR/VectorOpsEnums.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/Vector/IR/VectorOpsAttrDefs.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/Vector/IR/VectorOpsAttrDefs.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/Vector/VectorOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/IR/VectorOps.td",
deps = [":VectorOpsTdFiles"],
)
gentbl_cc_library(
name = "VectorTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Vector/TransformOps/VectorTransformOps.td",
deps = [
":VectorTransformOpsTdFiles",
],
)
cc_library(
name = "MaskableOpInterface",
srcs = ["lib/Dialect/Vector/Interfaces/MaskableOpInterface.cpp"],
hdrs = ["include/mlir/Dialect/Vector/Interfaces/MaskableOpInterface.h"],
includes = ["include"],
deps = [
":IR",
":MaskableOpInterfaceIncGen",
":MaskingOpInterface",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "MaskingOpInterface",
srcs = ["lib/Dialect/Vector/Interfaces/MaskingOpInterface.cpp"],
hdrs = ["include/mlir/Dialect/Vector/Interfaces/MaskingOpInterface.h"],
includes = ["include"],
deps = [
":IR",
":MaskingOpInterfaceIncGen",
":Support",
"//llvm:Support",
],
)
cc_library(
name = "VectorToLLVM",
srcs = glob([
"lib/Conversion/VectorToLLVM/*.cpp",
"lib/Conversion/VectorToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/VectorToLLVM/*.h",
]),
includes = ["include"],
deps = [
":AMXDialect",
":AMXTransforms",
":ArithDialect",
":ArithUtils",
":ArmNeonDialect",
":ArmSMEDialect",
":ArmSMETransforms",
":ArmSVEDialect",
":ArmSVETransforms",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":MaskableOpInterface",
":MemRefDialect",
":Pass",
":Support",
":ToLLVMIRTranslation",
":Transforms",
":VectorDialect",
":VectorTransforms",
":X86VectorDialect",
":X86VectorTransforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "VectorToArmSME",
srcs = glob([
"lib/Conversion/VectorToArmSME/*.cpp",
"lib/Conversion/VectorToArmSME/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/VectorToArmSME/*.h",
]),
includes = ["include"],
deps = [
":ArmSMEDialect",
":ArmSMEUtils",
":ConversionPassIncGen",
":IR",
":Pass",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "VectorToGPU",
srcs = glob([
"lib/Conversion/VectorToGPU/*.cpp",
"lib/Conversion/VectorToGPU/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/VectorToGPU/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":Analysis",
":ArithDialect",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":FuncToLLVM",
":GPUDialect",
":IR",
":LLVMDialect",
":MemRefDialect",
":NVGPUDialect",
2023-01-17 15:22:30 -08:00
":NVGPUUtils",
":NVVMDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
":VectorDialect",
":VectorTransforms",
":VectorUtils",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "VectorToSCF",
srcs = glob([
"lib/Conversion/VectorToSCF/*.cpp",
"lib/Conversion/VectorToSCF/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/VectorToSCF/*.h",
]),
includes = ["include"],
deps = [
":AffineDialect",
":AffineUtils",
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":FuncToLLVM",
":IR",
":LLVMDialect",
":MemRefDialect",
":Pass",
":SCFDialect",
":Support",
2023-01-31 17:05:49 -08:00
":TensorDialect",
":Transforms",
":VectorDialect",
":VectorTransforms",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
name = "TosaDialectTdFiles",
srcs = glob(["include/mlir/Dialect/Tosa/IR/*.td"]),
deps = [
":InferTypeOpInterfaceTdFiles",
":LoopLikeInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":VectorInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "TosaDialectIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Tosa/IR/TosaOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Tosa/IR/TosaOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/Tosa/IR/TosaOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/Tosa/IR/TosaOpsDialect.cpp.inc",
),
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/Tosa/IR/TosaAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/Tosa/IR/TosaAttributes.cpp.inc",
),
(
["-gen-op-doc"],
"g3doc/Dialects/Tosa/TosaOps.md",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tosa/IR/TosaOps.td",
deps = [":TosaDialectTdFiles"],
)
gentbl_cc_library(
name = "TosaInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Tosa/IR/TosaInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Tosa/IR/TosaInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tosa/IR/TosaInterfaces.td",
deps = [":TosaDialectTdFiles"],
)
gentbl_cc_library(
name = "TosaPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=TosaOpt",
],
"include/mlir/Dialect/Tosa/Transforms/Passes.h.inc",
),
2022-11-15 07:48:51 +01:00
(
[
"-gen-enum-decls",
"-name=TosaOpt",
],
"include/mlir/Dialect/Tosa/Transforms/PassesEnums.h.inc",
),
(
[
"-gen-enum-defs",
"-name=TosaOpt",
],
"include/mlir/Dialect/Tosa/Transforms/PassesEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Tosa/Transforms/Passes.td",
2022-11-15 07:48:51 +01:00
deps = [
":OpBaseTdFiles",
":PassBaseTdFiles",
],
)
cc_library(
name = "TosaDialect",
srcs = glob([
"lib/Dialect/Tosa/IR/*.cpp",
"lib/Dialect/Tosa/IR/*.h",
"lib/Dialect/Tosa/Utils/*.cpp",
"lib/Dialect/Tosa/Transforms/*.cpp",
]),
hdrs = glob([
"include/mlir/Dialect/Tosa/IR/*.h",
"include/mlir/Dialect/Tosa/Utils/*.h",
"include/mlir/Dialect/Tosa/Transforms/*.h",
]),
includes = ["include"],
deps = [
":Analysis",
":ArithDialect",
":Dialect",
":DialectUtils",
":FuncDialect",
":IR",
":InferTypeOpInterface",
":LoopLikeInterface",
":Pass",
":QuantOps",
":Support",
":TensorDialect",
":TosaDialectIncGen",
":TosaInterfacesIncGen",
":TosaPassIncGen",
":TransformUtils",
":VectorInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "TosaToArith",
srcs = glob([
"lib/Conversion/TosaToArith/*.cpp",
"lib/Conversion/TosaToArith/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TosaToArith/*.h",
]),
includes = [
"include",
"lib/Conversion/TosaToArith",
],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":Pass",
":TosaDialect",
":Transforms",
],
)
cc_library(
name = "TosaToLinalg",
srcs = glob([
"lib/Conversion/TosaToLinalg/*.cpp",
"lib/Conversion/TosaToLinalg/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TosaToLinalg/*.h",
]),
includes = [
"include",
"lib/Conversion/TosaToLinalg",
],
deps = [
":ArithDialect",
":ArithUtils",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":IR",
":LinalgDialect",
":LinalgUtils",
":MathDialect",
":Pass",
":SCFDialect",
":TensorDialect",
":TensorUtils",
":TosaDialect",
":Transforms",
"//llvm:Support",
],
)
cc_library(
name = "TosaToSCF",
srcs = glob([
"lib/Conversion/TosaToSCF/*.cpp",
"lib/Conversion/TosaToSCF/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TosaToSCF/*.h",
]),
includes = [
"include",
"lib/Conversion/TosaToSCF",
],
deps = [
":ConversionPassIncGen",
":FuncDialect",
":IR",
":Pass",
":SCFDialect",
":TensorDialect",
":TosaDialect",
":Transforms",
],
)
cc_library(
name = "TosaToTensor",
srcs = glob([
"lib/Conversion/TosaToTensor/*.cpp",
"lib/Conversion/TosaToTensor/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/TosaToTensor/*.h",
]),
includes = [
"include",
"lib/Conversion/TosaToTensor",
],
deps = [
":ArithDialect",
":ArithUtils",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":Pass",
":TensorDialect",
":TensorUtils",
":TosaDialect",
":Transforms",
],
)
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
td_library(
name = "TransformDialectTdFiles",
srcs = glob(["include/mlir/Dialect/Transform/IR/*.td"]),
deps = [
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":InferTypeOpInterfaceTdFiles",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
],
)
gentbl_cc_library(
name = "TransformDialectEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-enum-decls",
],
"include/mlir/Dialect/Transform/IR/TransformDialectEnums.h.inc",
),
(
[
"-gen-enum-defs",
],
"include/mlir/Dialect/Transform/IR/TransformDialectEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/TransformAttrs.td",
deps = [":TransformDialectTdFiles"],
)
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
gentbl_cc_library(
name = "TransformDialectMatchInterfacesIncGen",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-op-interface-decls",
],
"include/mlir/Dialect/Transform/IR/MatchInterfaces.h.inc",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
),
(
[
"-gen-op-interface-defs",
],
"include/mlir/Dialect/Transform/IR/MatchInterfaces.cpp.inc",
),
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/MatchInterfaces.td",
deps = [
":TransformDialectInterfacesIncGen",
":TransformDialectTdFiles",
],
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
)
gentbl_cc_library(
name = "TransformDialectInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-op-interface-decls",
],
"include/mlir/Dialect/Transform/IR/TransformInterfaces.h.inc",
),
(
[
"-gen-op-interface-defs",
],
"include/mlir/Dialect/Transform/IR/TransformInterfaces.cpp.inc",
),
(
[
"-gen-type-interface-decls",
],
"include/mlir/Dialect/Transform/IR/TransformTypeInterfaces.h.inc",
),
(
[
"-gen-type-interface-defs",
],
"include/mlir/Dialect/Transform/IR/TransformTypeInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/TransformInterfaces.td",
deps = [":TransformDialectTdFiles"],
)
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
gentbl_cc_library(
name = "TransformDialectIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
],
"include/mlir/Dialect/Transform/IR/TransformDialect.h.inc",
),
(
[
"-gen-dialect-defs",
],
"include/mlir/Dialect/Transform/IR/TransformDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/TransformDialect.td",
deps = [":TransformDialectTdFiles"],
)
gentbl_cc_library(
name = "TransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Transform/IR/TransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Transform/IR/TransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/TransformOps.td",
deps = [
":CallInterfacesTdFiles",
":FunctionInterfacesTdFiles",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "TransformTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-typedef-decls"],
"include/mlir/Dialect/Transform/IR/TransformTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/Transform/IR/TransformTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/IR/TransformTypes.td",
deps = [":TransformDialectTdFiles"],
)
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
cc_library(
name = "TransformDialect",
srcs = glob(["lib/Dialect/Transform/IR/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Transform/IR/*.h"]),
deps = [
":Analysis",
":CallOpInterfaces",
":CastInterfaces",
":ControlFlowInterfaces",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
":IR",
":LoopLikeInterface",
":Pass",
":Rewrite",
":SideEffectInterfaces",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
":Support",
":TransformDialectEnumsIncGen",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
":TransformDialectIncGen",
":TransformDialectInterfacesIncGen",
":TransformDialectMatchInterfacesIncGen",
":TransformDialectUtils",
":TransformOpsIncGen",
":TransformTypesIncGen",
2023-03-28 13:11:47 -07:00
":Transforms",
[mlir] Introduce Transform dialect This dialect provides operations that can be used to control transformation of the IR using a different portion of the IR. It refers to the IR being transformed as payload IR, and to the IR guiding the transformation as transform IR. The main use case for this dialect is orchestrating fine-grain transformations on individual operations or sets thereof. For example, it may involve finding loop-like operations with specific properties (e.g., large size) in the payload IR, applying loop tiling to those and only those operations, and then applying loop unrolling to the inner loops produced by the previous transformations. As such, it is not intended as a replacement for the pass infrastructure, nor for the pattern rewriting infrastructure. In the most common case, the transform IR will be processed and applied to payload IR by a pass. Transformations expressed by the transform dialect may be implemented using the pattern infrastructure or any other relevant MLIR component. This dialect is designed to be extensible, that is, clients of this dialect are allowed to inject additional operations into this dialect using the newly introduced in this patch `TransformDialectExtension` mechanism. This allows the dialect to avoid a dependency on the implementation of the transformation as well as to avoid introducing dialect-specific transform dialects. See https://discourse.llvm.org/t/rfc-interfaces-and-dialects-for-precise-ir-transformation-control/60927. Reviewed By: nicolasvasilache, Mogball, rriddle Differential Revision: https://reviews.llvm.org/D123135
2022-04-14 13:16:48 +02:00
"//llvm:Support",
],
)
td_library(
name = "TransformPDLExtensionTdFiles",
srcs = glob(["include/mlir/Dialect/Transform/PDLExtension/*.td"]),
deps = [
":PDLDialectTdFiles",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "TransformPDLExtensionOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-op-decls",
],
"include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.h.inc",
),
(
[
"-gen-op-defs",
],
"include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/PDLExtension/PDLExtensionOps.td",
deps = [":TransformPDLExtensionTdFiles"],
)
cc_library(
name = "TransformPDLExtension",
srcs = glob(["lib/Dialect/Transform/PDLExtension/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Transform/PDLExtension/*.h"]),
deps = [
":IR",
":PDLDialect",
":PDLInterpDialect",
":Rewrite",
":SideEffectInterfaces",
":Support",
":TransformDialect",
":TransformPDLExtensionOpsIncGen",
"//llvm:Support",
],
)
td_library(
name = "TransformDialectTransformsTdFiles",
srcs = glob(["include/mlir/Dialect/Transform/Transforms/*.td"]),
deps = [
":PassBaseTdFiles",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "TransformDialectTransformsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Transform",
],
"include/mlir/Dialect/Transform/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Transform/Transforms/Passes.td",
deps = [":TransformDialectTransformsTdFiles"],
)
cc_library(
name = "TransformDialectTransforms",
srcs = glob(["lib/Dialect/Transform/Transforms/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/Transform/Transforms/*.h"]),
deps = [
":Analysis",
":IR",
":Parser",
":Pass",
":SideEffectInterfaces",
":Support",
":TransformDialect",
":TransformDialectTransformsIncGen",
"//llvm:Support",
],
)
cc_library(
name = "TransformDialectUtils",
srcs = glob(["lib/Dialect/Transform/Utils/*cpp"]),
hdrs = glob(["include/mlir/Dialect/Transform/Utils/*.h"]),
includes = ["include"],
deps = [
":DialectUtils",
":IR",
":Support",
":ViewLikeInterface",
"//llvm:Support",
],
)
td_library(
name = "ComplexOpsTdFiles",
srcs = [
"include/mlir/Dialect/Complex/IR/ComplexBase.td",
"include/mlir/Dialect/Complex/IR/ComplexOps.td",
],
includes = ["include"],
deps = [
":BuiltinDialectTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ComplexAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/Complex/IR/ComplexAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/Complex/IR/ComplexAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Complex/IR/ComplexAttributes.td",
deps = [":ComplexOpsTdFiles"],
)
gentbl_cc_library(
name = "ComplexBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=complex",
],
"include/mlir/Dialect/Complex/IR/ComplexOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=complex",
],
"include/mlir/Dialect/Complex/IR/ComplexOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Complex/IR/ComplexBase.td",
deps = [":ComplexOpsTdFiles"],
)
gentbl_cc_library(
name = "ComplexOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Complex/IR/ComplexOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Complex/IR/ComplexOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Complex/IR/ComplexOps.td",
deps = [":ComplexOpsTdFiles"],
)
cc_library(
name = "ComplexDialect",
srcs = glob(
[
"lib/Dialect/Complex/IR/*.cpp",
"lib/Dialect/Complex/IR/*.h",
],
),
hdrs = ["include/mlir/Dialect/Complex/IR/Complex.h"],
includes = ["include"],
deps = [
":ArithDialect",
":ComplexAttributesIncGen",
":ComplexBaseIncGen",
":ComplexOpsIncGen",
":IR",
2022-01-26 23:24:45 +01:00
":InferTypeOpInterface",
":SideEffectInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "ComplexToLLVM",
srcs = glob([
"lib/Conversion/ComplexToLLVM/*.cpp",
"lib/Conversion/ComplexToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/ComplexToLLVM/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ComplexDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":Support",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ComplexToLibm",
srcs = glob([
"lib/Conversion/ComplexToLibm/*.cpp",
"lib/Conversion/ComplexToLibm/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/ComplexToLibm/*.h",
]),
includes = ["include"],
deps = [
":ComplexDialect",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":IR",
":Pass",
":Support",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ComplexToSPIRV",
srcs = glob([
"lib/Conversion/ComplexToSPIRV/*.cpp",
"lib/Conversion/ComplexToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/ComplexToSPIRV/*.h",
]),
includes = ["include"],
deps = [
":ComplexDialect",
":ConversionPassIncGen",
":IR",
":Pass",
":SPIRVCommonConversion",
":SPIRVConversion",
":SPIRVDialect",
":Support",
":Transforms",
"//llvm:Core",
"//llvm:Support",
],
)
cc_library(
name = "ComplexToStandard",
srcs = glob([
"lib/Conversion/ComplexToStandard/*.cpp",
"lib/Conversion/ComplexToStandard/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/ComplexToStandard/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ComplexDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MathDialect",
":Pass",
":Transforms",
],
)
exports_files([
"include/mlir/Interfaces/CallInterfaces.h",
"include/mlir/Interfaces/CastInterfaces.h",
"include/mlir/Interfaces/ControlFlowInterfaces.h",
"include/mlir/Transforms/InliningUtils.h",
])
td_library(
name = "ArithOpsTdFiles",
srcs = [
"include/mlir/Dialect/Arith/IR/ArithBase.td",
"include/mlir/Dialect/Arith/IR/ArithOps.td",
],
includes = ["include"],
deps = [
":ArithOpsInterfacesTdFiles",
":BuiltinDialectTdFiles",
":CastInterfacesTdFiles",
2022-06-14 23:45:52 +02:00
":InferIntRangeInterfaceTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":VectorInterfacesTdFiles",
],
)
td_library(
name = "ArithOpsInterfacesTdFiles",
srcs = [
"include/mlir/Dialect/Arith/IR/ArithOpsInterfaces.td",
],
includes = ["include"],
deps = [
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "ArithBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=arith",
],
"include/mlir/Dialect/Arith/IR/ArithOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=arith",
],
"include/mlir/Dialect/Arith/IR/ArithOpsDialect.cpp.inc",
),
(
["-gen-enum-decls"],
"include/mlir/Dialect/Arith/IR/ArithOpsEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Arith/IR/ArithOpsEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Arith/IR/ArithBase.td",
deps = [":ArithOpsTdFiles"],
)
gentbl_cc_library(
name = "ArithOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Arith/IR/ArithOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Arith/IR/ArithOps.cpp.inc",
),
(
[
"-gen-attrdef-decls",
"-attrdefs-dialect=arith",
],
"include/mlir/Dialect/Arith/IR/ArithOpsAttributes.h.inc",
),
(
[
"-gen-attrdef-defs",
"-attrdefs-dialect=arith",
],
"include/mlir/Dialect/Arith/IR/ArithOpsAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Arith/IR/ArithOps.td",
deps = [
":ArithOpsTdFiles",
],
)
gentbl_cc_library(
name = "ArithOpsInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Arith/IR/ArithOpsInterfaces.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Arith/IR/ArithOpsInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Arith/IR/ArithOpsInterfaces.td",
deps = [
":ArithOpsInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "ArithCanonicalizationIncGen",
strip_include_prefix = "include/mlir/Dialect/Arith/IR",
tbl_outs = [
(
["-gen-rewriters"],
"include/mlir/Dialect/Arith/IR/ArithCanonicalization.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "lib/Dialect/Arith/IR/ArithCanonicalization.td",
deps = [
":ArithOpsTdFiles",
":CastInterfacesTdFiles",
":FuncTdFiles",
],
)
cc_library(
name = "ArithDialect",
srcs = [
"lib/Dialect/Arith/IR/ArithDialect.cpp",
"lib/Dialect/Arith/IR/ArithOps.cpp",
"lib/Dialect/Arith/IR/InferIntRangeInterfaceImpls.cpp",
],
hdrs = [
"include/mlir/Dialect/Arith/IR/Arith.h",
"include/mlir/Transforms/InliningUtils.h",
],
includes = ["include"],
deps = [
":ArithBaseIncGen",
":ArithCanonicalizationIncGen",
":ArithOpsIncGen",
":ArithOpsInterfacesIncGen",
":CastInterfaces",
":CommonFolders",
":IR",
":InferIntRangeCommon",
2022-06-14 23:45:52 +02:00
":InferIntRangeInterface",
2022-02-03 01:41:03 +01:00
":InferTypeOpInterface",
":SideEffectInterfaces",
":VectorInterfaces",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ArithPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Arith",
],
"include/mlir/Dialect/Arith/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Arith/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "ArithTransforms",
srcs = glob([
"lib/Dialect/Arith/Transforms/*.cpp",
"lib/Dialect/Arith/Transforms/*.h",
]),
2022-09-09 09:31:13 +02:00
hdrs = glob([
"include/mlir/Dialect/Arith/Transforms/*.h",
2022-09-09 09:31:13 +02:00
]),
includes = ["include"],
deps = [
2022-06-14 23:55:50 +02:00
":Analysis",
":ArithDialect",
":ArithPassIncGen",
":ArithUtils",
":BufferizationDialect",
":BufferizationTransforms",
":FuncDialect",
2022-09-09 09:31:13 +02:00
":FuncTransforms",
":IR",
":InferIntRangeInterface",
":MemRefDialect",
":Pass",
":Support",
":TensorDialect",
":TransformUtils",
":Transforms",
":ValueBoundsOpInterface",
2022-09-09 09:31:13 +02:00
":VectorDialect",
"//llvm:Support",
],
)
2022-02-03 01:41:03 +01:00
cc_library(
name = "ArithUtils",
2022-02-03 01:41:03 +01:00
srcs = glob([
"lib/Dialect/Arith/Utils/*.cpp",
2022-02-03 01:41:03 +01:00
]),
hdrs = ["include/mlir/Dialect/Arith/Utils/Utils.h"],
2022-02-03 01:41:03 +01:00
includes = ["include"],
deps = [
":ArithDialect",
2023-07-18 09:20:13 +02:00
":ComplexDialect",
2022-02-03 01:41:03 +01:00
":IR",
"//llvm:Support",
2022-02-03 01:41:03 +01:00
],
)
td_library(
name = "MathOpsTdFiles",
srcs = [
"include/mlir/Dialect/Math/IR/MathBase.td",
"include/mlir/Dialect/Math/IR/MathOps.td",
],
includes = ["include"],
deps = [
2022-11-04 19:06:44 +01:00
":ArithOpsTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
":VectorInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "MathBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=math",
],
"include/mlir/Dialect/Math/IR/MathOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=math",
],
"include/mlir/Dialect/Math/IR/MathOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Math/IR/MathBase.td",
deps = [":MathOpsTdFiles"],
)
gentbl_cc_library(
name = "MathOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Math/IR/MathOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Math/IR/MathOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Math/IR/MathOps.td",
deps = [":MathOpsTdFiles"],
)
gentbl_cc_library(
name = "MathPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Math",
],
"include/mlir/Dialect/Math/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Math/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "MathDialect",
srcs = glob(
[
"lib/Dialect/Math/IR/*.cpp",
"lib/Dialect/Math/IR/*.h",
],
),
hdrs = [
"include/mlir/Dialect/Math/IR/Math.h",
],
includes = ["include"],
deps = [
":ArithDialect",
":CommonFolders",
":IR",
2022-04-28 22:51:27 +02:00
":InferTypeOpInterface",
":MathBaseIncGen",
":MathOpsIncGen",
":SideEffectInterfaces",
":VectorInterfaces",
"//llvm:Support",
],
)
cc_library(
name = "MathTransforms",
srcs = glob([
"lib/Dialect/Math/Transforms/*.cpp",
"lib/Dialect/Math/Transforms/*.h",
]),
hdrs = glob(["include/mlir/Dialect/Math/Transforms/*.h"]),
includes = ["include"],
deps = [
":ArithDialect",
":DialectUtils",
":IR",
":MathDialect",
":MathPassIncGen",
":Pass",
":SCFDialect",
":Transforms",
":VectorDialect",
":VectorUtils",
":X86VectorDialect",
"//llvm:Support",
],
)
cc_library(
name = "MathToLibm",
srcs = glob([
"lib/Conversion/MathToLibm/*.cpp",
"lib/Conversion/MathToLibm/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/MathToLibm/*.h",
]),
includes = ["include"],
deps = [
":ArithDialect",
":ConversionPassIncGen",
":DialectUtils",
":FuncDialect",
":IR",
":LLVMDialect",
":MathDialect",
":Pass",
":Support",
":Transforms",
":VectorDialect",
":VectorUtils",
"//llvm:Core",
"//llvm:Support",
],
)
td_library(
name = "MemRefOpsTdFiles",
srcs = [
"include/mlir/Dialect/MemRef/IR/MemRefBase.td",
"include/mlir/Dialect/MemRef/IR/MemRefOps.td",
],
includes = ["include"],
deps = [
":ArithOpsTdFiles",
":CastInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":CopyOpInterfaceTdFiles",
":MemorySlotInterfacesTdFiles",
":OpBaseTdFiles",
":ShapedOpInterfacesTdFiles",
":SideEffectInterfacesTdFiles",
":ViewLikeInterfaceTdFiles",
],
)
gentbl_cc_library(
name = "MemRefBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=memref",
],
"include/mlir/Dialect/MemRef/IR/MemRefOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=memref",
],
"include/mlir/Dialect/MemRef/IR/MemRefOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MemRef/IR/MemRefBase.td",
deps = [":MemRefOpsTdFiles"],
)
gentbl_cc_library(
name = "MemRefOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/MemRef/IR/MemRefOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/MemRef/IR/MemRefOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MemRef/IR/MemRefOps.td",
deps = [
":MemRefOpsTdFiles",
],
)
cc_library(
name = "MemRefDialect",
srcs = glob(
[
"lib/Dialect/MemRef/IR/*.cpp",
"lib/Dialect/MemRef/IR/*.h",
],
),
hdrs = [
"include/mlir/Dialect/MemRef/IR/MemRef.h",
"include/mlir/Dialect/MemRef/IR/MemRefMemorySlot.h",
"include/mlir/Dialect/MemRef/IR/ValueBoundsOpInterfaceImpl.h",
],
includes = ["include"],
deps = [
":ArithDialect",
":ArithUtils",
":CastInterfaces",
":ComplexDialect",
":ControlFlowInterfaces",
":CopyOpInterface",
":DialectUtils",
":IR",
":InferTypeOpInterface",
":MemRefBaseIncGen",
":MemRefOpsIncGen",
":MemorySlotInterfaces",
":ShapedOpInterfaces",
":Support",
":ValueBoundsOpInterface",
":ViewLikeInterface",
"//llvm:Support",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
cc_library(
name = "MemRefUtils",
srcs = glob(
[
"lib/Dialect/MemRef/Utils/*.cpp",
],
),
hdrs = [
"include/mlir/Dialect/MemRef/Utils/MemRefUtils.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":ArithUtils",
":MemRefDialect",
],
)
gentbl_cc_library(
name = "MemRefPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=MemRef",
],
"include/mlir/Dialect/MemRef/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MemRef/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "MemRefTransforms",
srcs = glob(
[
"lib/Dialect/MemRef/Transforms/*.cpp",
"lib/Dialect/MemRef/Transforms/*.h",
],
),
hdrs = glob(["include/mlir/Dialect/MemRef/Transforms/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":AffineTransforms",
":AffineUtils",
":ArithDialect",
":ArithTransforms",
":ArithUtils",
":BufferizationDialect",
":ControlFlowDialect",
":DialectUtils",
":FuncDialect",
":GPUDialect",
":IR",
":InferTypeOpInterface",
":LoopLikeInterface",
":MemRefDialect",
":MemRefPassIncGen",
":MemRefUtils",
":NVGPUDialect",
":Pass",
":RuntimeVerifiableOpInterface",
":Support",
":TensorDialect",
":Transforms",
":ValueBoundsOpInterface",
":VectorDialect",
"//llvm:Support",
],
)
td_library(
name = "MemRefTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.td",
],
includes = ["include"],
deps = [
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "MemRefTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MemRef/TransformOps/MemRefTransformOps.td",
deps = [
":MemRefTransformOpsTdFiles",
],
)
cc_library(
name = "MemRefTransformOps",
srcs = glob(["lib/Dialect/MemRef/TransformOps/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/MemRef/TransformOps/*.h"]),
includes = ["include"],
deps = [
":AffineDialect",
":ArithDialect",
":IR",
":LoopLikeInterface",
":MemRefDialect",
":MemRefTransformOpsIncGen",
":MemRefTransforms",
":NVGPUDialect",
":SCFDialect",
":TransformDialect",
":TransformUtils",
":VectorDialect",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# MLProgram dialect
##---------------------------------------------------------------------------##
td_library(
name = "MLProgramOpsTdFiles",
srcs = [
"include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td",
"include/mlir/Dialect/MLProgram/IR/MLProgramBase.td",
"include/mlir/Dialect/MLProgram/IR/MLProgramOps.td",
"include/mlir/Dialect/MLProgram/IR/MLProgramTypes.td",
],
includes = ["include"],
deps = [
":BuiltinDialectTdFiles",
":CallInterfacesTdFiles",
":ControlFlowInterfacesTdFiles",
":FunctionInterfacesTdFiles",
":OpBaseTdFiles",
":RegionKindInterfaceIncGen",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "MLProgramOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/MLProgram/IR/MLProgramOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/MLProgram/IR/MLProgramOps.cpp.inc",
),
(
["-gen-dialect-decls"],
"include/mlir/Dialect/MLProgram/IR/MLProgramOpsDialect.h.inc",
),
(
["-gen-dialect-defs"],
"include/mlir/Dialect/MLProgram/IR/MLProgramOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MLProgram/IR/MLProgramOps.td",
deps = [":MLProgramOpsTdFiles"],
)
gentbl_cc_library(
name = "MLProgramAttributesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-attrdef-decls"],
"include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.h.inc",
),
(
["-gen-attrdef-defs"],
"include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MLProgram/IR/MLProgramAttributes.td",
deps = [":MLProgramOpsTdFiles"],
)
gentbl_cc_library(
name = "MLProgramTypesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-typedef-decls"],
"include/mlir/Dialect/MLProgram/IR/MLProgramTypes.h.inc",
),
(
["-gen-typedef-defs"],
"include/mlir/Dialect/MLProgram/IR/MLProgramTypes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/MLProgram/IR/MLProgramTypes.td",
deps = [":MLProgramOpsTdFiles"],
)
cc_library(
name = "MLProgramDialect",
srcs = glob([
"lib/Dialect/MLProgram/IR/*.cpp",
"lib/Dialect/MLProgram/IR/*.h",
]),
hdrs = glob([
"include/mlir/Dialect/MLProgram/IR/*.h",
]),
includes = ["include"],
deps = [
":ControlFlowInterfaces",
":IR",
":MLProgramAttributesIncGen",
":MLProgramOpsIncGen",
":MLProgramTypesIncGen",
":Pass",
":Support",
"//llvm:Support",
],
)
##---------------------------------------------------------------------------##
# Allocation interfaces
##---------------------------------------------------------------------------##
td_library(
name = "AllocationOpInterfaceTdFiles",
srcs = ["include/mlir/Dialect/Bufferization/IR/AllocationOpInterface.td"],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "AllocationOpInterfaceIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-interface-decls"],
"include/mlir/Dialect/Bufferization/IR/AllocationOpInterface.h.inc",
),
(
["-gen-op-interface-defs"],
"include/mlir/Dialect/Bufferization/IR/AllocationOpInterface.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/IR/AllocationOpInterface.td",
deps = [":AllocationOpInterfaceTdFiles"],
)
cc_library(
name = "AllocationOpInterface",
srcs = ["lib/Dialect/Bufferization/IR/AllocationOpInterface.cpp"],
hdrs = ["include/mlir/Dialect/Bufferization/IR/AllocationOpInterface.h"],
includes = ["include"],
deps = [
":AllocationOpInterfaceIncGen",
":IR",
],
)
td_library(
name = "BufferizationOpsTdFiles",
srcs = [
"include/mlir/Dialect/Bufferization/IR/BufferizationBase.td",
"include/mlir/Dialect/Bufferization/IR/BufferizationEnums.td",
"include/mlir/Dialect/Bufferization/IR/BufferizationOps.td",
],
includes = ["include"],
deps = [
":AllocationOpInterfaceTdFiles",
":CopyOpInterfaceTdFiles",
":InferTypeOpInterfaceTdFiles",
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "BufferizationBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=bufferization",
],
"include/mlir/Dialect/Bufferization/IR/BufferizationOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=bufferization",
],
"include/mlir/Dialect/Bufferization/IR/BufferizationOpsDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/IR/BufferizationBase.td",
deps = [":BufferizationOpsTdFiles"],
)
2022-11-15 07:48:51 +01:00
td_library(
name = "BufferizationEnumsTdFiles",
srcs = [
"include/mlir/Dialect/Bufferization/IR/BufferizationEnums.td",
],
includes = ["include"],
deps = [
":OpBaseTdFiles",
],
)
gentbl_cc_library(
name = "BufferizationEnumsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-enum-decls"],
"include/mlir/Dialect/Bufferization/IR/BufferizationEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/mlir/Dialect/Bufferization/IR/BufferizationEnums.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/IR/BufferizationEnums.td",
2022-11-15 07:48:51 +01:00
deps = [":BufferizationEnumsTdFiles"],
)
td_library(
name = "BufferizationTransformOpsTdFiles",
srcs = [
"include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.td",
],
includes = ["include"],
deps = [
":BufferizationOpsTdFiles",
":TransformDialectTdFiles",
],
)
gentbl_cc_library(
name = "BufferizationTransformOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.td",
deps = [
":BufferizationTransformOpsTdFiles",
],
)
cc_library(
name = "BufferizationTransformOps",
srcs = [
"lib/Dialect/Bufferization/TransformOps/BufferizationTransformOps.cpp",
],
hdrs = [
"include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.h",
],
includes = ["include"],
deps = [
":BufferizationDialect",
":BufferizationEnumsIncGen",
":BufferizationTransformOpsIncGen",
":BufferizationTransforms",
":IR",
":LinalgDialect",
":MemRefDialect",
":Parser",
":SideEffectInterfaces",
":TensorDialect",
":TransformDialect",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "BufferizationOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["-gen-op-decls"],
"include/mlir/Dialect/Bufferization/IR/BufferizationOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/Bufferization/IR/BufferizationOps.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/IR/BufferizationOps.td",
deps = [
":BufferizableOpInterfaceTdFiles",
":BufferizationOpsTdFiles",
],
)
cc_library(
name = "BufferizationDialect",
srcs = [
"lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp",
"lib/Dialect/Bufferization/IR/BufferizationDialect.cpp",
"lib/Dialect/Bufferization/IR/BufferizationOps.cpp",
],
hdrs = [
"include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h",
"include/mlir/Dialect/Bufferization/IR/Bufferization.h",
"include/mlir/Dialect/Bufferization/IR/DstBufferizableOpInterfaceImpl.h",
],
includes = ["include"],
deps = [
":AffineDialect",
":AllocationOpInterface",
":ArithDialect",
":BufferizableOpInterfaceIncGen",
":BufferizationBaseIncGen",
":BufferizationEnumsIncGen",
":BufferizationOpsIncGen",
":ControlFlowInterfaces",
":CopyOpInterface",
":DestinationStyleOpInterface",
":FuncDialect",
":IR",
":InferTypeOpInterface",
":MemRefDialect",
":SparseTensorDialect",
":Support",
":TensorDialect",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "BufferizationPassIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Bufferization",
],
"include/mlir/Dialect/Bufferization/Transforms/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/Bufferization/Transforms/Passes.td",
deps = [":PassBaseTdFiles"],
)
cc_library(
name = "BufferizationTransforms",
srcs = glob(
[
"lib/Dialect/Bufferization/Transforms/*.cpp",
"lib/Dialect/Bufferization/Transforms/*.h",
],
),
hdrs = glob(["include/mlir/Dialect/Bufferization/Transforms/*.h"]),
includes = ["include"],
deps = [
":AllocationOpInterface",
":Analysis",
":ArithDialect",
":BufferizationDialect",
2022-11-15 07:48:51 +01:00
":BufferizationEnumsIncGen",
":BufferizationPassIncGen",
":ControlFlowInterfaces",
":FuncDialect",
":IR",
":LoopLikeInterface",
":MemRefDialect",
":MemRefUtils",
":Pass",
":SideEffectInterfaces",
":TensorDialect",
":Transforms",
":ViewLikeInterface",
"//llvm:Support",
],
)
cc_library(
name = "BufferizationToMemRef",
srcs = [
"lib/Conversion/BufferizationToMemRef/BufferizationToMemRef.cpp",
],
hdrs = [
"include/mlir/Conversion/BufferizationToMemRef/BufferizationToMemRef.h",
],
includes = ["include"],
deps = [
":ArithDialect",
":BufferizationDialect",
":ConversionPassIncGen",
":FuncDialect",
":IR",
":MemRefDialect",
":Pass",
":SCFDialect",
":Support",
":Transforms",
],
)
td_library(
name = "DLTIDialectTdFiles",
srcs = [
"include/mlir/Dialect/DLTI/DLTI.td",
"include/mlir/Dialect/DLTI/DLTIBase.td",
],
includes = ["include"],
deps = [":OpBaseTdFiles"],
)
gentbl_cc_library(
name = "DLTIBaseIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=dlti",
],
"include/mlir/Dialect/DLTI/DLTIDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=dlti",
],
"include/mlir/Dialect/DLTI/DLTIDialect.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/DLTI/DLTIBase.td",
deps = [":OpBaseTdFiles"],
)
cc_library(
name = "DLTIDialect",
srcs = glob(["lib/Dialect/DLTI/*.cpp"]),
hdrs = glob(["include/mlir/Dialect/DLTI/*.h"]),
includes = ["include"],
deps = [
":DLTIBaseIncGen",
":DataLayoutInterfaces",
":IR",
"//llvm:Support",
],
)
gentbl_cc_library(
name = "ReducerIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-pass-decls",
"-name=Reducer",
],
"include/mlir/Reducer/Passes.h.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Reducer/Passes.td",
deps = [
":PassBaseTdFiles",
":ReducerTdFiles",
],
)
cc_library(
name = "Reducer",
srcs = glob(["lib/Reducer/*.cpp"]),
hdrs = glob(["include/mlir/Reducer/*.h"]),
includes = ["include"],
deps = [
":IR",
":Pass",
":ReducerIncGen",
":Rewrite",
":Support",
":TransformUtils",
"//llvm:Support",
],
)
cc_library(
name = "MlirReduceLib",
srcs = ["lib/Tools/mlir-reduce/MlirReduceMain.cpp"],
hdrs = [
"include/mlir/Tools/ParseUtilities.h",
"include/mlir/Tools/mlir-reduce/MlirReduceMain.h",
],
includes = ["include"],
deps = [
":IR",
":Parser",
":Pass",
":Reducer",
":Rewrite",
":Support",
"//llvm:Support",
],
)
cc_binary(
name = "mlir-reduce",
srcs = ["tools/mlir-reduce/mlir-reduce.cpp"],
includes = ["include"],
local_defines = ["MLIR_INCLUDE_TESTS"],
stamp = 0,
deps = [
":AllPassesAndDialects",
":IR",
":MlirReduceLib",
"//llvm:Support",
"//mlir/test:TestDialect",
],
)
cc_library(
name = "PDLLODS",
srcs = glob(
[
"lib/Tools/PDLL/ODS/*.cpp",
"lib/Tools/PDLL/ODS/*.h",
],
),
hdrs = glob(["include/mlir/Tools/PDLL/ODS/*.h"]),
includes = ["include"],
deps = [
":Support",
"//llvm:Support",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
cc_library(
name = "PDLLAST",
srcs = glob(
[
"lib/Tools/PDLL/AST/*.cpp",
"lib/Tools/PDLL/AST/*.h",
],
),
hdrs = glob(["include/mlir/Tools/PDLL/AST/*.h"]),
includes = ["include"],
deps = [
2022-01-25 12:33:42 +01:00
":Support",
"//llvm:Support",
2022-12-20 20:09:00 +01:00
"//llvm:TargetParser",
],
)
2022-02-27 00:11:42 +01:00
cc_library(
name = "PDLLCodeGen",
srcs = glob(
[
"lib/Tools/PDLL/CodeGen/*.cpp",
"lib/Tools/PDLL/CodeGen/*.h",
],
),
hdrs = glob(["include/mlir/Tools/PDLL/CodeGen/*.h"]),
includes = ["include"],
deps = [
":AsmParser",
2022-02-27 00:11:42 +01:00
":IR",
":PDLDialect",
":PDLLAST",
2022-03-04 04:15:38 +00:00
":PDLLODS",
2022-02-27 00:11:42 +01:00
":Support",
"//llvm:Support",
],
)
cc_library(
name = "PDLLParser",
srcs = glob(
[
"lib/Tools/PDLL/Parser/*.cpp",
"lib/Tools/PDLL/Parser/*.h",
],
),
hdrs = glob(["include/mlir/Tools/PDLL/Parser/*.h"]),
includes = ["include"],
deps = [
":PDLLAST",
":PDLLODS",
":Support",
":TableGen",
"//llvm:Support",
"//llvm:TableGen",
"//llvm:TargetParser",
],
)
cc_binary(
name = "mlir-pdll",
srcs = [
"tools/mlir-pdll/mlir-pdll.cpp",
],
deps = [
2022-02-27 00:11:42 +01:00
":IR",
":PDLLAST",
2022-02-27 00:11:42 +01:00
":PDLLCodeGen",
":PDLLODS",
":PDLLParser",
":Support",
"//llvm:Support",
"//llvm:config",
],
)
cc_binary(
name = "mlir-pdll-lsp-server",
srcs = ["tools/mlir-pdll-lsp-server/mlir-pdll-lsp-server.cpp"],
includes = ["include"],
deps = [
":MlirPdllLspServerLib",
":Support",
],
)
2022-11-08 12:14:32 +01:00
td_library(
name = "DialectConversionPdllFiles",
srcs = ["include/mlir/Transforms/DialectConversion.pdll"],
includes = ["include"],
)
2023-07-20 15:08:19 +02:00
td_library(
name = "UBDialectTdFiles",
srcs = [
"include/mlir/Dialect/UB/IR/UBOps.td",
"include/mlir/Dialect/UB/IR/UBOpsInterfaces.td",
],
includes = ["include"],
deps = [
":OpBaseTdFiles",
":SideEffectInterfacesTdFiles",
],
)
gentbl_cc_library(
name = "UBOpsInterfacesIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
["--gen-attr-interface-decls"],
"include/mlir/Dialect/UB/IR/UBOpsInterfaces.h.inc",
),
(
["--gen-attr-interface-defs"],
"include/mlir/Dialect/UB/IR/UBOpsInterfaces.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/UB/IR/UBOpsInterfaces.td",
deps = [":UBDialectTdFiles"],
)
gentbl_cc_library(
name = "UBOpsIncGen",
strip_include_prefix = "include",
tbl_outs = [
(
[
"-gen-dialect-decls",
"-dialect=ub",
],
"include/mlir/Dialect/UB/IR/UBOpsDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=ub",
],
"include/mlir/Dialect/UB/IR/UBOpsDialect.cpp.inc",
),
(
["-gen-op-decls"],
"include/mlir/Dialect/UB/IR/UBOps.h.inc",
),
(
["-gen-op-defs"],
"include/mlir/Dialect/UB/IR/UBOps.cpp.inc",
),
(
["--gen-attrdef-decls"],
"include/mlir/Dialect/UB/IR/UBOpsAttributes.h.inc",
),
(
["--gen-attrdef-defs"],
"include/mlir/Dialect/UB/IR/UBOpsAttributes.cpp.inc",
),
],
tblgen = ":mlir-tblgen",
td_file = "include/mlir/Dialect/UB/IR/UBOps.td",
deps = [":UBDialectTdFiles"],
)
cc_library(
name = "UBDialect",
srcs = ["lib/Dialect/UB/IR/UBOps.cpp"],
hdrs = ["include/mlir/Dialect/UB/IR/UBOps.h"],
includes = ["include"],
deps = [
":IR",
":SideEffectInterfaces",
":UBOpsIncGen",
":UBOpsInterfacesIncGen",
2023-07-20 17:05:28 +02:00
"//llvm:Support",
2023-07-20 15:08:19 +02:00
],
)
cc_library(
name = "UBToLLVM",
srcs = glob([
"lib/Conversion/UBToLLVM/*.cpp",
"lib/Conversion/UBToLLVM/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/UBToLLVM/*.h",
]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":IR",
":LLVMCommonConversion",
":LLVMDialect",
":Pass",
":UBDialect",
],
)
cc_library(
name = "UBToSPIRV",
srcs = glob([
"lib/Conversion/UBToSPIRV/*.cpp",
"lib/Conversion/UBToSPIRV/*.h",
]),
hdrs = glob([
"include/mlir/Conversion/UBToSPIRV/*.h",
]),
includes = ["include"],
deps = [
":ConversionPassIncGen",
":Pass",
":SPIRVConversion",
":SPIRVDialect",
":UBDialect",
"//llvm:Core",
],
)