Add a new OperationType handle type to the Transform dialect. This transform type is parameterized by the name of the payload operation it can point to. It is intended as a constraint on transformations that are only applicable to a specific kind of payload operations. If a transformation is applicable to a small set of operation classes, it can be wrapped into a transform op by using a disjunctive constraint, such as `Type<Or<[Transform_ConcreteOperation<"foo">.predicate, Transform_ConcreteOperation<"bar">.predicate]>>` for its operand without modifying this type. Broader sets of accepted operations should be modeled as specific types. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D135586
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
//===-- mlir-c/Dialect/Transform.h - C API for Transform 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_C_DIALECT_TRANSFORM_H
|
|
#define MLIR_C_DIALECT_TRANSFORM_H
|
|
|
|
#include "mlir-c/IR.h"
|
|
#include "mlir-c/Support.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Transform, transform);
|
|
|
|
//===---------------------------------------------------------------------===//
|
|
// AnyOpType
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
MLIR_CAPI_EXPORTED bool mlirTypeIsATransformAnyOpType(MlirType type);
|
|
|
|
MLIR_CAPI_EXPORTED MlirType mlirTransformAnyOpTypeGet(MlirContext ctx);
|
|
|
|
//===---------------------------------------------------------------------===//
|
|
// OperationType
|
|
//===---------------------------------------------------------------------===//
|
|
|
|
MLIR_CAPI_EXPORTED bool mlirTypeIsATransformOperationType(MlirType type);
|
|
|
|
MLIR_CAPI_EXPORTED MlirType
|
|
mlirTransformOperationTypeGet(MlirContext ctx, MlirStringRef operationName);
|
|
|
|
MLIR_CAPI_EXPORTED MlirStringRef
|
|
mlirTransformOperationTypeGetOperationName(MlirType type);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // MLIR_C_DIALECT_TRANSFORM_H
|