MLIR
20.0.0git
|
#include "mlir/Transforms/FoldUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/Operation.h"
Go to the source code of this file.
Functions | |
static Region * | getInsertionRegion (DialectInterfaceCollection< DialectFoldInterface > &interfaces, Block *insertionBlock) |
Given an operation, find the parent region that folded constants should be inserted into. More... | |
static Operation * | materializeConstant (Dialect *dialect, OpBuilder &builder, Attribute value, Type type, Location loc) |
A utility function used to materialize a constant for a given attribute and type. More... | |
|
static |
Given an operation, find the parent region that folded constants should be inserted into.
Definition at line 25 of file FoldUtils.cpp.
References mlir::Block::getParent(), and mlir::Region::getParentOp().
Referenced by mlir::OperationFolder::getOrCreateConstant(), mlir::OperationFolder::insertKnownConstant(), and mlir::OperationFolder::notifyRemoval().
|
static |
A utility function used to materialize a constant for a given attribute and type.
On success, a valid constant value is returned. Otherwise, null is returned
Definition at line 50 of file FoldUtils.cpp.
References mlir::OpBuilder::getInsertionPoint(), mlir::m_Constant(), mlir::matchPattern(), and mlir::Dialect::materializeConstant().
Referenced by maybeReplaceWithConstant().