Skip to content

Commit

Permalink
[mlir][linkage] Introduce linkage dialect
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko authored and frabert committed Jan 22, 2025
1 parent 87fdd5a commit 06d5719
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions mlir/include/mlir/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_subdirectory(GPU)
add_subdirectory(Index)
add_subdirectory(IRDL)
add_subdirectory(Linalg)
add_subdirectory(Linkage)
add_subdirectory(LLVMIR)
add_subdirectory(Math)
add_subdirectory(MemRef)
Expand Down
1 change: 1 addition & 0 deletions mlir/include/mlir/Dialect/Linkage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(IR)
2 changes: 2 additions & 0 deletions mlir/include/mlir/Dialect/Linkage/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
add_mlir_dialect(Linkage linkage)
add_mlir_doc(Linkage Linkage Dialects/ -gen-dialect-doc -dialect=linkage)
16 changes: 16 additions & 0 deletions mlir/include/mlir/Dialect/Linkage/IR/Linkage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//===- Linkage.h - Linkage Dialect ------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, 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
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_DIALECT_LINKAGE_IR_LINKAGE_H
#define MLIR_DIALECT_LINKAGE_IR_LINKAGE_H

#include "mlir/IR/Dialect.h"

#include "mlir/Dialect/Linkage/IR/Linkage.h.inc"

#endif // MLIR_DIALECT_LINKAGE_IR_LINKAGE_H
31 changes: 31 additions & 0 deletions mlir/include/mlir/Dialect/Linkage/IR/Linkage.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//===- Linkage.td - Linkage dialect ------------------------*- tablegen -*-===//
//
// This file is 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
//
//===----------------------------------------------------------------------===//

#ifndef LINKAGE
#define LINKAGE

include "mlir/IR/OpBase.td"

//===----------------------------------------------------------------------===//
// Linkage dialect definition.
//===----------------------------------------------------------------------===//

def Linkage_Dialect : Dialect {
let name = "linkage";

let summary = "The Linkage dialect";
let description = [{
TBD
}];

let cppNamespace = "::mlir::linkage";

let useDefaultAttributePrinterParser = 1;
}

#endif // LINKAGE
1 change: 1 addition & 0 deletions mlir/lib/Dialect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_subdirectory(GPU)
add_subdirectory(Index)
add_subdirectory(IRDL)
add_subdirectory(Linalg)
add_subdirectory(Linkage)
add_subdirectory(LLVMIR)
add_subdirectory(Math)
add_subdirectory(MemRef)
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Dialect/Linkage/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(IR)
7 changes: 7 additions & 0 deletions mlir/lib/Dialect/Linkage/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_mlir_dialect_library(MLIRLinkageDialect
Linkage.cpp

LINK_LIBS PUBLIC
MLIRDialect
MLIRIR
)
17 changes: 17 additions & 0 deletions mlir/lib/Dialect/Linkage/IR/Linkage.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//===- Linkage.cpp - Linkage dialect definition ----------------------------==//
//
// Part of the LLVM Project, 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
//
//===----------------------------------------------------------------------===//

#include "mlir/Dialect/Linkage/IR/Linkage.h"

using namespace mlir;

//===----------------------------------------------------------------------===//
// LinkageDialect
//===----------------------------------------------------------------------===//

#include "mlir/Dialect/Linkage/IR/Linkage.cpp.inc"

0 comments on commit 06d5719

Please sign in to comment.