diff --git a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/python/BUILD.bazel @@ -11,9 +11,7 @@ load("//mlir:tblgen.bzl", "gentbl_filegroup", "td_library") package( - default_visibility = [ - "//visibility:public", - ], + default_visibility = ["//visibility:public"], licenses = ["notice"], ) @@ -254,6 +252,47 @@ ], ) +##---------------------------------------------------------------------------## +# ControlFlow dialect. +##---------------------------------------------------------------------------## + +td_library( + name = "ControlFlowOpsPyTdFiles", + srcs = [ + "//mlir:include/mlir/Bindings/Python/Attributes.td", + ], + deps = [ + "//mlir:ControlFlowOpsTdFiles", + "//mlir:OpBaseTdFiles", + ], +) + +gentbl_filegroup( + name = "ControlFlowOpsPyGen", + tbl_outs = [ + ( + [ + "-gen-python-op-bindings", + "-bind-dialect=cf", + ], + "mlir/dialects/_cf_ops_gen.py", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "mlir/dialects/ControlFlowOps.td", + deps = [ + ":ControlFlowOpsPyTdFiles", + ], +) + +filegroup( + name = "ControlFlowOpsPyFiles", + srcs = [ + "mlir/dialects/cf.py", + ":ControlFlowOpsPyGen", + ], +) + ##---------------------------------------------------------------------------## # Math dialect. ##---------------------------------------------------------------------------## @@ -431,6 +470,49 @@ ], ) +##---------------------------------------------------------------------------## +# PDL dialect. +##---------------------------------------------------------------------------## + +td_library( + name = "PDLPyTdFiles", + srcs = [ + "//mlir:include/mlir/Bindings/Python/Attributes.td", + ], + includes = ["../include"], + deps = [ + "//mlir:OpBaseTdFiles", + "//mlir:PDLDialectTdFiles", + ], +) + +gentbl_filegroup( + name = "PDLPyGen", + tbl_outs = [ + ( + [ + "-gen-python-op-bindings", + "-bind-dialect=pdl", + ], + "mlir/dialects/_pdl_ops_gen.py", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "mlir/dialects/PDLOps.td", + deps = [ + ":PDLPyTdFiles", + ], +) + +filegroup( + name = "PDLPyFiles", + srcs = [ + "mlir/dialects/_pdl_ops_ext.py", + "mlir/dialects/pdl.py", + ":PDLPyGen", + ], +) + ##---------------------------------------------------------------------------## # Quant dialect. ##---------------------------------------------------------------------------## @@ -449,7 +531,6 @@ ], ) - ##---------------------------------------------------------------------------## # SCF dialect. ##---------------------------------------------------------------------------## @@ -618,6 +699,47 @@ ], ) +##---------------------------------------------------------------------------## +# Tensor dialect. +##---------------------------------------------------------------------------## + +td_library( + name = "TensorOpsPyTdFiles", + srcs = [ + "//mlir:include/mlir/Bindings/Python/Attributes.td", + ], + deps = [ + "//mlir:OpBaseTdFiles", + "//mlir:TensorOpsTdFiles", + ], +) + +gentbl_filegroup( + name = "TensorOpsPyGen", + tbl_outs = [ + ( + [ + "-gen-python-op-bindings", + "-bind-dialect=tensor", + ], + "mlir/dialects/_tensor_ops_gen.py", + ), + ], + tblgen = "//mlir:mlir-tblgen", + td_file = "mlir/dialects/TensorOps.td", + deps = [ + ":TensorOpsPyTdFiles", + ], +) + +filegroup( + name = "TensorOpsPyFiles", + srcs = [ + "mlir/dialects/tensor.py", + ":TensorOpsPyGen", + ], +) + ##---------------------------------------------------------------------------## # Tosa dialect. ##---------------------------------------------------------------------------##