|
MLIR 22.0.0git
|
Namespaces | |
| namespace | arith |
Functions | |
| void | registerAllExtensions (DialectRegistry ®istry) |
| Register all extensions of the func dialect. | |
| void | registerInlinerExtension (DialectRegistry ®istry) |
| Register the extension used to support inlining the func dialect. | |
| void | registerShardingInterfaceExternalModels (DialectRegistry ®istry) |
| void | registerTransformDialectExtension (DialectRegistry ®istry) |
| mlir::FailureOr< mlir::func::FuncOp > | replaceFuncWithNewMapping (mlir::RewriterBase &rewriter, mlir::func::FuncOp funcOp, ArrayRef< int > oldArgIdxToNewArgIdx, ArrayRef< int > oldResIdxToNewResIdx) |
| Creates a new function operation with the same name as the original function operation, but with the arguments mapped according to the oldArgToNewArg and oldResToNewRes. | |
| mlir::func::CallOp | replaceCallOpWithNewMapping (mlir::RewriterBase &rewriter, mlir::func::CallOp callOp, ArrayRef< int > oldArgIdxToNewArgIdx, ArrayRef< int > oldResIdxToNewResIdx) |
| Creates a new call operation with the values as the original call operation, but with the arguments mapped according to the oldArgToNewArg and oldResToNewRes. | |
| mlir::FailureOr< std::pair< mlir::func::FuncOp, mlir::func::CallOp > > | deduplicateArgsOfFuncOp (mlir::RewriterBase &rewriter, mlir::func::FuncOp funcOp, mlir::ModuleOp moduleOp) |
| This utility function examines all call operations within the given moduleOp that target the specified funcOp. | |
| FuncOp | createFnDecl (OpBuilder &b, SymbolOpInterface symTable, StringRef name, FunctionType funcT, bool setPrivate, SymbolTableCollection *symbolTables=nullptr) |
| Look up a FuncOp with signature resultTypes(paramTypes) and name
/ name`. | |
| FailureOr< FuncOp > | lookupOrCreateFnDecl (OpBuilder &b, SymbolOpInterface symTable, StringRef name, TypeRange paramTypes, SymbolTableCollection *symbolTables=nullptr, Type resultType={}) |
| Helper function to look up or create the symbol for a runtime library function with the given parameter types. | |
| func::FuncOp mlir::func::createFnDecl | ( | OpBuilder & | b, |
| SymbolOpInterface | symTable, | ||
| StringRef | name, | ||
| FunctionType | funcT, | ||
| bool | setPrivate, | ||
| SymbolTableCollection * | symbolTables = nullptr ) |
Look up a FuncOp with signature resultTypes(paramTypes) and name / name`.
Return a failure if the FuncOp is found but with a different / signature. FailureOr<FuncOp> lookupFnDecl(SymbolOpInterface symTable, StringRef name, FunctionType funcT, SymbolTableCollection *symbolTables = nullptr);
/ Create a FuncOp decl and insert it into symTable operation. If / symbolTables is provided, then the decl will be inserted into the SymbolTableCollection.
Definition at line 283 of file Utils.cpp.
References b, mlir::SymbolTableCollection::getSymbolTable(), and mlir::SymbolTable::insert().
Referenced by lookupOrCreateFnDecl().
| mlir::FailureOr< std::pair< mlir::func::FuncOp, mlir::func::CallOp > > mlir::func::deduplicateArgsOfFuncOp | ( | mlir::RewriterBase & | rewriter, |
| mlir::func::FuncOp | funcOp, | ||
| mlir::ModuleOp | moduleOp ) |
This utility function examines all call operations within the given moduleOp that target the specified funcOp.
It identifies duplicate operands in the call operations, creates mappings to deduplicate them, and then applies the transformation to both the function and its call sites. For now, it only supports one call operation for the function operation. The function returns a pair containing the new funcOp and the new callOp. Note: after the transformation, the original funcOp and callOp will be erased.
References b.
| FailureOr< func::FuncOp > mlir::func::lookupOrCreateFnDecl | ( | OpBuilder & | b, |
| SymbolOpInterface | symTable, | ||
| StringRef | name, | ||
| TypeRange | paramTypes, | ||
| SymbolTableCollection * | symbolTables = nullptr, | ||
| Type | resultType = {} ) |
Helper function to look up or create the symbol for a runtime library function with the given parameter types.
Returns an int64_t, unless a different result type is specified.
Definition at line 302 of file Utils.cpp.
References b, and createFnDecl().
Referenced by lookupOrCreateBinaryFn(), AbsFOpToAPFloatConversion::matchAndRewrite(), CmpFOpToAPFloatConversion::matchAndRewrite(), FmaOpToAPFloatConversion::matchAndRewrite(), FpToFpConversion< OpTy >::matchAndRewrite(), FpToIntConversion< OpTy >::matchAndRewrite(), IntToFpConversion< OpTy >::matchAndRewrite(), IsOpToAPFloatConversion< OpTy >::matchAndRewrite(), and NegFOpToAPFloatConversion::matchAndRewrite().
| void mlir::func::registerAllExtensions | ( | DialectRegistry & | registry | ) |
Register all extensions of the func dialect.
This should generally only be used by tools, or other use cases that really do want all extensions of the dialect. All other cases should prefer to instead register the specific extensions they intend to take advantage of.
Definition at line 15 of file AllExtensions.cpp.
References registerInlinerExtension(), and registerShardingInterfaceExternalModels().
Referenced by mlir::registerAllExtensions().
| void mlir::func::registerInlinerExtension | ( | DialectRegistry & | registry | ) |
Register the extension used to support inlining the func dialect.
Definition at line 87 of file InlinerExtension.cpp.
References mlir::DialectRegistry::addExtension(), and mlir::MLIRContext::getOrLoadDialect().
Referenced by registerAllExtensions().
| void mlir::func::registerShardingInterfaceExternalModels | ( | DialectRegistry & | registry | ) |
Definition at line 16 of file ShardingExtensions.cpp.
References mlir::DialectRegistry::addExtension().
Referenced by registerAllExtensions().
| void mlir::func::registerTransformDialectExtension | ( | DialectRegistry & | registry | ) |
Definition at line 412 of file FuncTransformOps.cpp.
References mlir::DialectRegistry::addExtensions().
Referenced by mlir::registerAllExtensions().
| mlir::func::CallOp mlir::func::replaceCallOpWithNewMapping | ( | mlir::RewriterBase & | rewriter, |
| mlir::func::CallOp | callOp, | ||
| ArrayRef< int > | oldArgIdxToNewArgIdx, | ||
| ArrayRef< int > | oldResIdxToNewResIdx ) |
Creates a new call operation with the values as the original call operation, but with the arguments mapped according to the oldArgToNewArg and oldResToNewRes.
Note: the method asserts that the oldArgToNewArg and oldResToNewRes maps the whole call operation arguments and results.
| mlir::FailureOr< mlir::func::FuncOp > mlir::func::replaceFuncWithNewMapping | ( | mlir::RewriterBase & | rewriter, |
| mlir::func::FuncOp | funcOp, | ||
| ArrayRef< int > | oldArgIdxToNewArgIdx, | ||
| ArrayRef< int > | oldResIdxToNewResIdx ) |
Creates a new function operation with the same name as the original function operation, but with the arguments mapped according to the oldArgToNewArg and oldResToNewRes.
The funcOp operation must have exactly one block. Returns the new function operation or failure if funcOp doesn't have exactly one block. Note: the method asserts that the oldArgToNewArg and oldResToNewRes maps the whole function arguments and results.