MLIR 24.0.0git
MlirConversionPatternCallbacks Struct Reference

ConversionPattern API. More...

#include "mlir-c/Rewrite.h"

Public Attributes

void(* construct )(void *userData)
 Optional constructor for the user data.
void(* destruct )(void *userData)
 Optional destructor for the user data.
MlirLogicalResult(* matchAndRewrite )(MlirConversionPattern pattern, MlirOperation op, intptr_t nOperands, MlirValue *operands, MlirConversionPatternRewriter rewriter, void *userData)
 The callback function to match against code rooted at the specified operation, and perform the conversion rewrite if the match is successful, corresponding to ConversionPattern::matchAndRewrite.
MlirLogicalResult(* matchAndRewrite1ToN )(MlirConversionPattern pattern, MlirOperation op, intptr_t nRanges, intptr_t *rangeSizes, intptr_t nOperands, MlirValue *operands, MlirConversionPatternRewriter rewriter, void *userData)
 Optional callback corresponding to the 1:N ConversionPattern::matchAndRewrite(Operation *, ArrayRef<ValueRange>, ...) overload, used when one or more operands are remapped to several values (e.g.

Detailed Description

ConversionPattern API.

Definition at line 745 of file Rewrite.h.

Member Data Documentation

◆ construct

void(* MlirConversionPatternCallbacks::construct) (void *userData)

Optional constructor for the user data.

Set to nullptr to disable it.

Definition at line 748 of file Rewrite.h.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().

◆ destruct

void(* MlirConversionPatternCallbacks::destruct) (void *userData)

Optional destructor for the user data.

Set to nullptr to disable it.

Definition at line 751 of file Rewrite.h.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().

◆ matchAndRewrite

MlirLogicalResult(* MlirConversionPatternCallbacks::matchAndRewrite) (MlirConversionPattern pattern, MlirOperation op, intptr_t nOperands, MlirValue *operands, MlirConversionPatternRewriter rewriter, void *userData)

The callback function to match against code rooted at the specified operation, and perform the conversion rewrite if the match is successful, corresponding to ConversionPattern::matchAndRewrite.

Definition at line 755 of file Rewrite.h.

Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().

◆ matchAndRewrite1ToN

MlirLogicalResult(* MlirConversionPatternCallbacks::matchAndRewrite1ToN) (MlirConversionPattern pattern, MlirOperation op, intptr_t nRanges, intptr_t *rangeSizes, intptr_t nOperands, MlirValue *operands, MlirConversionPatternRewriter rewriter, void *userData)

Optional callback corresponding to the 1:N ConversionPattern::matchAndRewrite(Operation *, ArrayRef<ValueRange>, ...) overload, used when one or more operands are remapped to several values (e.g.

under a 1:N type conversion). operands is the flat concatenation of all operand ranges; there are nRanges ranges (one per original operand) and rangeSizes[i] is the number of values in the i-th range. When this is non-null it takes precedence; when null, the driver falls back to the 1:1 matchAndRewrite above.

Definition at line 768 of file Rewrite.h.


The documentation for this struct was generated from the following file: