Skip to content

Commit 69bde04

Browse files
authored
split XeGPU enums into a separate build rule (#89997)
Fixes the bazel build. Note the addition of the Arith dependency created duplicate arith enum declarations in the two dialects, so it had to be spit into its own build rule. This matches what the cmake build does for this dialect.
1 parent 186952f commit 69bde04

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Description:
66
# The MLIR "Multi-Level Intermediate Representation" Compiler Infrastructure
77

8-
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
98
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
9+
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
1010
load(
1111
":build_defs.bzl",
1212
"cc_headers_only",
@@ -3652,14 +3652,6 @@ gentbl_cc_library(
36523652
],
36533653
"include/mlir/Dialect/XeGPU/IR/XeGPUTypes.cpp.inc",
36543654
),
3655-
(
3656-
["-gen-enum-decls"],
3657-
"include/mlir/Dialect/XeGPU/IR/XeGPUEnums.h.inc",
3658-
),
3659-
(
3660-
["-gen-enum-defs"],
3661-
"include/mlir/Dialect/XeGPU/IR/XeGPUEnums.cpp.inc",
3662-
),
36633655
(
36643656
[
36653657
"-gen-attrdef-decls",
@@ -3677,7 +3669,44 @@ gentbl_cc_library(
36773669
],
36783670
tblgen = ":mlir-tblgen",
36793671
td_file = "include/mlir/Dialect/XeGPU/IR/XeGPU.td",
3680-
deps = [":XeGPUTdFiles"],
3672+
deps = [
3673+
":ArithOpsTdFiles",
3674+
":XeGPUTdFiles",
3675+
],
3676+
)
3677+
3678+
td_library(
3679+
name = "XeGPUAttrTdFiles",
3680+
srcs = [
3681+
"include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td",
3682+
"include/mlir/Dialect/XeGPU/IR/XeGPUDialect.td",
3683+
],
3684+
includes = ["include"],
3685+
deps = [
3686+
":BuiltinDialectTdFiles",
3687+
":OpBaseTdFiles",
3688+
":ShapedOpInterfacesTdFiles",
3689+
":ViewLikeInterfaceTdFiles",
3690+
],
3691+
)
3692+
3693+
# Separated from the XeGPUIncGen target because the enum declaration causes
3694+
# duplicate declarations with the Arith enums.
3695+
gentbl_cc_library(
3696+
name = "XeGPUEnumsIncGen",
3697+
tbl_outs = [
3698+
(
3699+
["-gen-enum-decls"],
3700+
"include/mlir/Dialect/XeGPU/IR/XeGPUEnums.h.inc",
3701+
),
3702+
(
3703+
["-gen-enum-defs"],
3704+
"include/mlir/Dialect/XeGPU/IR/XeGPUEnums.cpp.inc",
3705+
),
3706+
],
3707+
tblgen = ":mlir-tblgen",
3708+
td_file = "include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td",
3709+
deps = [":XeGPUAttrTdFiles"],
36813710
)
36823711

36833712
cc_library(
@@ -3689,12 +3718,14 @@ cc_library(
36893718
hdrs = ["include/mlir/Dialect/XeGPU/IR/XeGPU.h"],
36903719
includes = ["include"],
36913720
deps = [
3721+
":ArithDialect",
36923722
":BytecodeOpInterface",
36933723
":DialectUtils",
36943724
":IR",
36953725
":ShapedOpInterfaces",
36963726
":SideEffectInterfaces",
36973727
":ViewLikeInterface",
3728+
":XeGPUEnumsIncGen",
36983729
":XeGPUIncGen",
36993730
"//llvm:Support",
37003731
],

0 commit comments

Comments
 (0)