Skip to content

Commit

Permalink
Revert "[mlir][test] Shard the Test Dialect (NFC) (llvm#89628)"
Browse files Browse the repository at this point in the history
This reverts commit ae22ac9.
  • Loading branch information
Zentrik committed Aug 30, 2024
1 parent 08d65dd commit e5a7644
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
6 changes: 2 additions & 4 deletions mlir/test/lib/Dialect/Test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ mlir_tablegen(TestOpEnums.cpp.inc -gen-enum-defs)
add_public_tablegen_target(MLIRTestEnumDefIncGen)

set(LLVM_TARGET_DEFINITIONS TestOps.td)
mlir_tablegen(TestOps.h.inc -gen-op-decls)
mlir_tablegen(TestOps.cpp.inc -gen-op-defs)
mlir_tablegen(TestOpsDialect.h.inc -gen-dialect-decls -dialect=test)
mlir_tablegen(TestOpsDialect.cpp.inc -gen-dialect-defs -dialect=test)
mlir_tablegen(TestPatterns.inc -gen-rewriters)
Expand All @@ -41,8 +43,6 @@ mlir_tablegen(TestOpsSyntax.h.inc -gen-op-decls)
mlir_tablegen(TestOpsSyntax.cpp.inc -gen-op-defs)
add_public_tablegen_target(MLIRTestOpsSyntaxIncGen)

add_sharded_ops(TestOps 20)

# Exclude tests from libMLIR.so
add_mlir_library(MLIRTestDialect
TestAttributes.cpp
Expand All @@ -56,7 +56,6 @@ add_mlir_library(MLIRTestDialect
TestTypes.cpp
TestOpsSyntax.cpp
TestDialectInterfaces.cpp
${SHARDED_SRCS}

EXCLUDE_FROM_LIBMLIR

Expand All @@ -67,7 +66,6 @@ add_mlir_library(MLIRTestDialect
MLIRTestTypeDefIncGen
MLIRTestOpsIncGen
MLIRTestOpsSyntaxIncGen
MLIRTestOpsShardGen

LINK_LIBS PUBLIC
MLIRControlFlowInterfaces
Expand Down
5 changes: 4 additions & 1 deletion mlir/test/lib/Dialect/Test/TestDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,12 @@ struct TestOpEffectInterfaceFallback
void TestDialect::initialize() {
registerAttributes();
registerTypes();
addOperations<
#define GET_OP_LIST
#include "TestOps.cpp.inc"
>();
registerOpsSyntax();
addOperations<ManualCppOpWithFold>();
registerTestDialectOperations(this);
registerDynamicOp(getDynamicGenericOp(this));
registerDynamicOp(getDynamicOneOperandTwoResultsOp(this));
registerDynamicOp(getDynamicCustomParserPrinterOp(this));
Expand Down
1 change: 1 addition & 0 deletions mlir/test/lib/Dialect/Test/TestOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
using namespace mlir;
using namespace test;

#define GET_OP_CLASSES
#include "TestOps.cpp.inc"
25 changes: 10 additions & 15 deletions utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("//llvm:lit_test.bzl", "package_path")
load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library", "gentbl_sharded_ops", "td_library")
load("//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")

package(
default_visibility = ["//visibility:public"],
Expand Down Expand Up @@ -153,6 +153,14 @@ gentbl_cc_library(
name = "TestOpsIncGen",
strip_include_prefix = "lib/Dialect/Test",
tbl_outs = [
(
["-gen-op-decls"],
"lib/Dialect/Test/TestOps.h.inc",
),
(
["-gen-op-defs"],
"lib/Dialect/Test/TestOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
Expand Down Expand Up @@ -370,25 +378,12 @@ cc_library(
],
)

gentbl_sharded_ops(
name = "TestDialectOpSrcs",
hdr_out = "lib/Dialect/Test/TestOps.h.inc",
shard_count = 20,
sharder = "//mlir:mlir-src-sharder",
src_file = "lib/Dialect/Test/TestOps.cpp",
src_out = "lib/Dialect/Test/TestOps.cpp.inc",
tblgen = "//mlir:mlir-tblgen",
td_file = "lib/Dialect/Test/TestOps.td",
test = True,
deps = [":TestOpTdFiles"],
)

cc_library(
name = "TestDialect",
srcs = glob(
["lib/Dialect/Test/*.cpp"],
exclude = ["lib/Dialect/Test/TestToLLVMIRTranslation.cpp"],
) + [":TestDialectOpSrcs"],
),
hdrs = glob(["lib/Dialect/Test/*.h"]),
includes = [
"lib/Dialect/Test",
Expand Down

0 comments on commit e5a7644

Please sign in to comment.