Skip to content

[mlir] Forward **kwargs through gentbl_shard_rule #144001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions utils/bazel/llvm-project-overlay/mlir/tblgen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def gentbl_sharded_ops(
test = False,
includes = [],
strip_include_prefix = None,
deps = []):
deps = [],
**kwargs):
"""Generate sharded op declarations and definitions.

This special build rule shards op definitions in a TableGen file and generates multiple copies
Expand Down Expand Up @@ -524,6 +525,7 @@ def gentbl_sharded_ops(
td_file = td_file,
test = test,
deps = deps,
**kwargs,
)
all_files = [hdr_out, src_out]
for i in range(0, shard_count):
Expand All @@ -535,9 +537,14 @@ def gentbl_sharded_ops(
out = out_file,
sharder = sharder,
src_file = src_file,
**kwargs,
)
all_files.append(out_file)
native.filegroup(name = name, srcs = all_files)
native.filegroup(
name = name,
srcs = all_files,
**kwargs,
)

def gentbl_sharded_op_defs(name, source_file, shard_count):
"""Generates multiple copies of a source file that includes sharded op definitions.
Expand Down
Loading