MLIR 22.0.0git
Tensor.h File Reference

Go to the source code of this file.

Namespaces

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

Macros

#define GET_OP_CLASSES

Typedefs

using mlir::tensor::ControlConstantExtractSliceFusionFn = std::function<bool(ExtractSliceOp)>
 Function to control the folding of constant and extract slice.

Functions

SmallVector< Range, 8 > mlir::getOrCreateRanges (OffsetSizeAndStrideOpInterface op, OpBuilder &b, Location loc)
 Return the list of Range (i.e.
bool mlir::tensor::preservesStaticInformation (Type source, Type target)
 Returns true if target is a ranked tensor type that preserves static information available in the source ranked tensor type.
bool mlir::tensor::canFoldIntoConsumerOp (CastOp castOp)
 Determines whether tensor::CastOp casts to a more dynamic version of the source tensor.
bool mlir::tensor::canFoldIntoProducerOp (CastOp castOp)
 Determines whether the tensor::CastOp casts to a more static version of the source tensor.
bool mlir::tensor::hasFoldableTensorCastOperand (Operation *op)
 Return true if any of the operands of op is a CastOp that can be folded into its consumer, i.e.
SmallVector< Valuemlir::tensor::getUpdatedOperandsAfterCastOpFolding (DestinationStyleOpInterface op, SmallVector< Type > &newResTy)
 Assuming that op contains at least one operand that is a foldable CastOp (i.e.
LogicalResult mlir::tensor::foldTensorCast (Operation *op)
 Performs folding of any operand of op if it comes from a tensor::CastOp that can be folded.
OpFoldResult mlir::tensor::getMixedSize (OpBuilder &builder, Location loc, Value value, int64_t dim)
 Return the dimension of the given tensor value.
SmallVector< OpFoldResultmlir::tensor::getMixedSizes (OpBuilder &builder, Location loc, Value value)
 Return the dimensions of the given tensor value.
Value mlir::tensor::createCanonicalRankReducingExtractSliceOp (OpBuilder &b, Location loc, Value tensor, RankedTensorType targetType)
 Create a rank-reducing ExtractSliceOp @[0 .
Value mlir::tensor::createCanonicalRankReducingInsertSliceOp (OpBuilder &b, Location loc, Value tensor, Value dest)
 Create a rank-reducing InsertSliceOp @[0 .
FailureOr< Valuemlir::tensor::getOrCreateDestination (OpBuilder &b, Location loc, OpResult opResult)
 This is a helper function for DestinationStyleOpInterface.
LogicalResult mlir::tensor::getOrCreateDestinations (OpBuilder &b, Location loc, Operation *op, SmallVector< Value > &result)
 This is a helper function for DestinationStyleOpInterface.
bool mlir::tensor::isSameTypeWithoutEncoding (Type tp1, Type tp2)
 Tests if types are the same when ignoring encoding on ranked tensors.
void mlir::tensor::populateFoldConstantExtractSlicePatterns (RewritePatternSet &patterns, const ControlConstantExtractSliceFusionFn &controlFn=[](ExtractSliceOp op) { return false;})
 Patterns to fold the extract slice op with its constant operand.
void mlir::tensor::populateFoldCollapseExtractPatterns (RewritePatternSet &patterns)
 Patterns to fold extracts of a collapse_shaped tensor to an extract of the source tensor.

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 53 of file Tensor.h.