9 #ifndef MLIR_DIALECT_TENSOR_IR_TENSOR_H_ 10 #define MLIR_DIALECT_TENSOR_IR_TENSOR_H_ 35 OpBuilder &b, Location loc);
43 #include "mlir/Dialect/Tensor/IR/TensorOpsDialect.h.inc" 49 #define GET_OP_CLASSES 50 #include "mlir/Dialect/Tensor/IR/TensorOps.h.inc" 118 RankedTensorType targetType);
125 Value tensor, Value dest);
134 [](ExtractSliceOp op) {
143 #endif // MLIR_DIALECT_TENSOR_IR_TENSOR_H_
Include the generated interface declarations.
LogicalResult foldTensorCast(Operation *op)
Performs folding of any operand of op if it comes from a tensor::CastOp that can be folded...
bool preservesStaticInformation(Type source, Type target)
Returns true if target is a ranked tensor type that preserves static information available in the sou...
std::function< bool(ExtractSliceOp)> ControlConstantExtractSliceFusionFn
Function to control the folding of constant and extract slice.
Value createCanonicalRankReducingExtractSliceOp(OpBuilder &b, Location loc, Value tensor, RankedTensorType targetType)
Create a rank-reducing ExtractSliceOp @[0 .
bool canFoldIntoConsumerOp(CastOp castOp)
Determines whether tensor::CastOp casts to a more dynamic version of the source tensor.
SmallVector< Range, 8 > getOrCreateRanges(OffsetSizeAndStrideOpInterface op, OpBuilder &b, Location loc)
Return the list of Range (i.e.
void populateFoldConstantExtractSlicePatterns(RewritePatternSet &patterns, const ControlConstantExtractSliceFusionFn &controlFn=[](ExtractSliceOp op) { return false;})
Patterns to fold the extract slice op with its constant operand.
bool canFoldIntoProducerOp(CastOp castOp)
Determines whether the tensor::CastOp casts to a more static version of the source tensor...
Value createCanonicalRankReducingInsertSliceOp(OpBuilder &b, Location loc, Value tensor, Value dest)
Create a rank-reducing InsertSliceOp @[0 .