Introduce a type system for the transform dialect. A transform IR type captures the expectations of the transform IR on the payload IR operations that are being transformed, such as being of a certain kind or implementing an interface that enables the transformation. This provides stricter checking and better readability of the transform IR than using the catch-all "handle" type. This change implements the basic support for a type system amendable to dialect extensions and adds a drop-in replacement for the unrestricted "handle" type. The actual switch of transform dialect ops to that type will happen in a separate commit. See https://discourse.llvm.org/t/rfc-type-system-for-the-transform-dialect/65702 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D135164
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
//===- TestTransformDialectExtension.h --------------------------*- 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines an extension of the MLIR Transform dialect for testing
|
|
// purposes.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MLIR_TESTTRANSFORMDIALECTEXTENSION_H
|
|
#define MLIR_TESTTRANSFORMDIALECTEXTENSION_H
|
|
|
|
#include "mlir/Dialect/PDL/IR/PDLTypes.h"
|
|
#include "mlir/Dialect/Transform/IR/TransformInterfaces.h"
|
|
#include "mlir/Dialect/Transform/IR/TransformTypes.h"
|
|
#include "mlir/IR/OpImplementation.h"
|
|
|
|
namespace mlir {
|
|
class DialectRegistry;
|
|
} // namespace mlir
|
|
|
|
#define GET_OP_CLASSES
|
|
#include "TestTransformDialectExtension.h.inc"
|
|
|
|
#define GET_TYPEDEF_CLASSES
|
|
#include "TestTransformDialectExtensionTypes.h.inc"
|
|
|
|
namespace test {
|
|
/// Registers the test extension to the Transform dialect.
|
|
void registerTestTransformDialectExtension(::mlir::DialectRegistry ®istry);
|
|
} // namespace test
|
|
|
|
#endif // MLIR_TESTTRANSFORMDIALECTEXTENSION_H
|