[Bazel] Run buildifier (#1250)

Lint all Bazel files (BUILD, WORKSPACE, .bzl, or .sky).

Steps followed:
```shell
./utils/bazel/run_docker.sh

# run within container
git clone https://github.com/bazelbuild/buildtools.git
cd buildtools
bazel build //buildifier
# buildifier formatter
./bazel-bin/buildifier/buildifier_/buildifier -r ../utils/bazel/
# buildifier linter
./bazel-bin/buildifier/buildifier_/buildifier --lint=fix -r ../utils/bazel/
```
pull/1252/head
Sambhav Jain 2022-08-18 22:42:58 -07:00 committed by GitHub
parent 7bd173a1c4
commit 1e1759c2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 228 additions and 228 deletions

View File

@ -3,15 +3,15 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive( http_archive(
name = "bazel_skylib", name = "bazel_skylib",
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
urls = [ urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
], ],
sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
) )
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
@ -26,30 +26,30 @@ new_local_repository(
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps") load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps")
llvm_configure( llvm_configure(
name = "llvm-project", name = "llvm-project",
repo_mapping = { repo_mapping = {
"@python_runtime": "@local_config_python", "@python_runtime": "@local_config_python",
}, },
targets = [ targets = [
"X86", "X86",
] ],
) )
llvm_disable_optional_support_deps() llvm_disable_optional_support_deps()
local_repository( local_repository(
name = "mlir-hlo", name = "mlir-hlo",
path = "../../externals/mlir-hlo/" path = "../../externals/mlir-hlo/",
) )
new_local_repository( new_local_repository(
name = "torch-mlir-raw", name = "torch-mlir-raw",
build_file_content = "# empty", build_file_content = "# empty",
path = "../../" path = "../../",
) )
load("@torch-mlir-raw//utils/bazel:configure.bzl", "torch_mlir_configure") load("@torch-mlir-raw//utils/bazel:configure.bzl", "torch_mlir_configure")
torch_mlir_configure( torch_mlir_configure(
name = "torch-mlir" name = "torch-mlir",
) )

View File

@ -52,5 +52,5 @@ def _torch_mlir_configure_impl(repository_ctx):
torch_mlir_configure = repository_rule( torch_mlir_configure = repository_rule(
implementation = _torch_mlir_configure_impl, implementation = _torch_mlir_configure_impl,
local = True, local = True,
configure = True configure = True,
) )

View File

