Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

[NFC] Create Dialects, move IR and Transforms within it #4

Merged
Merged
Show file tree
Hide file tree
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
56 changes: 28 additions & 28 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ package(
td_library(
name = "TcpTdFiles",
srcs = [
"include/IR/TcpBase.td",
"include/IR/TcpEnums.td",
"include/IR/TcpOps.td",
"include/Dialect/IR/TcpBase.td",
"include/Dialect/IR/TcpEnums.td",
"include/Dialect/IR/TcpOps.td",
],
includes = ["include"],
deps = [
Expand All @@ -31,15 +31,15 @@ gentbl_cc_library(
tbl_outs = [
(
["-gen-enum-decls"],
"include/IR/TcpEnums.h.inc",
"include/Dialect/IR/TcpEnums.h.inc",
),
(
["-gen-enum-defs"],
"include/IR/TcpEnums.cpp.inc",
"include/Dialect/IR/TcpEnums.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/IR/TcpOps.td",
td_file = "include/Dialect/IR/TcpOps.td",
deps = [
":TcpTdFiles",
],
Expand All @@ -51,15 +51,15 @@ gentbl_cc_library(
tbl_outs = [
(
["-gen-attrdef-decls"],
"include/IR/TcpAttrs.h.inc",
"include/Dialect/IR/TcpAttrs.h.inc",
),
(
["-gen-attrdef-defs"],
"include/IR/TcpAttrs.cpp.inc",
"include/Dialect/IR/TcpAttrs.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/IR/TcpOps.td",
td_file = "include/Dialect/IR/TcpOps.td",
deps = [
":TcpTdFiles",
],
Expand All @@ -71,29 +71,29 @@ gentbl_cc_library(
tbl_outs = [
(
["-gen-op-decls"],
"include/IR/TcpOps.h.inc",
"include/Dialect/IR/TcpOps.h.inc",
),
(
["-gen-op-defs"],
"include/IR/TcpOps.cpp.inc",
"include/Dialect/IR/TcpOps.cpp.inc",
),
(
[
"-gen-dialect-decls",
"-dialect=tcp",
],
"include/IR/TcpDialect.h.inc",
"include/Dialect/IR/TcpDialect.h.inc",
),
(
[
"-gen-dialect-defs",
"-dialect=tcp",
],
"include/IR/TcpDialect.cpp.inc",
"include/Dialect/IR/TcpDialect.cpp.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/IR/TcpOps.td",
td_file = "include/Dialect/IR/TcpOps.td",
deps = [
":TcpTdFiles",
],
Expand All @@ -102,12 +102,12 @@ gentbl_cc_library(
cc_library(
name = "TcpDialect",
srcs = [
"lib/IR/TcpDialect.cpp",
"lib/IR/TcpOps.cpp",
"lib/Dialect/IR/TcpDialect.cpp",
"lib/Dialect/IR/TcpOps.cpp",
],
hdrs = [
"include/IR/TcpDialect.h",
"include/IR/TcpOps.h",
"include/Dialect/IR/TcpDialect.h",
"include/Dialect/IR/TcpOps.h",
],
strip_include_prefix = "include",
deps = [
Expand All @@ -124,7 +124,7 @@ cc_library(
td_library(
name = "TcpTransformsPassesTdFiles",
srcs = [
"include/Transforms/Passes.td",
"include/Dialect/Transforms/Passes.td",
],
deps = [
"@llvm-project//mlir:OpBaseTdFiles",
Expand All @@ -138,11 +138,11 @@ gentbl_cc_library(
tbl_outs = [
(
["-gen-pass-decls"],
"include/Transforms/Passes.h.inc",
"include/Dialect/Transforms/Passes.h.inc",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "include/Transforms/Passes.td",
td_file = "include/Dialect/Transforms/Passes.td",
deps = [
":TcpTransformsPassesTdFiles",
],
Expand All @@ -151,15 +151,15 @@ gentbl_cc_library(
cc_library(
name = "TcpPasses",
srcs = [
"lib/Transforms/FuseTcpOpsPass.cpp",
"lib/Transforms/IsolateGroupOpsPass.cpp",
"lib/Transforms/PassDetail.h",
"lib/Transforms/Passes.cpp",
"lib/Dialect/Transforms/FuseTcpOpsPass.cpp",
"lib/Dialect/Transforms/IsolateGroupOpsPass.cpp",
"lib/Dialect/Transforms/PassDetail.h",
"lib/Dialect/Transforms/Passes.cpp",
],
hdrs = [
"include/Transforms/FuseTcpOpsPass.h",
"include/Transforms/IsolateGroupOpsPass.h",
"include/Transforms/Passes.h",
"include/Dialect/Transforms/FuseTcpOpsPass.h",
"include/Dialect/Transforms/IsolateGroupOpsPass.h",
"include/Dialect/Transforms/Passes.h",
],
strip_include_prefix = "include",
deps = [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h"

#include "IR/TcpDialect.h.inc"
#include "Dialect/IR/TcpDialect.h.inc"
File renamed without changes.
6 changes: 3 additions & 3 deletions include/IR/TcpOps.h → include/Dialect/IR/TcpOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/TypeSwitch.h"

#include "IR/TcpEnums.h.inc"
#include "Dialect/IR/TcpEnums.h.inc"
#define GET_ATTRDEF_CLASSES
#include "IR/TcpAttrs.h.inc"
#include "Dialect/IR/TcpAttrs.h.inc"
#define GET_OP_CLASSES
#include "IR/TcpOps.h.inc"
#include "Dialect/IR/TcpOps.h.inc"
4 changes: 2 additions & 2 deletions include/IR/TcpOps.td → include/Dialect/IR/TcpOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#ifndef TCP_OPS
#define TCP_OPS

include "IR/TcpBase.td"
include "IR/TcpEnums.td"
include "Dialect/IR/TcpBase.td"
include "Dialect/IR/TcpEnums.td"

include "mlir/IR/OpBase.td"

Expand Down
2 changes: 1 addition & 1 deletion lib/Conversion/PassDetail.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#pragma once

#include "IR/TcpDialect.h"
#include "Dialect/IR/TcpDialect.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/StablehloToTcp/StablehloToTcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/StablehloToTcp/StablehloToTcp.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"

#include "../PassDetail.h"
#include "mlir/IR/PatternMatch.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TcpToArith/TcpToArith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/TcpToArith/TcpToArith.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"

#include "../PassDetail.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TcpToLinalg/Elementwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "Conversion/TcpToLinalg/TcpToLinalg.h"

#include "../PassDetail.h"
#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TcpToLinalg/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "Conversion/TcpToLinalg/TcpToLinalg.h"

#include "../PassDetail.h"
#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TcpToLinalg/TcpToLinalg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/TcpToLinalg/TcpToLinalg.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"

#include "../PassDetail.h"
#include "PopulatePatterns.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToTcp/DataMovement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/TorchToTcp/TorchToTcp.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "Utils.h"
#include "torch-mlir/Conversion/Utils/Utils.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToTcp/Elementwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/TorchToTcp/TorchToTcp.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "Utils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToTcp/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Conversion/TorchToTcp/TorchToTcp.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "Utils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToTcp/TorchToTcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "Conversion/TorchToTcp/TorchToTcp.h"

#include "../PassDetail.h"
#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "PopulatePatterns.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
Expand Down
4 changes: 2 additions & 2 deletions lib/Conversion/TorchToTcp/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include "Utils.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "torch-mlir/Dialect/Torch/IR/TorchDialect.h"
Expand Down
14 changes: 7 additions & 7 deletions lib/IR/TcpDialect.cpp → lib/Dialect/IR/TcpDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"

#include "mlir/IR/Attributes.h"
#include "mlir/IR/DialectImplementation.h"
Expand All @@ -23,19 +23,19 @@ using namespace mlir::tcp;
void TcpDialect::initialize() {
#define GET_OP_LIST
addOperations<
#include "IR/TcpOps.cpp.inc"
#include "Dialect/IR/TcpOps.cpp.inc"
>();
#define GET_ATTRDEF_LIST
addAttributes<
#include "IR/TcpAttrs.cpp.inc"
#include "Dialect/IR/TcpAttrs.cpp.inc"
>();
}

#include "IR/TcpEnums.cpp.inc"
#include "Dialect/IR/TcpEnums.cpp.inc"
#define GET_ATTRDEF_CLASSES
#include "IR/TcpAttrs.cpp.inc"
#include "Dialect/IR/TcpAttrs.cpp.inc"

#include "IR/TcpDialect.cpp.inc"
#include "Dialect/IR/TcpDialect.cpp.inc"

Attribute TcpDialect::parseAttribute(DialectAsmParser &parser,
Type type) const {
Expand Down
4 changes: 2 additions & 2 deletions lib/IR/TcpOps.cpp → lib/Dialect/IR/TcpOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//

#include "IR/TcpOps.h"
#include "Dialect/IR/TcpOps.h"

#include "mlir/IR/Builders.h"
#include "mlir/IR/OpImplementation.h"
Expand All @@ -16,7 +16,7 @@
#include "mlir/IR/Value.h"

#define GET_OP_CLASSES
#include "IR/TcpOps.cpp.inc"
#include "Dialect/IR/TcpOps.cpp.inc"

namespace mlir::tcp {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
//
//===----------------------------------------------------------------------===//

#include "Transforms/FuseTcpOpsPass.h"
#include "Dialect/Transforms/FuseTcpOpsPass.h"
#include "./PassDetail.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Transforms/Passes.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "Dialect/Transforms/Passes.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/OpDefinition.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
//
//===----------------------------------------------------------------------===//

#include "Transforms/IsolateGroupOpsPass.h"
#include "Dialect/Transforms/IsolateGroupOpsPass.h"
#include "./PassDetail.h"

#include "IR/TcpDialect.h"
#include "IR/TcpOps.h"
#include "Transforms/Passes.h"
#include "Dialect/IR/TcpDialect.h"
#include "Dialect/IR/TcpOps.h"
#include "Dialect/Transforms/Passes.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/OpDefinition.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

#include "mlir/Pass/Pass.h"

#include "IR/TcpOps.h"
#include "Dialect/IR/TcpOps.h"

namespace mlir::tcp {

using namespace mlir;
#define GEN_PASS_CLASSES
#include "Transforms/Passes.h.inc"
#include "Dialect/Transforms/Passes.h.inc"

} // end namespace mlir::tcp
Loading