Skip to content

Commit

Permalink
Adding util transform dialect ops that support util.func. (iree-org#1…
Browse files Browse the repository at this point in the history
…6426)

Tests are changed as part of iree-org#16411 (as that's required to make this
work in general).
  • Loading branch information
benvanik authored Feb 15, 2024
1 parent a86304a commit 1ee6007
Show file tree
Hide file tree
Showing 9 changed files with 645 additions and 1 deletion.
68 changes: 68 additions & 0 deletions compiler/src/iree/compiler/Dialect/Util/TransformOps/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_td_library")
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")

package(
default_visibility = ["//visibility:public"],
features = ["layering_check"],
licenses = ["notice"], # Apache 2.0
)

iree_td_library(
name = "td_files",
srcs = enforce_glob(
[
"UtilTransformOps.td",
],
include = ["*.td"],
),
deps = [
"@llvm-project//mlir:OpBaseTdFiles",
"@llvm-project//mlir:TransformDialectTdFiles",
],
)

iree_gentbl_cc_library(
name = "UtilTransformOpsGen",
tbl_outs = [
(
["--gen-op-decls"],
"UtilTransformOps.h.inc",
),
(
["--gen-op-defs"],
"UtilTransformOps.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "UtilTransformOps.td",
deps = [":td_files"],
)

iree_compiler_cc_library(
name = "TransformOps",
srcs = [
"UtilTransformOps.cpp",
"UtilTransformOps.cpp.inc",
],
hdrs = [
"UtilTransformOps.h",
"UtilTransformOps.h.inc",
],
deps = [
":UtilTransformOpsGen",
"//compiler/src/iree/compiler/Dialect/Util/IR",
"//compiler/src/iree/compiler/Utils",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:PDLDialect",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TransformDialect",
"@llvm-project//mlir:TransformUtils",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
################################################################################
# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from #
# compiler/src/iree/compiler/Dialect/Util/TransformOps/BUILD.bazel #
# #
# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary #
# CMake-only content. #
# #
# To disable autogeneration for this file entirely, delete this header. #
################################################################################

iree_add_all_subdirs()

iree_tablegen_library(
NAME
UtilTransformOpsGen
TD_FILE
"UtilTransformOps.td"
OUTS
--gen-op-decls UtilTransformOps.h.inc
--gen-op-defs UtilTransformOps.cpp.inc
)

iree_cc_library(
NAME
TransformOps
HDRS
"UtilTransformOps.h"
"UtilTransformOps.h.inc"
SRCS
"UtilTransformOps.cpp"
"UtilTransformOps.cpp.inc"
DEPS
::UtilTransformOpsGen
LLVMSupport
MLIRIR
MLIRPDLDialect
MLIRSupport
MLIRTransformDialect
MLIRTransformUtils
iree::compiler::Dialect::Util::IR
iree::compiler::Utils
PUBLIC
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Loading

0 comments on commit 1ee6007

Please sign in to comment.