@ -2,11 +2,11 @@
# See https://llvm.org/LICENSE.txt for license information. # See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "gentbl_filegroup", "td_library") load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
package( package(
default_visibility = [ default_visibility = [
"//visibility:public", "//visibility:public",
], ],
) )
@ -17,16 +17,16 @@ td_library(
"include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td", "include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td",
"include/torch-mlir/Dialect/Torch/IR/TorchBase.td", "include/torch-mlir/Dialect/Torch/IR/TorchBase.td",
"include/torch-mlir/Dialect/Torch/IR/TorchOps.td", "include/torch-mlir/Dialect/Torch/IR/TorchOps.td",
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.td" "include/torch-mlir/Dialect/Torch/IR/TorchTypes.td",
], ],
includes = ["include"], includes = ["include"],
deps = [ deps = [
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:CastInterfacesTdFiles", "@llvm-project//mlir:CastInterfacesTdFiles",
"@llvm-project//mlir:ControlFlowInterfacesTdFiles", "@llvm-project//mlir:ControlFlowInterfacesTdFiles",
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles", "@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles" "@llvm-project//mlir:OpBaseTdFiles",
] "@llvm-project//mlir:SideEffectInterfacesTdFiles",
],
) )
gentbl_cc_library( gentbl_cc_library(
@ -39,28 +39,28 @@ gentbl_cc_library(
), ),
( (
["-gen-op-defs"], ["-gen-op-defs"],
"include/torch-mlir/Dialect/Torch/IR/TorchOps.cpp.inc" "include/torch-mlir/Dialect/Torch/IR/TorchOps.cpp.inc",
), ),
( (
[ [
"-gen-dialect-decls", "-gen-dialect-decls",
"-dialect=torch", "-dialect=torch",
], ],
"include/torch-mlir/Dialect/Torch/IR/TorchDialect.h.inc" "include/torch-mlir/Dialect/Torch/IR/TorchDialect.h.inc",
), ),
( (
[ [
"-gen-dialect-defs", "-gen-dialect-defs",
"-dialect=torch", "-dialect=torch",
], ],
"include/torch-mlir/Dialect/Torch/IR/TorchDialect.cpp.inc" "include/torch-mlir/Dialect/Torch/IR/TorchDialect.cpp.inc",
), ),
], ],
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Dialect/Torch/IR/TorchOps.td", td_file = "include/torch-mlir/Dialect/Torch/IR/TorchOps.td",
deps = [ deps = [
":MLIRTorchOpsIncGenTdFiles" ":MLIRTorchOpsIncGenTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -69,41 +69,41 @@ gentbl_cc_library(
tbl_outs = [ tbl_outs = [
( (
["-gen-typedef-decls"], ["-gen-typedef-decls"],
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.h.inc" "include/torch-mlir/Dialect/Torch/IR/TorchTypes.h.inc",
), ),
( (
["-gen-typedef-defs"], ["-gen-typedef-defs"],
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.cpp.inc" "include/torch-mlir/Dialect/Torch/IR/TorchTypes.cpp.inc",
) ),
], ],
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Dialect/Torch/IR/TorchTypes.td", td_file = "include/torch-mlir/Dialect/Torch/IR/TorchTypes.td",
deps = [ deps = [
":MLIRTorchOpsIncGenTdFiles" ":MLIRTorchOpsIncGenTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTorchDialectUtils", name = "TorchMLIRTorchDialectUtils",
srcs = [ srcs = [
"lib/Dialect/Torch/Utils/TorchUpstream.cpp",
"lib/Dialect/Torch/Utils/Utils.cpp", "lib/Dialect/Torch/Utils/Utils.cpp",
"lib/Dialect/Torch/Utils/TorchUpstream.cpp"
], ],
strip_include_prefix = "include",
hdrs = [ hdrs = [
"include/torch-mlir/Dialect/Torch/Utils/Utils.h",
"include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h",
"include/torch-mlir/Dialect/Torch/IR/TorchOps.h", "include/torch-mlir/Dialect/Torch/IR/TorchOps.h",
"include/torch-mlir/Dialect/Torch/IR/TorchTraits.h", "include/torch-mlir/Dialect/Torch/IR/TorchTraits.h",
"include/torch-mlir/Dialect/Torch/IR/TorchTypes.h" "include/torch-mlir/Dialect/Torch/IR/TorchTypes.h",
"include/torch-mlir/Dialect/Torch/Utils/TorchUpstream.h",
"include/torch-mlir/Dialect/Torch/Utils/Utils.h",
], ],
strip_include_prefix = "include",
deps = [ deps = [
":MLIRTorchOpsIncGen", ":MLIRTorchOpsIncGen",
":MLIRTorchTypesIncGen", ":MLIRTorchTypesIncGen",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:ControlFlowInterfaces", "@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:InferTypeOpInterface", "@llvm-project//mlir:InferTypeOpInterface",
] ],
) )
cc_library( cc_library(
@ -111,10 +111,10 @@ cc_library(
srcs = [ srcs = [
"lib/Dialect/Torch/IR/TorchDialect.cpp", "lib/Dialect/Torch/IR/TorchDialect.cpp",
"lib/Dialect/Torch/IR/TorchOps.cpp", "lib/Dialect/Torch/IR/TorchOps.cpp",
"lib/Dialect/Torch/IR/TorchTypes.cpp",
"lib/Dialect/Torch/IR/TorchOpsODSGenerated.cpp", "lib/Dialect/Torch/IR/TorchOpsODSGenerated.cpp",
"lib/Dialect/Torch/IR/TorchTypes.cpp",
"lib/Dialect/Torch/IR/UtilsForODSGenerated.cpp", "lib/Dialect/Torch/IR/UtilsForODSGenerated.cpp",
"lib/Dialect/Torch/IR/UtilsForODSGenerated.h" "lib/Dialect/Torch/IR/UtilsForODSGenerated.h",
], ],
hdrs = glob([ hdrs = glob([
"include/torch-mlir/Dialect/Torch/IR/*.h", "include/torch-mlir/Dialect/Torch/IR/*.h",
@ -124,24 +124,24 @@ cc_library(
":MLIRTorchOpsIncGen", ":MLIRTorchOpsIncGen",
":MLIRTorchTypesIncGen", ":MLIRTorchTypesIncGen",
":TorchMLIRTorchDialectUtils", ":TorchMLIRTorchDialectUtils",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:ControlFlowInterfaces", "@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:InferTypeOpInterface", "@llvm-project//mlir:InferTypeOpInterface",
"@llvm-project//mlir:TransformUtils", "@llvm-project//mlir:TransformUtils",
"@llvm-project//mlir:FuncDialect" ],
]
) )
# Torch Dialect/Transforms # Torch Dialect/Transforms
td_library( td_library(
name = "TorchMLIRTorchPassesTdFiles", name = "TorchMLIRTorchPassesTdFiles",
srcs = [ srcs = [
"include/torch-mlir/Dialect/Torch/Transforms/Passes.td" "include/torch-mlir/Dialect/Torch/Transforms/Passes.td",
], ],
includes = ["include"], includes = ["include"],
deps = [ deps = [
"@llvm-project//mlir:OpBaseTdFiles", "@llvm-project//mlir:OpBaseTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -151,18 +151,16 @@ gentbl_cc_library(
( (
["-gen-pass-decls"], ["-gen-pass-decls"],
"include/torch-mlir/Dialect/Torch/Transforms/Passes.h.inc", "include/torch-mlir/Dialect/Torch/Transforms/Passes.h.inc",
) ),
], ],
td_file = "include/torch-mlir/Dialect/Torch/Transforms/Passes.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Dialect/Torch/Transforms/Passes.td",
deps = [ deps = [
":TorchMLIRTorchPassesTdFiles", ":TorchMLIRTorchPassesTdFiles",
"@llvm-project//mlir:PassBaseTdFiles", "@llvm-project//mlir:PassBaseTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTorchPasses", name = "TorchMLIRTorchPasses",
srcs = [ srcs = [
@ -174,6 +172,7 @@ cc_library(
"lib/Dialect/Torch/Transforms/InlineGlobalSlots.cpp", "lib/Dialect/Torch/Transforms/InlineGlobalSlots.cpp",
"lib/Dialect/Torch/Transforms/LowerToBackendContract.cpp", "lib/Dialect/Torch/Transforms/LowerToBackendContract.cpp",
"lib/Dialect/Torch/Transforms/MaximizeValueSemantics.cpp", "lib/Dialect/Torch/Transforms/MaximizeValueSemantics.cpp",
"lib/Dialect/Torch/Transforms/PassDetail.h",
"lib/Dialect/Torch/Transforms/Passes.cpp", "lib/Dialect/Torch/Transforms/Passes.cpp",
"lib/Dialect/Torch/Transforms/PrepareForGlobalizeObjectGraph.cpp", "lib/Dialect/Torch/Transforms/PrepareForGlobalizeObjectGraph.cpp",
"lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp", "lib/Dialect/Torch/Transforms/ReduceOpVariants.cpp",
@ -182,7 +181,6 @@ cc_library(
"lib/Dialect/Torch/Transforms/ReifyShapeCalculations.cpp", "lib/Dialect/Torch/Transforms/ReifyShapeCalculations.cpp",
"lib/Dialect/Torch/Transforms/ShapeLibrary.cpp", "lib/Dialect/Torch/Transforms/ShapeLibrary.cpp",
"lib/Dialect/Torch/Transforms/SimplifyShapeCalculations.cpp", "lib/Dialect/Torch/Transforms/SimplifyShapeCalculations.cpp",
"lib/Dialect/Torch/Transforms/PassDetail.h",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Dialect/Torch/Transforms/Passes.h", "include/torch-mlir/Dialect/Torch/Transforms/Passes.h",
@ -191,12 +189,12 @@ cc_library(
deps = [ deps = [
":TorchMLIRTorchDialect", ":TorchMLIRTorchDialect",
":TorchMLIRTorchPassesIncGen", ":TorchMLIRTorchPassesIncGen",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Parser",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Transforms", "@llvm-project//mlir:Transforms",
"@llvm-project//mlir:Parser" ],
]
) )
# TorchConversion diaelct # TorchConversion diaelct
@ -210,12 +208,12 @@ td_library(
deps = [ deps = [
":MLIRTorchOpsIncGenTdFiles", ":MLIRTorchOpsIncGenTdFiles",
"@llvm-project//mlir:AttrTdFiles", "@llvm-project//mlir:AttrTdFiles",
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:CastInterfacesTdFiles", "@llvm-project//mlir:CastInterfacesTdFiles",
"@llvm-project//mlir:ControlFlowInterfacesTdFiles", "@llvm-project//mlir:ControlFlowInterfacesTdFiles",
"@llvm-project//mlir:InferTypeOpInterfaceTdFiles", "@llvm-project//mlir:InferTypeOpInterfaceTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles" "@llvm-project//mlir:OpBaseTdFiles",
] "@llvm-project//mlir:SideEffectInterfacesTdFiles",
],
) )
gentbl_cc_library( gentbl_cc_library(
@ -228,28 +226,28 @@ gentbl_cc_library(
), ),
( (
["-gen-op-defs"], ["-gen-op-defs"],
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.cpp.inc" "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.cpp.inc",
), ),
( (
[ [
"-gen-dialect-decls", "-gen-dialect-decls",
"-dialect=torch_c", "-dialect=torch_c",
], ],
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.h.inc" "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.h.inc",
), ),
( (
[ [
"-gen-dialect-defs", "-gen-dialect-defs",
"-dialect=torch_c", "-dialect=torch_c",
], ],
"include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.cpp.inc" "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionDialect.cpp.inc",
), ),
], ],
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.td", td_file = "include/torch-mlir/Dialect/TorchConversion/IR/TorchConversionOps.td",
deps = [ deps = [
":MLIRTorchConversionOpsTdFiles" ":MLIRTorchConversionOpsTdFiles",
] ],
) )
cc_library( cc_library(
@ -267,17 +265,17 @@ cc_library(
":MLIRTorchConversionOpsIncGen", ":MLIRTorchConversionOpsIncGen",
":TorchMLIRTorchDialect", ":TorchMLIRTorchDialect",
"@llvm-project//mlir:IR", "@llvm-project//mlir:IR",
"@llvm-project//mlir:InferTypeOpInterface" "@llvm-project//mlir:InferTypeOpInterface",
] ],
) )
# Conversion # Conversion
td_library( td_library(
name = "TorchMLIRConversionPassesTdFiles", name = "TorchMLIRConversionPassesTdFiles",
includes = ["include"],
srcs = [ srcs = [
"include/torch-mlir/Conversion/Passes.td" "include/torch-mlir/Conversion/Passes.td",
] ],
includes = ["include"],
) )
gentbl_cc_library( gentbl_cc_library(
@ -285,28 +283,32 @@ gentbl_cc_library(
strip_include_prefix = "include", strip_include_prefix = "include",
tbl_outs = [ tbl_outs = [
( (
["-gen-pass-decls", "-DTORCH_MLIR_ENABLE_MHLO"], [
"-gen-pass-decls",
"-DTORCH_MLIR_ENABLE_MHLO",
],
"include/torch-mlir/Conversion/Passes.h.inc", "include/torch-mlir/Conversion/Passes.h.inc",
) ),
], ],
td_file = "include/torch-mlir/Conversion/Passes.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Conversion/Passes.td",
deps = [ deps = [
":TorchMLIRConversionPassesTdFiles", ":TorchMLIRConversionPassesTdFiles",
"@llvm-project//mlir:PassBaseTdFiles", "@llvm-project//mlir:PassBaseTdFiles",
] ],
) )
# TorchConversion transforms # TorchConversion transforms
td_library( td_library(
name = "TorchMLIRTorchConversionPassesTdFiles", name = "TorchMLIRTorchConversionPassesTdFiles",
srcs = [ srcs = [
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td" "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td",
], ],
deps = [ deps = [
"@llvm-project//mlir:OpBaseTdFiles", "@llvm-project//mlir:OpBaseTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
name = "TorchMLIRTorchConversionPassesIncGen", name = "TorchMLIRTorchConversionPassesIncGen",
strip_include_prefix = "include", strip_include_prefix = "include",
@ -314,42 +316,44 @@ gentbl_cc_library(
( (
["-gen-pass-decls"], ["-gen-pass-decls"],
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h.inc", "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h.inc",
) ),
], ],
td_file = "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.td",
deps = [ deps = [
":TorchMLIRTorchConversionPassesTdFiles", ":TorchMLIRTorchConversionPassesTdFiles",
"@llvm-project//mlir:PassBaseTdFiles", "@llvm-project//mlir:PassBaseTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRConversionUtils", name = "TorchMLIRConversionUtils",
srcs = [ srcs = [
"lib/Conversion/Utils/Utils.cpp" "lib/Conversion/Utils/Utils.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/Utils/Utils.h" "include/torch-mlir/Conversion/Utils/Utils.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchDialect", ":TorchMLIRTorchDialect",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:ArithmeticDialect", "@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:ControlFlowDialect", "@llvm-project//mlir:ControlFlowDialect",
"@llvm-project//mlir:LinalgDialect" "@llvm-project//mlir:IR",
] "@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Transforms",
],
) )
cc_library( cc_library(
name = "TorchMLIRTorchToLinalg", name = "TorchMLIRTorchToLinalg",
srcs = [ srcs = [
"lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToLinalg/DataMovement.cpp", "lib/Conversion/TorchToLinalg/DataMovement.cpp",
"lib/Conversion/TorchToLinalg/IndirectDataMovement.cpp", "lib/Conversion/TorchToLinalg/IndirectDataMovement.cpp",
"lib/Conversion/TorchToLinalg/Linear.cpp", "lib/Conversion/TorchToLinalg/Linear.cpp",
"lib/Conversion/TorchToLinalg/Pooling.cpp", "lib/Conversion/TorchToLinalg/Pooling.cpp",
"lib/Conversion/TorchToLinalg/PopulatePatterns.h",
"lib/Conversion/TorchToLinalg/Random.cpp", "lib/Conversion/TorchToLinalg/Random.cpp",
"lib/Conversion/TorchToLinalg/Reduction.cpp", "lib/Conversion/TorchToLinalg/Reduction.cpp",
"lib/Conversion/TorchToLinalg/TensorConstructors.cpp", "lib/Conversion/TorchToLinalg/TensorConstructors.cpp",
@ -358,234 +362,230 @@ cc_library(
"lib/Conversion/TorchToLinalg/Uncategorized.cpp", "lib/Conversion/TorchToLinalg/Uncategorized.cpp",
"lib/Conversion/TorchToLinalg/Utils.cpp", "lib/Conversion/TorchToLinalg/Utils.cpp",
"lib/Conversion/TorchToLinalg/Utils.h", "lib/Conversion/TorchToLinalg/Utils.h",
"lib/Conversion/TorchToLinalg/PopulatePatterns.h",
"lib/Conversion/PassDetail.h",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToLinalg/TorchToLinalg.h" "include/torch-mlir/Conversion/TorchToLinalg/TorchToLinalg.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRConversionPassesIncGen",
":TorchMLIRConversionUtils", ":TorchMLIRConversionUtils",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchDialect",
":TorchMLIRConversionPassesIncGen",
":TorchMLIRTorchConversionDialect", ":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:Pass", ":TorchMLIRTorchDialect",
"@llvm-project//mlir:ArithmeticDialect", "@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:ControlFlowDialect", "@llvm-project//mlir:ControlFlowDialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Dialect", "@llvm-project//mlir:Dialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:TensorUtils", "@llvm-project//mlir:TensorUtils",
"@llvm-project//mlir:TransformUtils" "@llvm-project//mlir:TransformUtils",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTorchToSCF", name = "TorchMLIRTorchToSCF",
srcs = [ srcs = [
"lib/Conversion/TorchToSCF/TorchToSCF.cpp",
"lib/Conversion/PassDetail.h", "lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToSCF/TorchToSCF.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToSCF/TorchToSCF.h" "include/torch-mlir/Conversion/TorchToSCF/TorchToSCF.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRConversionPassesIncGen",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect", ":TorchMLIRTorchConversionDialect",
":TorchMLIRConversionPassesIncGen",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:ArithmeticDialect", "@llvm-project//mlir:ArithmeticDialect",
"@llvm-project//mlir:ControlFlowDialect", "@llvm-project//mlir:ControlFlowDialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Dialect", "@llvm-project//mlir:Dialect",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:TensorUtils", "@llvm-project//mlir:TensorUtils",
"@llvm-project//mlir:TransformUtils" "@llvm-project//mlir:TransformUtils",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTorchToArith", name = "TorchMLIRTorchToArith",
srcs = [ srcs = [
"lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToArith/TorchToArith.cpp", "lib/Conversion/TorchToArith/TorchToArith.cpp",
"lib/Conversion/PassDetail.h"
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToArith/TorchToArith.h" "include/torch-mlir/Conversion/TorchToArith/TorchToArith.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect",
":TorchMLIRConversionPassesIncGen", ":TorchMLIRConversionPassesIncGen",
":TorchMLIRConversionUtils", ":TorchMLIRConversionUtils",
"@llvm-project//mlir:Dialect" ":TorchMLIRTorchBackendTypeConversion",
] ":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:Dialect",
],
) )
cc_library( cc_library(
name = "TorchMLIRTorchToTMTensor", name = "TorchMLIRTorchToTMTensor",
srcs = [ srcs = [
"lib/Conversion/TorchToTMTensor/TorchToTMTensor.cpp",
"lib/Conversion/PassDetail.h", "lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToTMTensor/TorchToTMTensor.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToTMTensor/TorchToTMTensor.h" "include/torch-mlir/Conversion/TorchToTMTensor/TorchToTMTensor.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRConversionPassesIncGen",
":TorchMLIRConversionUtils",
":TorchMLIRTMTensorDialect",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect", ":TorchMLIRTorchConversionDialect",
":TorchMLIRConversionPassesIncGen", "@llvm-project//mlir:LinalgDialect",
":TorchMLIRTMTensorDialect", ],
":TorchMLIRConversionUtils",
"@llvm-project//mlir:LinalgDialect"
]
) )
cc_library( cc_library(
name = "TorchMLIRTorchToMhlo", name = "TorchMLIRTorchToMhlo",
srcs = [ srcs = [
"lib/Conversion/TorchToMhlo/TorchToMhlo.cpp", "lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToMhlo/MhloLegalizeUtils.cpp",
"lib/Conversion/TorchToMhlo/Basic.cpp", "lib/Conversion/TorchToMhlo/Basic.cpp",
"lib/Conversion/TorchToMhlo/Gather.cpp", "lib/Conversion/TorchToMhlo/Gather.cpp",
"lib/Conversion/TorchToMhlo/Linear.cpp", "lib/Conversion/TorchToMhlo/Linear.cpp",
"lib/Conversion/TorchToMhlo/ViewLike.cpp", "lib/Conversion/TorchToMhlo/MhloLegalizeUtils.cpp",
"lib/Conversion/TorchToMhlo/Reduction.cpp",
"lib/Conversion/TorchToMhlo/Pooling.cpp",
"lib/Conversion/TorchToMhlo/MhloLegalizeUtils.h", "lib/Conversion/TorchToMhlo/MhloLegalizeUtils.h",
"lib/Conversion/TorchToMhlo/Pooling.cpp",
"lib/Conversion/TorchToMhlo/PopulatePatterns.h", "lib/Conversion/TorchToMhlo/PopulatePatterns.h",
"lib/Conversion/PassDetail.h", "lib/Conversion/TorchToMhlo/Reduction.cpp",
"lib/Conversion/TorchToMhlo/TorchToMhlo.cpp",
"lib/Conversion/TorchToMhlo/ViewLike.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToMhlo/TorchToMhlo.h" "include/torch-mlir/Conversion/TorchToMhlo/TorchToMhlo.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRConversionPassesIncGen", ":TorchMLIRConversionPassesIncGen",
":TorchMLIRTorchConversionDialect",
":TorchMLIRConversionUtils", ":TorchMLIRConversionUtils",
":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:Dialect",
"@mlir-hlo//:mlir_hlo", "@mlir-hlo//:mlir_hlo",
"@llvm-project//mlir:Dialect" ],
]
) )
cc_library( cc_library(
name = "TorchMLIRConversionPasses", name = "TorchMLIRConversionPasses",
srcs = [ srcs = [
"lib/Conversion/Passes.cpp" "lib/Conversion/Passes.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/Passes.h" "include/torch-mlir/Conversion/Passes.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToArith", ":TorchMLIRTorchToArith",
":TorchMLIRTorchToTosa", ":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToMhlo",
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToTMTensor", ":TorchMLIRTorchToTMTensor",
":TorchMLIRTorchToMhlo" ":TorchMLIRTorchToTosa",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTorchConversionPasses", name = "TorchMLIRTorchConversionPasses",
srcs = [ srcs = [
"lib/Dialect/TorchConversion/Transforms/Passes.cpp",
"lib/Dialect/TorchConversion/Transforms/BackendTypeConversionPasses.cpp", "lib/Dialect/TorchConversion/Transforms/BackendTypeConversionPasses.cpp",
"lib/Dialect/TorchConversion/Transforms/PassDetail.h",
"lib/Dialect/TorchConversion/Transforms/Passes.cpp",
"lib/Dialect/TorchConversion/Transforms/VerifyInvariantsBeforeBackendLowering.cpp", "lib/Dialect/TorchConversion/Transforms/VerifyInvariantsBeforeBackendLowering.cpp",
"lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp", "lib/Dialect/TorchConversion/Transforms/VerifyLinalgOnTensorsBackendContract.cpp",
"lib/Dialect/TorchConversion/Transforms/VerifyTosaBackendContract.cpp", "lib/Dialect/TorchConversion/Transforms/VerifyTosaBackendContract.cpp",
"lib/Dialect/TorchConversion/Transforms/PassDetail.h"
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h", "include/torch-mlir/Dialect/TorchConversion/Transforms/Passes.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchConversionPassesIncGen",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchConversionPassesIncGen",
":TorchMLIRTorchDialect", ":TorchMLIRTorchDialect",
":TorchMLIRTorchPasses", ":TorchMLIRTorchPasses",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToArith", ":TorchMLIRTorchToArith",
":TorchMLIRTorchToTosa", ":TorchMLIRTorchToLinalg",
":TorchMLIRTorchToTMTensor",
":TorchMLIRTorchToMhlo", ":TorchMLIRTorchToMhlo",
":TorchMLIRTorchToSCF",
":TorchMLIRTorchToTMTensor",
":TorchMLIRTorchToTosa",
"@llvm-project//mlir:ConversionPasses",
"@llvm-project//mlir:FuncDialect", "@llvm-project//mlir:FuncDialect",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:LinalgDialect", "@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:TosaDialect",
"@llvm-project//mlir:MemRefDialect", "@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:MemRefTransforms", "@llvm-project//mlir:MemRefTransforms",
"@llvm-project//mlir:ConversionPasses", "@llvm-project//mlir:Pass",
] "@llvm-project//mlir:TosaDialect",
],
) )
cc_library( cc_library(
name = "TorchMLIRTorchToTosa", name = "TorchMLIRTorchToTosa",
srcs = [ srcs = [
"lib/Conversion/PassDetail.h",
"lib/Conversion/TorchToTosa/TorchToTosa.cpp", "lib/Conversion/TorchToTosa/TorchToTosa.cpp",
"lib/Conversion/TorchToTosa/TosaLegalizeCommon.cpp", "lib/Conversion/TorchToTosa/TosaLegalizeCommon.cpp",
"lib/Conversion/TorchToTosa/TosaLegalizeUtils.cpp", "lib/Conversion/TorchToTosa/TosaLegalizeUtils.cpp",
"lib/Conversion/PassDetail.h", ],
] ,
hdrs = [ hdrs = [
"include/torch-mlir/Conversion/TorchToTosa/TorchToTosa.h", "include/torch-mlir/Conversion/TorchToTosa/TorchToTosa.h",
"include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeCommon.h", "include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeCommon.h",
"include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeUtils.h" "include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeUtils.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRConversionPassesIncGen",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
":TorchMLIRTorchConversionDialect", ":TorchMLIRTorchConversionDialect",
":TorchMLIRConversionPassesIncGen",
"@llvm-project//mlir:Dialect", "@llvm-project//mlir:Dialect",
"@llvm-project//mlir:QuantOps", "@llvm-project//mlir:QuantOps",
"@llvm-project//mlir:TosaDialect" "@llvm-project//mlir:TosaDialect",
] ],
) )
# Dialects.TorchConversion # Dialects.TorchConversion
cc_library( cc_library(
name = "TorchMLIRTorchBackendTypeConversion", name = "TorchMLIRTorchBackendTypeConversion",
srcs = [ srcs = [
"lib/Dialect/TorchConversion/Transforms/BackendTypeConversion.cpp" "lib/Dialect/TorchConversion/Transforms/BackendTypeConversion.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/Dialect/TorchConversion/Transforms/BackendTypeConversion.h" "include/torch-mlir/Dialect/TorchConversion/Transforms/BackendTypeConversion.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchConversionDialect", ":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:FuncTransforms" "@llvm-project//mlir:FuncTransforms",
] ],
) )
# External dialects # External dialects
td_library( td_library(
name = "TorchMLIRTMTensorOpsTdFiles", name = "TorchMLIRTMTensorOpsTdFiles",
srcs = [ srcs = [
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorBase.td"
], ],
includes = ["externals/llvm-external-projects/torch-mlir-dialects/include"], includes = ["externals/llvm-external-projects/torch-mlir-dialects/include"],
deps = [ deps = [
"@llvm-project//mlir:ControlFlowInterfacesTdFiles",
"@llvm-project//mlir:OpBaseTdFiles", "@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:SideEffectInterfacesTdFiles", "@llvm-project//mlir:SideEffectInterfacesTdFiles",
"@llvm-project//mlir:ControlFlowInterfacesTdFiles" ],
]
) )
gentbl_cc_library( gentbl_cc_library(
@ -606,14 +606,14 @@ gentbl_cc_library(
), ),
( (
["-gen-type-interface-defs"], ["-gen-type-interface-defs"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.cpp.inc", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypeInterfaces.cpp.inc",
) ),
], ],
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.td",
deps = [ deps = [
":TorchMLIRTMTensorOpsTdFiles", ":TorchMLIRTMTensorOpsTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -622,18 +622,18 @@ gentbl_cc_library(
tbl_outs = [ tbl_outs = [
( (
["-gen-op-interface-decls"], ["-gen-op-interface-decls"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h.inc",
), ),
( (
["-gen-op-interface-defs"], ["-gen-op-interface-defs"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp.inc",
) ),
], ],
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.td",
deps = [ deps = [
":TorchMLIRTMTensorOpsTdFiles", ":TorchMLIRTMTensorOpsTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -642,64 +642,64 @@ gentbl_cc_library(
tbl_outs = [ tbl_outs = [
( (
["-gen-op-decls"], ["-gen-op-decls"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h.inc",
), ),
( (
["-gen-op-defs"], ["-gen-op-defs"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.cpp.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.cpp.inc",
), ),
( (
["-gen-typedef-decls"], ["-gen-typedef-decls"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypes.h.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorTypes.h.inc",
), ),
( (
[ [
"-gen-dialect-decls", "-gen-dialect-decls",
"-dialect=tm_tensor" "-dialect=tm_tensor",
], ],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h.inc",
), ),
( (
[ [
"-gen-dialect-defs", "-gen-dialect-defs",
"-dialect=tm_tensor" "-dialect=tm_tensor",
], ],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.cpp.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.cpp.inc",
), ),
], ],
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.td",
deps = [ deps = [
":TorchMLIRTMTensorOpsTdFiles" ":TorchMLIRTMTensorOpsTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTMTensorDialect", name = "TorchMLIRTMTensorDialect",
srcs = [ srcs = [
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorDialect.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorInterfaces.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/TMTensorOps.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/IR/ScalarLoopOpInterface.cpp"
], ],
hdrs = [ hdrs = [
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/ScalarLoopOpInterface.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorDialect.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorInterfaces.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h",
], ],
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include", strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
deps = [ deps = [
":TorchMLIRTMTensorInterfacesIncGen",
":TorchMLIRTMTensorOpsIncGen", ":TorchMLIRTMTensorOpsIncGen",
":TorchMLIRTMTensorScalarLoopOpInterfaceIncGen", ":TorchMLIRTMTensorScalarLoopOpInterfaceIncGen",
":TorchMLIRTMTensorInterfacesIncGen", "@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:Dialect", "@llvm-project//mlir:Dialect",
"@llvm-project//mlir:DialectUtils", "@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:ViewLikeInterface",
"@llvm-project//mlir:ControlFlowInterfaces",
"@llvm-project//mlir:AffineDialect",
"@llvm-project//mlir:LinalgDialect", "@llvm-project//mlir:LinalgDialect",
] "@llvm-project//mlir:ViewLikeInterface",
],
) )
td_library( td_library(
@ -709,8 +709,8 @@ td_library(
], ],
deps = [ deps = [
"@llvm-project//mlir:OpBaseTdFiles", "@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:PassBaseTdFiles" "@llvm-project//mlir:PassBaseTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -719,64 +719,64 @@ gentbl_cc_library(
tbl_outs = [ tbl_outs = [
( (
["-gen-pass-decls"], ["-gen-pass-decls"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.inc",
), ),
( (
["-gen-pass-capi-header"], ["-gen-pass-capi-header"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.cpi.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h.cpi.inc",
), ),
( (
["-gen-pass-capi-impl"], ["-gen-pass-capi-impl"],
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.cpi.cpp.inc" "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.cpi.cpp.inc",
) ),
], ],
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.td",
deps = [ deps = [
":TorchMLIRTMTensorTransformsPassesTdFiles" ":TorchMLIRTMTensorTransformsPassesTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRTMTensorPasses", name = "TorchMLIRTMTensorPasses",
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
srcs = [ srcs = [
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Bufferize.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Bufferize.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/ConvertToLoops.cpp",
"externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Passes.cpp", "externals/llvm-external-projects/torch-mlir-dialects/lib/Dialect/TMTensor/Transforms/Passes.cpp",
], ],
hdrs = [ hdrs = [
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h", "externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/Passes.h",
"externals/llvm-external-projects/torch-mlir-dialects/include/torch-mlir-dialects/Dialect/TMTensor/Transforms/PassDetail.h"
], ],
strip_include_prefix = "externals/llvm-external-projects/torch-mlir-dialects/include",
deps = [ deps = [
":TorchMLIRTMTensorTransformsPassesIncGen",
":TorchMLIRTMTensorDialect", ":TorchMLIRTMTensorDialect",
"@llvm-project//mlir:Pass", ":TorchMLIRTMTensorTransformsPassesIncGen",
"@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:Transforms",
"@llvm-project//mlir:BufferizationTransforms", "@llvm-project//mlir:BufferizationTransforms",
"@llvm-project//mlir:FuncTransforms", "@llvm-project//mlir:FuncTransforms",
"@llvm-project//mlir:LinalgTransforms" "@llvm-project//mlir:LinalgDialect",
] "@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:Pass",
"@llvm-project//mlir:Transforms",
],
) )
# RefBackend # RefBackend
filegroup( filegroup(
name = "TorchMLIRRefBackendPassesDetails", name = "TorchMLIRRefBackendPassesDetails",
srcs = [ srcs = [
"lib/RefBackend/PassDetail.h" "lib/RefBackend/PassDetail.h",
] ],
) )
td_library( td_library(
name = "TorchMLIRRefBackendPassTdFiles", name = "TorchMLIRRefBackendPassTdFiles",
srcs = [ srcs = [
"include/torch-mlir/RefBackend/Passes.td" "include/torch-mlir/RefBackend/Passes.td",
], ],
deps = [ deps = [
"@llvm-project//mlir:OpBaseTdFiles", "@llvm-project//mlir:OpBaseTdFiles",
] ],
) )
gentbl_cc_library( gentbl_cc_library(
@ -786,73 +786,73 @@ gentbl_cc_library(
( (
["-gen-pass-decls"], ["-gen-pass-decls"],
"include/torch-mlir/RefBackend/Passes.h.inc", "include/torch-mlir/RefBackend/Passes.h.inc",
) ),
], ],
td_file = "include/torch-mlir/RefBackend/Passes.td",
tblgen = "@llvm-project//mlir:mlir-tblgen", tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/torch-mlir/RefBackend/Passes.td",
deps = [ deps = [
":TorchMLIRRefBackendPassTdFiles", ":TorchMLIRRefBackendPassTdFiles",
"@llvm-project//mlir:PassBaseTdFiles", "@llvm-project//mlir:PassBaseTdFiles",
] ],
) )
cc_library( cc_library(
name = "TorchMLIRRefBackendPass", name = "TorchMLIRRefBackendPass",
srcs = [ srcs = [
"lib/RefBackend/RefBackend.cpp" "lib/RefBackend/RefBackend.cpp",
] + [":TorchMLIRRefBackendPassesDetails"], ] + [":TorchMLIRRefBackendPassesDetails"],
hdrs = [ hdrs = [
"include/torch-mlir/RefBackend/Passes.h" "include/torch-mlir/RefBackend/Passes.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRRefBackendPassIncGen", ":TorchMLIRRefBackendPassIncGen",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchBackendTypeConversion", ":TorchMLIRTorchBackendTypeConversion",
"@llvm-project//mlir:Pass", ":TorchMLIRTorchConversionDialect",
"@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:ArithmeticTransforms", "@llvm-project//mlir:ArithmeticTransforms",
"@llvm-project//mlir:LinalgDialect", "@llvm-project//mlir:LinalgDialect",
"@llvm-project//mlir:LinalgTransforms", "@llvm-project//mlir:LinalgTransforms",
"@llvm-project//mlir:MathTransforms", "@llvm-project//mlir:MathTransforms",
] "@llvm-project//mlir:MemRefDialect",
"@llvm-project//mlir:Pass",
],
) )
cc_library( cc_library(
name = "TorchMLIRInitAll", name = "TorchMLIRInitAll",
srcs = [ srcs = [
"lib/InitAll.cpp" "lib/InitAll.cpp",
], ],
hdrs = [ hdrs = [
"include/torch-mlir/InitAll.h" "include/torch-mlir/InitAll.h",
], ],
strip_include_prefix = "include", strip_include_prefix = "include",
deps = [ deps = [
":TorchMLIRTorchPasses",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchDialect",
":TorchMLIRTorchConversionPasses",
":TorchMLIRTMTensorDialect",
":TorchMLIRTMTensorPasses",
":TorchMLIRConversionPasses", ":TorchMLIRConversionPasses",
":TorchMLIRRefBackendPass", ":TorchMLIRRefBackendPass",
":TorchMLIRTMTensorDialect",
":TorchMLIRTMTensorPasses",
":TorchMLIRTorchConversionDialect",
":TorchMLIRTorchConversionPasses",
":TorchMLIRTorchDialect",
":TorchMLIRTorchPasses",
"@llvm-project//mlir:Dialect", "@llvm-project//mlir:Dialect",
"@llvm-project//mlir:DialectUtils", "@llvm-project//mlir:DialectUtils",
"@llvm-project//mlir:IR" "@llvm-project//mlir:IR",
] ],
) )
# tools # tools
cc_binary( cc_binary(
name = "torch-mlir-opt", name = "torch-mlir-opt",
srcs = [ srcs = [
"tools/torch-mlir-opt/torch-mlir-opt.cpp" "tools/torch-mlir-opt/torch-mlir-opt.cpp",
], ],
deps = [ deps = [
":TorchMLIRInitAll", ":TorchMLIRInitAll",
":TorchMLIRTorchDialect", ":TorchMLIRTorchDialect",
":TorchMLIRTorchPasses", ":TorchMLIRTorchPasses",
"@llvm-project//mlir:AllPassesAndDialects", "@llvm-project//mlir:AllPassesAndDialects",
"@llvm-project//mlir:MlirOptLib" "@llvm-project//mlir:MlirOptLib",
] ],
) )