MLIR 22.0.0git
Utils.h File Reference
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/Value.h"
#include "llvm/ADT/ArrayRef.h"

Go to the source code of this file.

Classes

struct  mlir::ArithBuilder
 Helper struct to build simple arithmetic quantities with minimal type inference support. More...
struct  mlir::ArithIndexingBuilder
 ArithBuilder specialized specifically for tensor/memref indexing calculations. More...

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::arith

Typedefs

using mlir::ReassociationIndices = SmallVector<int64_t, 2>

Functions

std::optional< SmallVector< OpFoldResult > > mlir::inferExpandShapeOutputShape (OpBuilder &b, Location loc, ShapedType expandedType, ArrayRef< ReassociationIndices > reassociation, ArrayRef< OpFoldResult > inputShape)
 Infer the output shape for a {memref|tensor}.expand_shape when it is possible to do so.
detail::op_matcher< arith::ConstantIndexOpmlir::matchConstantIndex ()
 Matches a ConstantIndexOp.
llvm::SmallBitVector mlir::getPositionsOfShapeOne (unsigned rank, ArrayRef< int64_t > shape)
Value mlir::getValueOrCreateConstantIntOp (OpBuilder &b, Location loc, OpFoldResult ofr)
 Converts an OpFoldResult to a Value.
Value mlir::getValueOrCreateConstantIndexOp (OpBuilder &b, Location loc, OpFoldResult ofr)
 Converts an OpFoldResult to a Value.
SmallVector< Valuemlir::getValueOrCreateConstantIndexOp (OpBuilder &b, Location loc, ArrayRef< OpFoldResult > valueOrAttrVec)
 Similar to the other overload, but converts multiple OpFoldResults into Values.
Value mlir::getValueOrCreateCastToIndexLike (OpBuilder &b, Location loc, Type targetType, Value value)
 Create a cast from an index-like value (index or integer) to another index-like value.
Value mlir::convertScalarToDtype (OpBuilder &b, Location loc, Value operand, Type toType, bool isUnsignedCast)
 Converts a scalar value operand to type toType.
Value mlir::createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, const APInt &value)
 Create a constant of type type at location loc whose value is value (an APInt or APFloat whose type must match the element type of type).
Value mlir::createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, int64_t value)
Value mlir::createScalarOrSplatConstant (OpBuilder &builder, Location loc, Type type, const APFloat &value)
Type mlir::getType (OpFoldResult ofr)
 Returns the int type of the integer in ofr.
Value mlir::arith::createProduct (OpBuilder &builder, Location loc, ArrayRef< Value > values)
Value mlir::arith::createProduct (OpBuilder &builder, Location loc, ArrayRef< Value > values, Type resultType)
std::optional< FloatType > mlir::arith::parseFloatType (MLIRContext *ctx, StringRef name)
 Map strings to float types.