forked from llvm/llvm-project
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_mlir_dialect(FooOps foo) | ||
add_mlir_doc(FooOps FooOps Dialects/ -gen-dialect-doc -dialect foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//===- Foo.h - Foo 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_FOO_H_ | ||
#define MLIR_DIALECT_FOO_H_ | ||
|
||
#include "mlir/Bytecode/BytecodeOpInterface.h" | ||
#include "mlir/Dialect/Arith/IR/Arith.h" | ||
#include "mlir/IR/BuiltinTypes.h" | ||
#include "mlir/IR/Dialect.h" | ||
#include "mlir/IR/OpDefinition.h" | ||
#include "mlir/IR/OpImplementation.h" | ||
#include "mlir/Interfaces/InferTypeOpInterface.h" | ||
#include "mlir/Interfaces/SideEffectInterfaces.h" | ||
#include "mlir/Interfaces/VectorInterfaces.h" | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Foo Dialect | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "mlir/Dialect/Foo/FooOpsDialect.h.inc" | ||
|
||
//===----------------------------------------------------------------------===// | ||
// Foo Dialect Operations | ||
//===----------------------------------------------------------------------===// | ||
|
||
#define GET_OP_CLASSES | ||
#include "mlir/Dialect/Foo/FooOps.h.inc" | ||
|
||
#endif // MLIR_DIALECT_FOO_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//===- FooBase.td - Base definitions for foo dialect --------*- tablegen -*-==// | ||
// | ||
// 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 FOO_BASE | ||
#define FOO_BASE | ||
include "mlir/IR/OpBase.td" | ||
def Foo_Dialect : Dialect { | ||
let name = "foo"; | ||
let cppNamespace = "::mlir::foo"; | ||
let description = [{ | ||
Lorem Ipsum | ||
}]; | ||
} | ||
#endif // FOO_BASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//===- FooOps.td - Foo op definitions ----------------------*- tablegen -*-===// | ||
// | ||
// 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 FOO_OPS | ||
#define FOO_OPS | ||
|
||
include "mlir/Dialect/Foo/FooBase.td" | ||
include "mlir/Interfaces/InferTypeOpInterface.td" | ||
include "mlir/Interfaces/VectorInterfaces.td" | ||
include "mlir/Interfaces/SideEffectInterfaces.td" | ||
|
||
#endif // FOO_OPS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
add_mlir_dialect_library(MLIRFooDialect | ||
FooDialect.cpp | ||
|
||
ADDITIONAL_HEADER_DIRS | ||
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Foo | ||
|
||
DEPENDS | ||
MLIRFooOpsIncGen | ||
|
||
LINK_LIBS PUBLIC | ||
MLIRDialect | ||
MLIRIR | ||
MLIRUBDialect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "mlir/Dialect/Foo/Foo.h" | ||
|
||
using namespace mlir; | ||
using namespace mlir::foo; | ||
|
||
#include "mlir/Dialect/Foo/FooOpsDialect.cpp.inc" | ||
|
||
void mlir::foo::FooDialect::initialize() { | ||
addOperations< | ||
#define GET_OP_LIST | ||
#include "mlir/Dialect/Foo/FooOps.cpp.inc" | ||
>(); | ||
} |