|
MLIR 24.0.0git
|
#include "mlir-c/Rewrite.h"#include "mlir-c/Support.h"#include "mlir-c/Transforms.h"#include "mlir/CAPI/IR.h"#include "mlir/CAPI/IRMapping.h"#include "mlir/CAPI/Rewrite.h"#include "mlir/CAPI/Support.h"#include "mlir/CAPI/Wrap.h"#include "mlir/IR/Attributes.h"#include "mlir/IR/PDLPatternMatch.h.inc"#include "mlir/IR/PatternMatch.h"#include "mlir/Rewrite/FrozenRewritePatternSet.h"#include "mlir/Transforms/DialectConversion.h"#include "mlir/Transforms/GreedyPatternRewriteDriver.h"#include "mlir/Transforms/WalkPatternRewriteDriver.h"#include <cassert>Go to the source code of this file.
Classes | |
| class | mlir::ExternalConversionPattern |
| class | mlir::ExternalRewritePattern |
Namespaces | |
| namespace | mlir |
| Include the generated interface declarations. | |
Functions | |
| MlirContext | mlirRewriterBaseGetContext (MlirRewriterBase rewriter) |
| RewriterBase API inherited from OpBuilder. | |
| void | mlirRewriterBaseClearInsertionPoint (MlirRewriterBase rewriter) |
| Insertion points methods. | |
| void | mlirRewriterBaseSetInsertionPointBefore (MlirRewriterBase rewriter, MlirOperation op) |
| Sets the insertion point to the specified operation, which will cause subsequent insertions to go right before it. | |
| void | mlirRewriterBaseSetInsertionPointAfter (MlirRewriterBase rewriter, MlirOperation op) |
| Sets the insertion point to the node after the specified operation, which will cause subsequent insertions to go right after it. | |
| void | mlirRewriterBaseSetInsertionPointAfterValue (MlirRewriterBase rewriter, MlirValue value) |
| Sets the insertion point to the node after the specified value. | |
| void | mlirRewriterBaseSetInsertionPointToStart (MlirRewriterBase rewriter, MlirBlock block) |
| Sets the insertion point to the start of the specified block. | |
| void | mlirRewriterBaseSetInsertionPointToEnd (MlirRewriterBase rewriter, MlirBlock block) |
| Sets the insertion point to the end of the specified block. | |
| MlirBlock | mlirRewriterBaseGetInsertionBlock (MlirRewriterBase rewriter) |
| Return the block the current insertion point belongs to. | |
| MlirBlock | mlirRewriterBaseGetBlock (MlirRewriterBase rewriter) |
| Returns the current block of the rewriter. | |
| MlirOperation | mlirRewriterBaseGetOperationAfterInsertion (MlirRewriterBase rewriter) |
| Returns the operation right after the current insertion point of the rewriter. | |
| MlirRewriterBaseInsertPoint | mlirRewriterBaseSaveInsertionPoint (MlirRewriterBase rewriter) |
| Returns the current insertion point of the rewriter so that it can be restored later with mlirRewriterBaseRestoreInsertionPoint. | |
| void | mlirRewriterBaseRestoreInsertionPoint (MlirRewriterBase rewriter, MlirRewriterBaseInsertPoint insertPoint) |
| Restores a previously saved insertion point. | |
| MlirBlock | mlirRewriterBaseCreateBlockBefore (MlirRewriterBase rewriter, MlirBlock insertBefore, intptr_t nArgTypes, MlirType const *argTypes, MlirLocation const *locations) |
| Block and operation creation/insertion/cloning. | |
| MlirOperation | mlirRewriterBaseInsert (MlirRewriterBase rewriter, MlirOperation op) |
| Insert the given operation at the current insertion point and return it. | |
| MlirOperation | mlirRewriterBaseClone (MlirRewriterBase rewriter, MlirOperation op) |
| Creates a deep copy of the specified operation. | |
| MlirOperation | mlirRewriterBaseCloneWithoutRegions (MlirRewriterBase rewriter, MlirOperation op) |
| Creates a deep copy of this operation but keep the operation regions empty. | |
| MlirOperation | mlirRewriterBaseCloneWithMapping (MlirRewriterBase rewriter, MlirOperation op, MlirIRMapping mapping) |
| Clones the given operation using the rewriter and the provided IRMapping. | |
| void | mlirRewriterBaseCloneRegionBefore (MlirRewriterBase rewriter, MlirRegion region, MlirBlock before) |
| Clone the blocks that belong to "region" before the given position in another region "parent". | |
| void | mlirRewriterBaseInlineRegionBefore (MlirRewriterBase rewriter, MlirRegion region, MlirBlock before) |
| RewriterBase API. | |
| void | mlirRewriterBaseReplaceOpWithValues (MlirRewriterBase rewriter, MlirOperation op, intptr_t nValues, MlirValue const *values) |
| Replace the results of the given (original) operation with the specified list of values (replacements). | |
| void | mlirRewriterBaseReplaceOpWithOperation (MlirRewriterBase rewriter, MlirOperation op, MlirOperation newOp) |
| Replace the results of the given (original) operation with the specified new op (replacement). | |
| void | mlirRewriterBaseEraseOp (MlirRewriterBase rewriter, MlirOperation op) |
| Erases an operation that is known to have no uses. | |
| void | mlirRewriterBaseEraseBlock (MlirRewriterBase rewriter, MlirBlock block) |
| Erases a block along with all operations inside it. | |
| void | mlirRewriterBaseInlineBlockBefore (MlirRewriterBase rewriter, MlirBlock source, MlirOperation op, intptr_t nArgValues, MlirValue const *argValues) |
| Inline the operations of block 'source' before the operation 'op'. | |
| void | mlirRewriterBaseMergeBlocks (MlirRewriterBase rewriter, MlirBlock source, MlirBlock dest, intptr_t nArgValues, MlirValue const *argValues) |
| Inline the operations of block 'source' into the end of block 'dest'. | |
| void | mlirRewriterBaseMoveOpBefore (MlirRewriterBase rewriter, MlirOperation op, MlirOperation existingOp) |
| Unlink this operation from its current block and insert it right before existingOp which may be in the same or another block in the same function. | |
| void | mlirRewriterBaseMoveOpAfter (MlirRewriterBase rewriter, MlirOperation op, MlirOperation existingOp) |
| Unlink this operation from its current block and insert it right after existingOp which may be in the same or another block in the same function. | |
| void | mlirRewriterBaseMoveBlockBefore (MlirRewriterBase rewriter, MlirBlock block, MlirBlock existingBlock) |
| Unlink this block and insert it right before existingBlock. | |
| void | mlirRewriterBaseStartOpModification (MlirRewriterBase rewriter, MlirOperation op) |
| This method is used to notify the rewriter that an in-place operation modification is about to happen. | |
| void | mlirRewriterBaseFinalizeOpModification (MlirRewriterBase rewriter, MlirOperation op) |
| This method is used to signal the end of an in-place modification of the given operation. | |
| void | mlirRewriterBaseCancelOpModification (MlirRewriterBase rewriter, MlirOperation op) |
| This method cancels a pending in-place modification. | |
| void | mlirRewriterBaseReplaceAllUsesWith (MlirRewriterBase rewriter, MlirValue from, MlirValue to) |
| Find uses of from and replace them with to. | |
| void | mlirRewriterBaseReplaceAllValueRangeUsesWith (MlirRewriterBase rewriter, intptr_t nValues, MlirValue const *from, MlirValue const *to) |
| Find uses of from and replace them with to. | |
| void | mlirRewriterBaseReplaceAllOpUsesWithValueRange (MlirRewriterBase rewriter, MlirOperation from, intptr_t nTo, MlirValue const *to) |
| Find uses of from and replace them with to. | |
| void | mlirRewriterBaseReplaceAllOpUsesWithOperation (MlirRewriterBase rewriter, MlirOperation from, MlirOperation to) |
| Find uses of from and replace them with to. | |
| void | mlirRewriterBaseReplaceOpUsesWithinBlock (MlirRewriterBase rewriter, MlirOperation op, intptr_t nNewValues, MlirValue const *newValues, MlirBlock block) |
| Find uses of from within block and replace them with to. | |
| void | mlirRewriterBaseReplaceAllUsesExcept (MlirRewriterBase rewriter, MlirValue from, MlirValue to, MlirOperation exceptedUser) |
| Find uses of from and replace them with to except if the user is exceptedUser. | |
| MlirRewriterBase | mlirIRRewriterCreate (MlirContext context) |
| IRRewriter API. | |
| MlirRewriterBase | mlirIRRewriterCreateFromOp (MlirOperation op) |
| Create an IRRewriter and transfer ownership to the caller. | |
| void | mlirIRRewriterDestroy (MlirRewriterBase rewriter) |
| Takes an IRRewriter owned by the caller and destroys it. | |
| MlirFrozenRewritePatternSet | mlirFreezeRewritePattern (MlirRewritePatternSet set) |
| RewritePatternSet and FrozenRewritePatternSet API. | |
| void | mlirFrozenRewritePatternSetDestroy (MlirFrozenRewritePatternSet set) |
| Destroy the given MlirFrozenRewritePatternSet. | |
| mlir::GreedyRewriteConfig * | unwrap (MlirGreedyRewriteDriverConfig config) |
| GreedyRewriteDriverConfig API. | |
| MlirGreedyRewriteDriverConfig | wrap (mlir::GreedyRewriteConfig *config) |
| MlirGreedyRewriteDriverConfig | mlirGreedyRewriteDriverConfigCreate () |
| GreedyRewriteDriverConfig API. | |
| void | mlirGreedyRewriteDriverConfigDestroy (MlirGreedyRewriteDriverConfig config) |
| Destroys a greedy rewrite driver configuration. | |
| void | mlirGreedyRewriteDriverConfigSetMaxIterations (MlirGreedyRewriteDriverConfig config, int64_t maxIterations) |
| Sets the maximum number of iterations for the greedy rewrite driver. | |
| void | mlirGreedyRewriteDriverConfigSetMaxNumRewrites (MlirGreedyRewriteDriverConfig config, int64_t maxNumRewrites) |
| Sets the maximum number of rewrites within an iteration. | |
| void | mlirGreedyRewriteDriverConfigSetUseTopDownTraversal (MlirGreedyRewriteDriverConfig config, bool useTopDownTraversal) |
| Sets whether to use top-down traversal for the initial population of the worklist. | |
| void | mlirGreedyRewriteDriverConfigEnableFolding (MlirGreedyRewriteDriverConfig config, bool enable) |
| Enables or disables folding during greedy rewriting. | |
| void | mlirGreedyRewriteDriverConfigSetStrictness (MlirGreedyRewriteDriverConfig config, MlirGreedyRewriteStrictness strictness) |
| Sets the strictness level for the greedy rewrite driver. | |
| void | mlirGreedyRewriteDriverConfigSetRegionSimplificationLevel (MlirGreedyRewriteDriverConfig config, MlirGreedySimplifyRegionLevel level) |
| Sets the region simplification level. | |
| void | mlirGreedyRewriteDriverConfigEnableConstantCSE (MlirGreedyRewriteDriverConfig config, bool enable) |
| Enables or disables constant CSE. | |
| int64_t | mlirGreedyRewriteDriverConfigGetMaxIterations (MlirGreedyRewriteDriverConfig config) |
| Gets the maximum number of iterations for the greedy rewrite driver. | |
| int64_t | mlirGreedyRewriteDriverConfigGetMaxNumRewrites (MlirGreedyRewriteDriverConfig config) |
| Gets the maximum number of rewrites within an iteration. | |
| bool | mlirGreedyRewriteDriverConfigGetUseTopDownTraversal (MlirGreedyRewriteDriverConfig config) |
| Gets whether top-down traversal is used for initial worklist population. | |
| bool | mlirGreedyRewriteDriverConfigIsFoldingEnabled (MlirGreedyRewriteDriverConfig config) |
| Gets whether folding is enabled during greedy rewriting. | |
| MlirGreedyRewriteStrictness | mlirGreedyRewriteDriverConfigGetStrictness (MlirGreedyRewriteDriverConfig config) |
| Gets the strictness level for the greedy rewrite driver. | |
| MlirGreedySimplifyRegionLevel | mlirGreedyRewriteDriverConfigGetRegionSimplificationLevel (MlirGreedyRewriteDriverConfig config) |
| Gets the region simplification level. | |
| bool | mlirGreedyRewriteDriverConfigIsConstantCSEEnabled (MlirGreedyRewriteDriverConfig config) |
| Gets whether constant CSE is enabled. | |
| MlirLogicalResult | mlirApplyPatternsAndFoldGreedily (MlirModule op, MlirFrozenRewritePatternSet patterns, MlirGreedyRewriteDriverConfig config) |
| MlirLogicalResult | mlirApplyPatternsAndFoldGreedilyWithOp (MlirOperation op, MlirFrozenRewritePatternSet patterns, MlirGreedyRewriteDriverConfig config) |
| void | mlirWalkAndApplyPatterns (MlirOperation op, MlirFrozenRewritePatternSet patterns) |
| Applies the given patterns to the given op by a fast walk-based pattern rewrite driver. | |
| MlirLogicalResult | mlirApplyPartialConversion (MlirOperation op, MlirConversionTarget target, MlirFrozenRewritePatternSet patterns, MlirConversionConfig config) |
| Apply a partial conversion on the given operation. | |
| MlirLogicalResult | mlirApplyFullConversion (MlirOperation op, MlirConversionTarget target, MlirFrozenRewritePatternSet patterns, MlirConversionConfig config) |
| Apply a full conversion on the given operation. | |
| MlirConversionConfig | mlirConversionConfigCreate (void) |
| ConversionConfig API. | |
| void | mlirConversionConfigDestroy (MlirConversionConfig config) |
| Destroy the given ConversionConfig. | |
| void | mlirConversionConfigSetFoldingMode (MlirConversionConfig config, MlirDialectConversionFoldingMode mode) |
| Set the folding mode for the given ConversionConfig. | |
| MlirDialectConversionFoldingMode | mlirConversionConfigGetFoldingMode (MlirConversionConfig config) |
| Get the folding mode for the given ConversionConfig. | |
| void | mlirConversionConfigEnableBuildMaterializations (MlirConversionConfig config, bool enable) |
| Enable or disable building materializations during conversion. | |
| bool | mlirConversionConfigIsBuildMaterializationsEnabled (MlirConversionConfig config) |
| Check if building materializations during conversion is enabled. | |
| MlirRewriterBase | mlirPatternRewriterAsBase (MlirPatternRewriter rewriter) |
| PatternRewriter API. | |
| MlirPatternRewriter | mlirConversionPatternRewriterAsPatternRewriter (MlirConversionPatternRewriter rewriter) |
| ConversionPatternRewriter API. | |
| MlirLogicalResult | mlirConversionPatternRewriterConvertRegionTypes (MlirConversionPatternRewriter rewriter, MlirRegion region, MlirTypeConverter typeConverter) |
| Apply a signature conversion to each block in the given region. | |
| void | mlirConversionPatternRewriterReplaceOpWithMultiple (MlirConversionPatternRewriter rewriter, MlirOperation op, intptr_t nRanges, intptr_t *rangeSizes, MlirValue *values) |
| Replace the given operation with multiple value ranges – one range per result of op – and erase it. | |
| MlirConversionTarget | mlirConversionTargetCreate (MlirContext context) |
| ConversionTarget API. | |
| void | mlirConversionTargetDestroy (MlirConversionTarget target) |
| Destroy the given ConversionTarget. | |
| void | mlirConversionTargetAddLegalOp (MlirConversionTarget target, MlirStringRef opName) |
| Register the given operations as legal. | |
| void | mlirConversionTargetAddIllegalOp (MlirConversionTarget target, MlirStringRef opName) |
| Register the given operations as illegal. | |
| void | mlirConversionTargetAddLegalDialect (MlirConversionTarget target, MlirStringRef dialectName) |
| Register the operations of the given dialect as legal. | |
| void | mlirConversionTargetAddIllegalDialect (MlirConversionTarget target, MlirStringRef dialectName) |
| Register the operations of the given dialect as illegal. | |
| void | mlirConversionTargetAddDynamicallyLegalOp (MlirConversionTarget target, MlirStringRef opName, MlirConversionTargetDynamicLegalityCallback callback, void *userData) |
| Register the given operation as dynamically legal, with a callback to determine per-instance legality. | |
| void | mlirConversionTargetAddDynamicallyLegalDialect (MlirConversionTarget target, MlirStringRef dialectName, MlirConversionTargetDynamicLegalityCallback callback, void *userData) |
| Register the given dialect as dynamically legal, with a callback to determine per-instance legality for all operations in the dialect. | |
| void | mlirConversionTargetMarkOpRecursivelyLegal (MlirConversionTarget target, MlirStringRef opName, MlirConversionTargetDynamicLegalityCallback callback, void *userData) |
| Mark the given operation as recursively legal. | |
| void | mlirConversionTargetMarkUnknownOpDynamicallyLegal (MlirConversionTarget target, MlirConversionTargetDynamicLegalityCallback callback, void *userData) |
| Mark unknown operations as dynamically legal, with a callback. | |
| MlirTypeConverter | mlirTypeConverterCreate () |
| TypeConverter API. | |
| void | mlirTypeConverterDestroy (MlirTypeConverter typeConverter) |
| Destroy the given TypeConverter. | |
| void | mlirTypeConverterAddConversion (MlirTypeConverter typeConverter, MlirTypeConverterConversionCallback convertType, void *userData) |
| Add a type conversion function to the given TypeConverter. | |
| void | mlirTypeConverterConversionResultsAppend (MlirTypeConverterConversionResults results, MlirType type) |
| Append a converted result type to the given 1:N conversion result accumulator. | |
| void | mlirTypeConverterAdd1ToNConversion (MlirTypeConverter typeConverter, MlirTypeConverter1ToNConversionCallback convertType, void *userData) |
| Add a 1:N type conversion function to the given TypeConverter. | |
| MlirType | mlirTypeConverterConvertType (MlirTypeConverter typeConverter, MlirType type) |
| Convert the given type using the given TypeConverter. | |
| void | mlirTypeConverterAddSourceMaterialization (MlirTypeConverter typeConverter, MlirTypeConverterSourceMaterializationCallback callback, void *userData) |
| Register a source materialization with the given TypeConverter. | |
| void | mlirTypeConverterAddTargetMaterialization (MlirTypeConverter typeConverter, MlirTypeConverterTargetMaterializationCallback callback, void *userData) |
| Register a target materialization with the given TypeConverter. | |
| void | mlirTypeConverterAdd1ToNTargetMaterialization (MlirTypeConverter typeConverter, MlirTypeConverter1ToNTargetMaterializationCallback callback, void *userData) |
| Register a 1:N target materialization with the given TypeConverter. | |
| MlirConversionPattern | mlirOpConversionPatternCreate (MlirStringRef rootName, unsigned benefit, MlirContext context, MlirTypeConverter typeConverter, MlirConversionPatternCallbacks callbacks, void *userData, size_t nGeneratedNames, MlirStringRef *generatedNames) |
| Create a conversion pattern that matches the operation with the given rootName, corresponding to mlir::OpConversionPattern. | |
| MlirTypeConverter | mlirConversionPatternGetTypeConverter (MlirConversionPattern pattern) |
| Get the type converter used by this conversion pattern. | |
| MlirRewritePattern | mlirConversionPatternAsRewritePattern (MlirConversionPattern pattern) |
| Cast the ConversionPattern to a RewritePattern. | |
| MlirRewritePattern | mlirOpRewritePatternCreate (MlirStringRef rootName, unsigned benefit, MlirContext context, MlirRewritePatternCallbacks callbacks, void *userData, size_t nGeneratedNames, MlirStringRef *generatedNames) |
| Create a rewrite pattern that matches the operation with the given rootName, corresponding to mlir::OpRewritePattern. | |
| MlirRewritePatternSet | mlirRewritePatternSetCreate (MlirContext context) |
| RewritePatternSet API. | |
| MlirContext | mlirRewritePatternSetGetContext (MlirRewritePatternSet set) |
| Get the context associated with a MlirRewritePatternSet. | |
| void | mlirRewritePatternSetDestroy (MlirRewritePatternSet set) |
| Destruct the given MlirRewritePatternSet. | |
| void | mlirRewritePatternSetAdd (MlirRewritePatternSet set, MlirRewritePattern pattern) |
| Add the given MlirRewritePattern into a MlirRewritePatternSet. | |
| MlirLogicalResult mlirApplyFullConversion | ( | MlirOperation | op, |
| MlirConversionTarget | target, | ||
| MlirFrozenRewritePatternSet | patterns, | ||
| MlirConversionConfig | config ) |
Apply a full conversion on the given operation.
Definition at line 489 of file Rewrite.cpp.
| MlirLogicalResult mlirApplyPartialConversion | ( | MlirOperation | op, |
| MlirConversionTarget | target, | ||
| MlirFrozenRewritePatternSet | patterns, | ||
| MlirConversionConfig | config ) |
Apply a partial conversion on the given operation.
Definition at line 482 of file Rewrite.cpp.
| MlirLogicalResult mlirApplyPatternsAndFoldGreedily | ( | MlirModule | op, |
| MlirFrozenRewritePatternSet | patterns, | ||
| MlirGreedyRewriteDriverConfig | config ) |
Definition at line 461 of file Rewrite.cpp.
References mlir::applyPatternsGreedily(), unwrap(), and wrap().
| MlirLogicalResult mlirApplyPatternsAndFoldGreedilyWithOp | ( | MlirOperation | op, |
| MlirFrozenRewritePatternSet | patterns, | ||
| MlirGreedyRewriteDriverConfig | config ) |
Definition at line 469 of file Rewrite.cpp.
References mlir::applyPatternsGreedily(), unwrap(), and wrap().
| MlirConversionConfig mlirConversionConfigCreate | ( | void | ) |
ConversionConfig API.
Create a default ConversionConfig.
Definition at line 501 of file Rewrite.cpp.
References wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionConfig::isBuildMaterializationsEnabled().
| void mlirConversionConfigDestroy | ( | MlirConversionConfig | config | ) |
Destroy the given ConversionConfig.
Definition at line 505 of file Rewrite.cpp.
References unwrap().
Enable or disable building materializations during conversion.
Definition at line 538 of file Rewrite.cpp.
References unwrap().
| MlirDialectConversionFoldingMode mlirConversionConfigGetFoldingMode | ( | MlirConversionConfig | config | ) |
Get the folding mode for the given ConversionConfig.
Definition at line 527 of file Rewrite.cpp.
References MLIR_DIALECT_CONVERSION_FOLDING_MODE_AFTER_PATTERNS, MLIR_DIALECT_CONVERSION_FOLDING_MODE_BEFORE_PATTERNS, MLIR_DIALECT_CONVERSION_FOLDING_MODE_NEVER, and unwrap().
| bool mlirConversionConfigIsBuildMaterializationsEnabled | ( | MlirConversionConfig | config | ) |
Check if building materializations during conversion is enabled.
Definition at line 543 of file Rewrite.cpp.
References unwrap().
| void mlirConversionConfigSetFoldingMode | ( | MlirConversionConfig | config, |
| MlirDialectConversionFoldingMode | mode ) |
Set the folding mode for the given ConversionConfig.
Definition at line 509 of file Rewrite.cpp.
References MLIR_DIALECT_CONVERSION_FOLDING_MODE_AFTER_PATTERNS, MLIR_DIALECT_CONVERSION_FOLDING_MODE_BEFORE_PATTERNS, MLIR_DIALECT_CONVERSION_FOLDING_MODE_NEVER, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionConfig::isBuildMaterializationsEnabled().
| MlirRewritePattern mlirConversionPatternAsRewritePattern | ( | MlirConversionPattern | pattern | ) |
Cast the ConversionPattern to a RewritePattern.
Definition at line 948 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().
| MlirTypeConverter mlirConversionPatternGetTypeConverter | ( | MlirConversionPattern | pattern | ) |
Get the type converter used by this conversion pattern.
Definition at line 943 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionPattern::getTypeConverter().
| MlirPatternRewriter mlirConversionPatternRewriterAsPatternRewriter | ( | MlirConversionPatternRewriter | rewriter | ) |
ConversionPatternRewriter API.
Cast the ConversionPatternRewriter to a PatternRewriter
Definition at line 560 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionPatternRewriter::PyConversionPatternRewriter().
| MlirLogicalResult mlirConversionPatternRewriterConvertRegionTypes | ( | MlirConversionPatternRewriter | rewriter, |
| MlirRegion | region, | ||
| MlirTypeConverter | typeConverter ) |
Apply a signature conversion to each block in the given region.
Definition at line 565 of file Rewrite.cpp.
| void mlirConversionPatternRewriterReplaceOpWithMultiple | ( | MlirConversionPatternRewriter | rewriter, |
| MlirOperation | op, | ||
| intptr_t | nRanges, | ||
| intptr_t * | rangeSizes, | ||
| MlirValue * | values ) |
Replace the given operation with multiple value ranges – one range per result of op – and erase it.
nRanges must equal the number of results of op. rangeSizes[i] is the number of values in the i-th range, and values is the flat concatenation of all ranges (its length is the sum of rangeSizes[0..nRanges)).
Definition at line 572 of file Rewrite.cpp.
| void mlirConversionTargetAddDynamicallyLegalDialect | ( | MlirConversionTarget | target, |
| MlirStringRef | dialectName, | ||
| MlirConversionTargetDynamicLegalityCallback | callback, | ||
| void * | userData ) |
Register the given dialect as dynamically legal, with a callback to determine per-instance legality for all operations in the dialect.
The callback must not be NULL.
Definition at line 654 of file Rewrite.cpp.
| void mlirConversionTargetAddDynamicallyLegalOp | ( | MlirConversionTarget | target, |
| MlirStringRef | opName, | ||
| MlirConversionTargetDynamicLegalityCallback | callback, | ||
| void * | userData ) |
Register the given operation as dynamically legal, with a callback to determine per-instance legality.
The callback must not be NULL.
Definition at line 644 of file Rewrite.cpp.
| void mlirConversionTargetAddIllegalDialect | ( | MlirConversionTarget | target, |
| MlirStringRef | dialectName ) |
Register the operations of the given dialect as illegal.
Definition at line 618 of file Rewrite.cpp.
References target, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::addIllegalDialect().
| void mlirConversionTargetAddIllegalOp | ( | MlirConversionTarget | target, |
| MlirStringRef | opName ) |
Register the given operations as illegal.
Definition at line 607 of file Rewrite.cpp.
References getContext(), target, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::addIllegalOp().
| void mlirConversionTargetAddLegalDialect | ( | MlirConversionTarget | target, |
| MlirStringRef | dialectName ) |
Register the operations of the given dialect as legal.
Definition at line 613 of file Rewrite.cpp.
References target, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::addLegalDialect().
| void mlirConversionTargetAddLegalOp | ( | MlirConversionTarget | target, |
| MlirStringRef | opName ) |
Register the given operations as legal.
Definition at line 601 of file Rewrite.cpp.
References getContext(), target, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::addLegalOp().
| MlirConversionTarget mlirConversionTargetCreate | ( | MlirContext | context | ) |
ConversionTarget API.
Create an empty ConversionTarget.
Definition at line 593 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::PyConversionTarget().
| void mlirConversionTargetDestroy | ( | MlirConversionTarget | target | ) |
Destroy the given ConversionTarget.
Definition at line 597 of file Rewrite.cpp.
References target, and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionTarget::~PyConversionTarget().
| void mlirConversionTargetMarkOpRecursivelyLegal | ( | MlirConversionTarget | target, |
| MlirStringRef | opName, | ||
| MlirConversionTargetDynamicLegalityCallback | callback, | ||
| void * | userData ) |
Mark the given operation as recursively legal.
The optional callback (may be NULL) determines whether a specific instance is recursively legal; a NULL callback marks the operation as unconditionally recursively legal.
Definition at line 662 of file Rewrite.cpp.
| void mlirConversionTargetMarkUnknownOpDynamicallyLegal | ( | MlirConversionTarget | target, |
| MlirConversionTargetDynamicLegalityCallback | callback, | ||
| void * | userData ) |
Mark unknown operations as dynamically legal, with a callback.
The callback must not be NULL.
Definition at line 673 of file Rewrite.cpp.
| MlirFrozenRewritePatternSet mlirFreezeRewritePattern | ( | MlirRewritePatternSet | set | ) |
RewritePatternSet and FrozenRewritePatternSet API.
FrozenRewritePatternSet API.
Definition at line 312 of file Rewrite.cpp.
| void mlirFrozenRewritePatternSetDestroy | ( | MlirFrozenRewritePatternSet | set | ) |
Destroy the given MlirFrozenRewritePatternSet.
Definition at line 318 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyFrozenRewritePatternSet::~PyFrozenRewritePatternSet().
| MlirGreedyRewriteDriverConfig mlirGreedyRewriteDriverConfigCreate | ( | void | ) |
GreedyRewriteDriverConfig API.
Creates a greedy rewrite driver configuration with default settings.
Definition at line 336 of file Rewrite.cpp.
References wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::setUseTopDownTraversal().
| void mlirGreedyRewriteDriverConfigDestroy | ( | MlirGreedyRewriteDriverConfig | config | ) |
Destroys a greedy rewrite driver configuration.
Definition at line 340 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyConversionConfig::setFoldingMode().
| void mlirGreedyRewriteDriverConfigEnableConstantCSE | ( | MlirGreedyRewriteDriverConfig | config, |
| bool | enable ) |
Enables or disables constant CSE.
Definition at line 400 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::enableConstantCSE(), and unwrap().
| void mlirGreedyRewriteDriverConfigEnableFolding | ( | MlirGreedyRewriteDriverConfig | config, |
| bool | enable ) |
Enables or disables folding during greedy rewriting.
Definition at line 360 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::enableFolding(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::getMaxNumRewrites().
| int64_t mlirGreedyRewriteDriverConfigGetMaxIterations | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets the maximum number of iterations for the greedy rewrite driver.
Definition at line 405 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::getMaxIterations(), and unwrap().
| int64_t mlirGreedyRewriteDriverConfigGetMaxNumRewrites | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets the maximum number of rewrites within an iteration.
Definition at line 410 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::getMaxNumRewrites(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::isConstantCSEEnabled().
| MlirGreedySimplifyRegionLevel mlirGreedyRewriteDriverConfigGetRegionSimplificationLevel | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets the region simplification level.
Definition at line 440 of file Rewrite.cpp.
References mlir::Aggressive, mlir::Disabled, mlir::GreedyRewriteConfig::getRegionSimplificationLevel(), MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_AGGRESSIVE, MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_DISABLED, MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_NORMAL, mlir::Normal, and unwrap().
| MlirGreedyRewriteStrictness mlirGreedyRewriteDriverConfigGetStrictness | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets the strictness level for the greedy rewrite driver.
Definition at line 425 of file Rewrite.cpp.
References mlir::AnyOp, mlir::ExistingAndNewOps, mlir::ExistingOps, mlir::GreedyRewriteConfig::getStrictness(), MLIR_GREEDY_REWRITE_STRICTNESS_ANY_OP, MLIR_GREEDY_REWRITE_STRICTNESS_EXISTING_AND_NEW_OPS, MLIR_GREEDY_REWRITE_STRICTNESS_EXISTING_OPS, and unwrap().
| bool mlirGreedyRewriteDriverConfigGetUseTopDownTraversal | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets whether top-down traversal is used for initial worklist population.
Definition at line 415 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::getUseTopDownTraversal(), and unwrap().
| bool mlirGreedyRewriteDriverConfigIsConstantCSEEnabled | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets whether constant CSE is enabled.
Definition at line 455 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::isConstantCSEEnabled(), and unwrap().
| bool mlirGreedyRewriteDriverConfigIsFoldingEnabled | ( | MlirGreedyRewriteDriverConfig | config | ) |
Gets whether folding is enabled during greedy rewriting.
Definition at line 420 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::isFoldingEnabled(), and unwrap().
| void mlirGreedyRewriteDriverConfigSetMaxIterations | ( | MlirGreedyRewriteDriverConfig | config, |
| int64_t | maxIterations ) |
Sets the maximum number of iterations for the greedy rewrite driver.
Use -1 for no limit.
Definition at line 345 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::setMaxIterations(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::setRegionSimplificationLevel().
| void mlirGreedyRewriteDriverConfigSetMaxNumRewrites | ( | MlirGreedyRewriteDriverConfig | config, |
| int64_t | maxNumRewrites ) |
Sets the maximum number of rewrites within an iteration.
Use -1 for no limit.
Definition at line 350 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::setMaxNumRewrites(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::enableConstantCSE().
| void mlirGreedyRewriteDriverConfigSetRegionSimplificationLevel | ( | MlirGreedyRewriteDriverConfig | config, |
| MlirGreedySimplifyRegionLevel | level ) |
Sets the region simplification level.
Definition at line 383 of file Rewrite.cpp.
References mlir::Aggressive, mlir::Disabled, MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_AGGRESSIVE, MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_DISABLED, MLIR_GREEDY_SIMPLIFY_REGION_LEVEL_NORMAL, mlir::Normal, mlir::GreedyRewriteConfig::setRegionSimplificationLevel(), and unwrap().
| void mlirGreedyRewriteDriverConfigSetStrictness | ( | MlirGreedyRewriteDriverConfig | config, |
| MlirGreedyRewriteStrictness | strictness ) |
Sets the strictness level for the greedy rewrite driver.
Definition at line 365 of file Rewrite.cpp.
References mlir::AnyOp, mlir::ExistingAndNewOps, mlir::ExistingOps, MLIR_GREEDY_REWRITE_STRICTNESS_ANY_OP, MLIR_GREEDY_REWRITE_STRICTNESS_EXISTING_AND_NEW_OPS, MLIR_GREEDY_REWRITE_STRICTNESS_EXISTING_OPS, mlir::GreedyRewriteConfig::setStrictness(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::getUseTopDownTraversal().
| void mlirGreedyRewriteDriverConfigSetUseTopDownTraversal | ( | MlirGreedyRewriteDriverConfig | config, |
| bool | useTopDownTraversal ) |
Sets whether to use top-down traversal for the initial population of the worklist.
Definition at line 355 of file Rewrite.cpp.
References mlir::GreedyRewriteConfig::setUseTopDownTraversal(), and unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyGreedyRewriteConfig::getMaxIterations().
| MlirRewriterBase mlirIRRewriterCreate | ( | MlirContext | context | ) |
IRRewriter API.
Create an IRRewriter and transfer ownership to the caller.
Definition at line 295 of file Rewrite.cpp.
| MlirRewriterBase mlirIRRewriterCreateFromOp | ( | MlirOperation | op | ) |
Create an IRRewriter and transfer ownership to the caller.
Additionally set the insertion point before the operation.
Definition at line 299 of file Rewrite.cpp.
| void mlirIRRewriterDestroy | ( | MlirRewriterBase | rewriter | ) |
Takes an IRRewriter owned by the caller and destroys it.
It is the responsibility of the user to only pass an IRRewriter class.
Definition at line 303 of file Rewrite.cpp.
References unwrap().
| MlirConversionPattern mlirOpConversionPatternCreate | ( | MlirStringRef | rootName, |
| unsigned | benefit, | ||
| MlirContext | context, | ||
| MlirTypeConverter | typeConverter, | ||
| MlirConversionPatternCallbacks | callbacks, | ||
| void * | userData, | ||
| size_t | nGeneratedNames, | ||
| MlirStringRef * | generatedNames ) |
Create a conversion pattern that matches the operation with the given rootName, corresponding to mlir::OpConversionPattern.
Definition at line 929 of file Rewrite.cpp.
References unwrap(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().
| MlirRewritePattern mlirOpRewritePatternCreate | ( | MlirStringRef | rootName, |
| unsigned | benefit, | ||
| MlirContext | context, | ||
| MlirRewritePatternCallbacks | callbacks, | ||
| void * | userData, | ||
| size_t | nGeneratedNames, | ||
| MlirStringRef * | generatedNames ) |
Create a rewrite pattern that matches the operation with the given rootName, corresponding to mlir::OpRewritePattern.
Definition at line 989 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::add().
| MlirRewriterBase mlirPatternRewriterAsBase | ( | MlirPatternRewriter | rewriter | ) |
PatternRewriter API.
Cast the PatternRewriter to a RewriterBase
Definition at line 552 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyPatternRewriter::PyPatternRewriter().
| void mlirRewritePatternSetAdd | ( | MlirRewritePatternSet | set, |
| MlirRewritePattern | pattern ) |
Add the given MlirRewritePattern into a MlirRewritePatternSet.
Note that the ownership of the pattern is transferred to the set after this call.
Definition at line 1019 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::add(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().
| MlirRewritePatternSet mlirRewritePatternSetCreate | ( | MlirContext | context | ) |
RewritePatternSet API.
Create an empty MlirRewritePatternSet.
Definition at line 1007 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::PyRewritePatternSet().
| void mlirRewritePatternSetDestroy | ( | MlirRewritePatternSet | set | ) |
Destruct the given MlirRewritePatternSet.
Definition at line 1015 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::~PyRewritePatternSet().
| MlirContext mlirRewritePatternSetGetContext | ( | MlirRewritePatternSet | set | ) |
Get the context associated with a MlirRewritePatternSet.
Definition at line 1011 of file Rewrite.cpp.
References getContext(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::add(), and mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewritePatternSet::addConversion().
| void mlirRewriterBaseCancelOpModification | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
This method cancels a pending in-place modification.
This can only be called on operations that were provided to a call to startOpModification.
Definition at line 237 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseClearInsertionPoint | ( | MlirRewriterBase | rewriter | ) |
Insertion points methods.
Reset the insertion point to no location. Creating an operation without a set insertion point is an error, but this can still be useful when the current insertion point a builder refers to is being removed.
Definition at line 42 of file Rewrite.cpp.
References unwrap().
| MlirOperation mlirRewriterBaseClone | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Creates a deep copy of the specified operation.
Definition at line 140 of file Rewrite.cpp.
References mlir::clone(), unwrap(), and wrap().
| void mlirRewriterBaseCloneRegionBefore | ( | MlirRewriterBase | rewriter, |
| MlirRegion | region, | ||
| MlirBlock | before ) |
Clone the blocks that belong to "region" before the given position in another region "parent".
Definition at line 156 of file Rewrite.cpp.
References unwrap().
| MlirOperation mlirRewriterBaseCloneWithMapping | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| MlirIRMapping | mapping ) |
Clones the given operation using the rewriter and the provided IRMapping.
The mapping is updated with the results of the cloned operation.
Definition at line 150 of file Rewrite.cpp.
References mlir::clone(), unwrap(), and wrap().
| MlirOperation mlirRewriterBaseCloneWithoutRegions | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Creates a deep copy of this operation but keep the operation regions empty.
Definition at line 145 of file Rewrite.cpp.
References mlir::cloneWithoutRegions(), unwrap(), and wrap().
| MlirBlock mlirRewriterBaseCreateBlockBefore | ( | MlirRewriterBase | rewriter, |
| MlirBlock | insertBefore, | ||
| intptr_t | nArgTypes, | ||
| MlirType const * | argTypes, | ||
| MlirLocation const * | locations ) |
Block and operation creation/insertion/cloning.
Add new block with 'argTypes' arguments and set the insertion point to the end of it. The block is placed before 'insertBefore'. locs contains the locations of the inserted arguments, and should match the size of argTypes.
Definition at line 120 of file Rewrite.cpp.
References unwrap(), unwrapList(), and wrap().
| void mlirRewriterBaseEraseBlock | ( | MlirRewriterBase | rewriter, |
| MlirBlock | block ) |
Erases a block along with all operations inside it.
Definition at line 189 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseEraseOp | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Erases an operation that is known to have no uses.
Definition at line 185 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::bind().
| void mlirRewriterBaseFinalizeOpModification | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
This method is used to signal the end of an in-place modification of the given operation.
This can only be called on operations that were provided to a call to startOpModification.
Definition at line 232 of file Rewrite.cpp.
References unwrap().
| MlirBlock mlirRewriterBaseGetBlock | ( | MlirRewriterBase | rewriter | ) |
Returns the current block of the rewriter.
Definition at line 75 of file Rewrite.cpp.
| MlirContext mlirRewriterBaseGetContext | ( | MlirRewriterBase | rewriter | ) |
RewriterBase API inherited from OpBuilder.
Get the MLIR context referenced by the rewriter.
Definition at line 34 of file Rewrite.cpp.
References getContext(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::PyRewriterBase().
| MlirBlock mlirRewriterBaseGetInsertionBlock | ( | MlirRewriterBase | rewriter | ) |
Return the block the current insertion point belongs to.
Note that the insertion point is not necessarily the end of the block.
Definition at line 71 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::getInsertionPoint().
| MlirOperation mlirRewriterBaseGetOperationAfterInsertion | ( | MlirRewriterBase | rewriter | ) |
Returns the operation right after the current insertion point of the rewriter.
A null MlirOperation will be returned
Definition at line 80 of file Rewrite.cpp.
References mlir::Block::end(), mlir::OpBuilder::getInsertionBlock(), mlir::OpBuilder::getInsertionPoint(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::getInsertionPoint().
| void mlirRewriterBaseInlineBlockBefore | ( | MlirRewriterBase | rewriter, |
| MlirBlock | source, | ||
| MlirOperation | op, | ||
| intptr_t | nArgValues, | ||
| MlirValue const * | argValues ) |
Inline the operations of block 'source' before the operation 'op'.
The source block will be deleted and must have no uses. 'argValues' is used to replace the block arguments of 'source'
The source block must have no successors. Otherwise, the resulting IR would have unreachable operations.
Definition at line 193 of file Rewrite.cpp.
References unwrap(), and unwrapList().
| void mlirRewriterBaseInlineRegionBefore | ( | MlirRewriterBase | rewriter, |
| MlirRegion | region, | ||
| MlirBlock | before ) |
RewriterBase API.
Move the blocks that belong to "region" before the given position in another region "parent". The two regions must be different. The caller is responsible for creating or updating the operation transferring flow of control to the region and passing it the correct block arguments.
Definition at line 166 of file Rewrite.cpp.
References unwrap().
| MlirOperation mlirRewriterBaseInsert | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Insert the given operation at the current insertion point and return it.
Definition at line 133 of file Rewrite.cpp.
| void mlirRewriterBaseMergeBlocks | ( | MlirRewriterBase | rewriter, |
| MlirBlock | source, | ||
| MlirBlock | dest, | ||
| intptr_t | nArgValues, | ||
| MlirValue const * | argValues ) |
Inline the operations of block 'source' into the end of block 'dest'.
The source block will be deleted and must have no uses. 'argValues' is used to replace the block arguments of 'source'
The dest block must have no successors. Otherwise, the resulting IR would have unreachable operation.
Definition at line 204 of file Rewrite.cpp.
References unwrap(), and unwrapList().
| void mlirRewriterBaseMoveBlockBefore | ( | MlirRewriterBase | rewriter, |
| MlirBlock | block, | ||
| MlirBlock | existingBlock ) |
Unlink this block and insert it right before existingBlock.
Definition at line 222 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseMoveOpAfter | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| MlirOperation | existingOp ) |
Unlink this operation from its current block and insert it right after existingOp which may be in the same or another block in the same function.
Definition at line 217 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseMoveOpBefore | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| MlirOperation | existingOp ) |
Unlink this operation from its current block and insert it right before existingOp which may be in the same or another block in the same function.
Definition at line 212 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseReplaceAllOpUsesWithOperation | ( | MlirRewriterBase | rewriter, |
| MlirOperation | from, | ||
| MlirOperation | to ) |
Find uses of from and replace them with to.
Also notify the listener about every in-place op modification (for every use that was replaced) and that the from operation is about to be replaced.
Definition at line 267 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseReplaceAllOpUsesWithValueRange | ( | MlirRewriterBase | rewriter, |
| MlirOperation | from, | ||
| intptr_t | nTo, | ||
| MlirValue const * | to ) |
Find uses of from and replace them with to.
Also notify the listener about every in-place op modification (for every use that was replaced) and that the from operation is about to be replaced.
Definition at line 258 of file Rewrite.cpp.
References unwrap(), and unwrapList().
| void mlirRewriterBaseReplaceAllUsesExcept | ( | MlirRewriterBase | rewriter, |
| MlirValue | from, | ||
| MlirValue | to, | ||
| MlirOperation | exceptedUser ) |
Find uses of from and replace them with to except if the user is exceptedUser.
Also notify the listener about every in-place op modification (for every use that was replaced).
Definition at line 284 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseReplaceAllUsesWith | ( | MlirRewriterBase | rewriter, |
| MlirValue | from, | ||
| MlirValue | to ) |
Find uses of from and replace them with to.
Also notify the listener about every in-place op modification (for every use that was replaced).
Definition at line 242 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseReplaceAllValueRangeUsesWith | ( | MlirRewriterBase | rewriter, |
| intptr_t | nValues, | ||
| MlirValue const * | from, | ||
| MlirValue const * | to ) |
Find uses of from and replace them with to.
Also notify the listener about every in-place op modification (for every use that was replaced).
Definition at line 247 of file Rewrite.cpp.
References unwrap(), and unwrapList().
| void mlirRewriterBaseReplaceOpUsesWithinBlock | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| intptr_t | nNewValues, | ||
| MlirValue const * | newValues, | ||
| MlirBlock | block ) |
Find uses of from within block and replace them with to.
Also notify the listener about every in-place op modification (for every use that was replaced). The optional allUsesReplaced flag is set to "true" if all uses were replaced.
Definition at line 273 of file Rewrite.cpp.
References unwrap(), and unwrapList().
| void mlirRewriterBaseReplaceOpWithOperation | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| MlirOperation | newOp ) |
Replace the results of the given (original) operation with the specified new op (replacement).
The result types of the two ops must match. The original op is erased.
Definition at line 179 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::bind().
| void mlirRewriterBaseReplaceOpWithValues | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op, | ||
| intptr_t | nValues, | ||
| MlirValue const * | values ) |
Replace the results of the given (original) operation with the specified list of values (replacements).
The result types of the given op and the replacements must match. The original op is erased.
Definition at line 171 of file Rewrite.cpp.
References unwrap(), and unwrapList().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyRewriterBase< DerivedTy >::bind().
| void mlirRewriterBaseRestoreInsertionPoint | ( | MlirRewriterBase | rewriter, |
| MlirRewriterBaseInsertPoint | insertPoint ) |
Restores a previously saved insertion point.
Definition at line 102 of file Rewrite.cpp.
References MlirRewriterBaseInsertPoint::block, mlirBlockIsNull(), MlirRewriterBaseInsertPoint::operationAfter, and unwrap().
| MlirRewriterBaseInsertPoint mlirRewriterBaseSaveInsertionPoint | ( | MlirRewriterBase | rewriter | ) |
Returns the current insertion point of the rewriter so that it can be restored later with mlirRewriterBaseRestoreInsertionPoint.
Definition at line 91 of file Rewrite.cpp.
References mlir::Block::end(), mlir::OpBuilder::InsertPoint::getBlock(), mlir::OpBuilder::InsertPoint::getPoint(), mlir::OpBuilder::InsertPoint::isSet(), unwrap(), and wrap().
| void mlirRewriterBaseSetInsertionPointAfter | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Sets the insertion point to the node after the specified operation, which will cause subsequent insertions to go right after it.
Definition at line 51 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseSetInsertionPointAfterValue | ( | MlirRewriterBase | rewriter, |
| MlirValue | value ) |
Sets the insertion point to the node after the specified value.
If value has a defining operation, sets the insertion point to the node after such defining operation. This will cause subsequent insertions to go right after it. Otherwise, value is a BlockArgument. Sets the insertion point to the start of its block.
Definition at line 56 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseSetInsertionPointBefore | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
Sets the insertion point to the specified operation, which will cause subsequent insertions to go right before it.
Definition at line 46 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseSetInsertionPointToEnd | ( | MlirRewriterBase | rewriter, |
| MlirBlock | block ) |
Sets the insertion point to the end of the specified block.
Definition at line 66 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseSetInsertionPointToStart | ( | MlirRewriterBase | rewriter, |
| MlirBlock | block ) |
Sets the insertion point to the start of the specified block.
Definition at line 61 of file Rewrite.cpp.
References unwrap().
| void mlirRewriterBaseStartOpModification | ( | MlirRewriterBase | rewriter, |
| MlirOperation | op ) |
This method is used to notify the rewriter that an in-place operation modification is about to happen.
A call to this function must be followed by a call to either finalizeOpModification or cancelOpModification. This is a minor efficiency win (it avoids creating a new operation and removing the old one) but also often allows simpler code in the client.
Definition at line 227 of file Rewrite.cpp.
References unwrap().
| void mlirTypeConverterAdd1ToNConversion | ( | MlirTypeConverter | typeConverter, |
| MlirTypeConverter1ToNConversionCallback | convertType, | ||
| void * | userData ) |
Add a 1:N type conversion function to the given TypeConverter.
Definition at line 724 of file Rewrite.cpp.
References MlirTypeConverterConversionStatusDeclined, MlirTypeConverterConversionStatusFailure, MlirTypeConverterConversionStatusSuccess, success(), unwrap(), and wrap().
| void mlirTypeConverterAdd1ToNTargetMaterialization | ( | MlirTypeConverter | typeConverter, |
| MlirTypeConverter1ToNTargetMaterializationCallback | callback, | ||
| void * | userData ) |
Register a 1:N target materialization with the given TypeConverter.
Definition at line 853 of file Rewrite.cpp.
References unwrap().
| void mlirTypeConverterAddConversion | ( | MlirTypeConverter | typeConverter, |
| MlirTypeConverterConversionCallback | convertType, | ||
| void * | userData ) |
Add a type conversion function to the given TypeConverter.
Definition at line 693 of file Rewrite.cpp.
References MlirTypeConverterConversionStatusDeclined, MlirTypeConverterConversionStatusFailure, MlirTypeConverterConversionStatusSuccess, success(), unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::addConversion().
| void mlirTypeConverterAddSourceMaterialization | ( | MlirTypeConverter | typeConverter, |
| MlirTypeConverterSourceMaterializationCallback | callback, | ||
| void * | userData ) |
Register a source materialization with the given TypeConverter.
This is invoked when a replacement value must be converted back to its original source type because some uses persist beyond the main conversion.
Definition at line 835 of file Rewrite.cpp.
References unwrap().
| void mlirTypeConverterAddTargetMaterialization | ( | MlirTypeConverter | typeConverter, |
| MlirTypeConverterTargetMaterializationCallback | callback, | ||
| void * | userData ) |
Register a target materialization with the given TypeConverter.
This is invoked when a value must be converted to a target type according to a pattern's type converter.
Definition at line 844 of file Rewrite.cpp.
References unwrap().
| void mlirTypeConverterConversionResultsAppend | ( | MlirTypeConverterConversionResults | results, |
| MlirType | type ) |
Append a converted result type to the given 1:N conversion result accumulator.
Definition at line 719 of file Rewrite.cpp.
References MlirTypeConverterConversionResults::ptr, push_back(), and unwrap().
| MlirType mlirTypeConverterConvertType | ( | MlirTypeConverter | typeConverter, |
| MlirType | type ) |
Convert the given type using the given TypeConverter.
This is the 1:1 convenience form: it returns the single converted type, or a null MlirType on failure or if the type converts to anything other than exactly one type (e.g. a 1:N conversion registered via mlirTypeConverterAdd1ToNConversion, or an erasure to zero types).
Definition at line 755 of file Rewrite.cpp.
References unwrap(), and wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::convertType().
| MlirTypeConverter mlirTypeConverterCreate | ( | void | ) |
TypeConverter API.
Create a TypeConverter.
Definition at line 685 of file Rewrite.cpp.
References wrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::PyTypeConverter().
| void mlirTypeConverterDestroy | ( | MlirTypeConverter | typeConverter | ) |
Destroy the given TypeConverter.
Definition at line 689 of file Rewrite.cpp.
References unwrap().
Referenced by mlir::python::MLIR_BINDINGS_PYTHON_DOMAIN::PyTypeConverter::~PyTypeConverter().
| void mlirWalkAndApplyPatterns | ( | MlirOperation | op, |
| MlirFrozenRewritePatternSet | patterns ) |
Applies the given patterns to the given op by a fast walk-based pattern rewrite driver.
Definition at line 476 of file Rewrite.cpp.
References unwrap(), and mlir::walkAndApplyPatterns().
|
inline |
GreedyRewriteDriverConfig API.
Definition at line 327 of file Rewrite.cpp.
Referenced by mlirApplyFullConversion(), mlirApplyPartialConversion(), mlirApplyPatternsAndFoldGreedily(), mlirApplyPatternsAndFoldGreedilyWithOp(), mlirConversionConfigDestroy(), mlirConversionConfigEnableBuildMaterializations(), mlirConversionConfigGetFoldingMode(), mlirConversionConfigIsBuildMaterializationsEnabled(), mlirConversionConfigSetFoldingMode(), mlirConversionPatternAsRewritePattern(), mlirConversionPatternGetTypeConverter(), mlirConversionPatternRewriterAsPatternRewriter(), mlirConversionPatternRewriterConvertRegionTypes(), mlirConversionPatternRewriterReplaceOpWithMultiple(), mlirConversionTargetAddDynamicallyLegalDialect(), mlirConversionTargetAddDynamicallyLegalOp(), mlirConversionTargetAddIllegalDialect(), mlirConversionTargetAddIllegalOp(), mlirConversionTargetAddLegalDialect(), mlirConversionTargetAddLegalOp(), mlirConversionTargetCreate(), mlirConversionTargetDestroy(), mlirConversionTargetMarkOpRecursivelyLegal(), mlirConversionTargetMarkUnknownOpDynamicallyLegal(), mlirFreezeRewritePattern(), mlirFrozenRewritePatternSetDestroy(), mlirGreedyRewriteDriverConfigDestroy(), mlirGreedyRewriteDriverConfigEnableConstantCSE(), mlirGreedyRewriteDriverConfigEnableFolding(), mlirGreedyRewriteDriverConfigGetMaxIterations(), mlirGreedyRewriteDriverConfigGetMaxNumRewrites(), mlirGreedyRewriteDriverConfigGetRegionSimplificationLevel(), mlirGreedyRewriteDriverConfigGetStrictness(), mlirGreedyRewriteDriverConfigGetUseTopDownTraversal(), mlirGreedyRewriteDriverConfigIsConstantCSEEnabled(), mlirGreedyRewriteDriverConfigIsFoldingEnabled(), mlirGreedyRewriteDriverConfigSetMaxIterations(), mlirGreedyRewriteDriverConfigSetMaxNumRewrites(), mlirGreedyRewriteDriverConfigSetRegionSimplificationLevel(), mlirGreedyRewriteDriverConfigSetStrictness(), mlirGreedyRewriteDriverConfigSetUseTopDownTraversal(), mlirIRRewriterCreate(), mlirIRRewriterCreateFromOp(), mlirIRRewriterDestroy(), mlirOpConversionPatternCreate(), mlirOpRewritePatternCreate(), mlirPatternRewriterAsBase(), mlirRewritePatternSetAdd(), mlirRewritePatternSetCreate(), mlirRewritePatternSetDestroy(), mlirRewritePatternSetGetContext(), mlirRewriterBaseCancelOpModification(), mlirRewriterBaseClearInsertionPoint(), mlirRewriterBaseClone(), mlirRewriterBaseCloneRegionBefore(), mlirRewriterBaseCloneWithMapping(), mlirRewriterBaseCloneWithoutRegions(), mlirRewriterBaseCreateBlockBefore(), mlirRewriterBaseEraseBlock(), mlirRewriterBaseEraseOp(), mlirRewriterBaseFinalizeOpModification(), mlirRewriterBaseGetBlock(), mlirRewriterBaseGetContext(), mlirRewriterBaseGetInsertionBlock(), mlirRewriterBaseGetOperationAfterInsertion(), mlirRewriterBaseInlineBlockBefore(), mlirRewriterBaseInlineRegionBefore(), mlirRewriterBaseInsert(), mlirRewriterBaseMergeBlocks(), mlirRewriterBaseMoveBlockBefore(), mlirRewriterBaseMoveOpAfter(), mlirRewriterBaseMoveOpBefore(), mlirRewriterBaseReplaceAllOpUsesWithOperation(), mlirRewriterBaseReplaceAllOpUsesWithValueRange(), mlirRewriterBaseReplaceAllUsesExcept(), mlirRewriterBaseReplaceAllUsesWith(), mlirRewriterBaseReplaceAllValueRangeUsesWith(), mlirRewriterBaseReplaceOpUsesWithinBlock(), mlirRewriterBaseReplaceOpWithOperation(), mlirRewriterBaseReplaceOpWithValues(), mlirRewriterBaseRestoreInsertionPoint(), mlirRewriterBaseSaveInsertionPoint(), mlirRewriterBaseSetInsertionPointAfter(), mlirRewriterBaseSetInsertionPointAfterValue(), mlirRewriterBaseSetInsertionPointBefore(), mlirRewriterBaseSetInsertionPointToEnd(), mlirRewriterBaseSetInsertionPointToStart(), mlirRewriterBaseStartOpModification(), mlirTypeConverterAdd1ToNConversion(), mlirTypeConverterAdd1ToNTargetMaterialization(), mlirTypeConverterAddConversion(), mlirTypeConverterAddSourceMaterialization(), mlirTypeConverterAddTargetMaterialization(), mlirTypeConverterConversionResultsAppend(), mlirTypeConverterConvertType(), mlirTypeConverterDestroy(), and mlirWalkAndApplyPatterns().
|
inline |
Definition at line 332 of file Rewrite.cpp.
Referenced by mlirApplyFullConversion(), mlirApplyPartialConversion(), mlirApplyPatternsAndFoldGreedily(), mlirApplyPatternsAndFoldGreedilyWithOp(), mlirConversionConfigCreate(), mlirConversionPatternAsRewritePattern(), mlirConversionPatternGetTypeConverter(), mlirConversionPatternRewriterAsPatternRewriter(), mlirConversionPatternRewriterConvertRegionTypes(), mlirConversionTargetCreate(), mlirFreezeRewritePattern(), mlirGreedyRewriteDriverConfigCreate(), mlirIRRewriterCreate(), mlirIRRewriterCreateFromOp(), mlirOpConversionPatternCreate(), mlirOpRewritePatternCreate(), mlirPatternRewriterAsBase(), mlirRewritePatternSetCreate(), mlirRewritePatternSetGetContext(), mlirRewriterBaseClone(), mlirRewriterBaseCloneWithMapping(), mlirRewriterBaseCloneWithoutRegions(), mlirRewriterBaseCreateBlockBefore(), mlirRewriterBaseGetBlock(), mlirRewriterBaseGetContext(), mlirRewriterBaseGetInsertionBlock(), mlirRewriterBaseGetOperationAfterInsertion(), mlirRewriterBaseInsert(), mlirRewriterBaseSaveInsertionPoint(), mlirTypeConverterAdd1ToNConversion(), mlirTypeConverterAddConversion(), mlirTypeConverterConvertType(), and mlirTypeConverterCreate().