Home
last modified time | relevance | path

Searched refs:reshapeOp (Results 1 – 8 of 8) sorted by relevance

/llvm-project-15.0.7/mlir/include/mlir/Dialect/Utils/
H A DReshapeOpsUtils.h84 static OpFoldResult foldReshapeOp(ReshapeOpTy reshapeOp, in foldReshapeOp() argument
89 reshapeOp.getSrc().template getDefiningOp<InverseReshapeOpTy>(); in foldReshapeOp()
90 if (reshapeSrcOp && reshapeSrcOp.getSrcType() == reshapeOp.getResultType()) in foldReshapeOp()
95 reshapeOp.getResult().getType().template cast<ShapedType>()); in foldReshapeOp()
173 LogicalResult matchAndRewrite(ReshapeOpTy reshapeOp, in matchAndRewrite()
176 reshapeOp.getSrc().template getDefiningOp<ReshapeOpTy>(); in matchAndRewrite()
180 ShapedType resultType = reshapeOp.getResultType(); in matchAndRewrite()
183 hasNonIdentityLayout(reshapeOp.getSrc().getType()) || in matchAndRewrite()
184 hasNonIdentityLayout(reshapeOp.getResult().getType())) in matchAndRewrite()
189 reshapeOp.getReassociationIndices(), in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/Transforms/
H A DElementwiseOpFusion.cpp684 fuseWithReshapeByExpansion(GenericOp genericOp, Operation *reshapeOp, in fuseWithReshapeByExpansion() argument
829 tensor::CollapseShapeOp reshapeOp = in matchAndRewrite() local
831 if (!reshapeOp) in matchAndRewrite()
865 LogicalResult matchAndRewrite(tensor::ExpandShapeOp reshapeOp, in matchAndRewrite()
873 reshapeOp->getOpOperand(0))) in matchAndRewrite()
876 producer, reshapeOp, producer.getOutputOperand(0), rewriter); in matchAndRewrite()
879 rewriter.replaceOp(reshapeOp, *replacementValues); in matchAndRewrite()
1286 auto reshapeOp = builder.create<tensor::CollapseShapeOp>( in getCollapsedOpOperand() local
1288 return reshapeOp.getResult(); in getCollapsedOpOperand()
1449 tensor::ExpandShapeOp reshapeOp = in matchAndRewrite() local
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/IR/
H A DTensorInferTypeOpInterfaceImpl.cpp155 auto reshapeOp = cast<OpTy>(op); in reifyResultShapes() local
157 b, loc, reshapeOp.getSrc(), reshapeOp.getResultType().getShape(), in reifyResultShapes()
158 reshapeOp.getReassociationMaps()); in reifyResultShapes()
H A DTensorOps.cpp894 LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, in matchAndRewrite()
897 if (!matchPattern(reshapeOp.getSrc(), m_Constant(&attr))) in matchAndRewrite()
902 reshapeOp.getResultType(), attr.getRawData()); in matchAndRewrite()
903 rewriter.replaceOpWithNewOp<arith::ConstantOp>(reshapeOp, newAttr); in matchAndRewrite()
913 LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, in matchAndRewrite()
916 reshapeOp.getSrc().template getDefiningOp<FromElementsOp>(); in matchAndRewrite()
920 auto shapedTy = reshapeOp.getType().template cast<ShapedType>(); in matchAndRewrite()
925 rewriter.replaceOpWithNewOp<FromElementsOp>(reshapeOp, reshapeOp.getType(), in matchAndRewrite()
/llvm-project-15.0.7/mlir/lib/Conversion/MemRefToLLVM/
H A DMemRefToLLVM.cpp1109 Type srcType = reshapeOp.getSource().getType(); in matchAndRewrite()
1115 rewriter.replaceOp(reshapeOp, {descriptor}); in matchAndRewrite()
1128 reshapeOp.getResult().getType().cast<MemRefType>(); in convertSourceMemRefToDescriptor()
1136 Location loc = reshapeOp.getLoc(); in convertSourceMemRefToDescriptor()
1156 return rewriter.notifyMatchFailure(reshapeOp, in convertSourceMemRefToDescriptor()
1185 Value shapeOp = reshapeOp.getShape(); in convertSourceMemRefToDescriptor()
1207 Location loc = reshapeOp.getLoc(); in convertSourceMemRefToDescriptor()
1580 MemRefType dstType = reshapeOp.getResultType(); in matchAndRewrite()
1581 MemRefType srcType = reshapeOp.getSrcType(); in matchAndRewrite()
1591 Location loc = reshapeOp->getLoc(); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Linalg/IR/
H A DLinalgOps.cpp500 LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, in matchAndRewrite()
502 auto oldFill = reshapeOp.getSrc().template getDefiningOp<FillOp>(); in matchAndRewrite()
508 loc, reshapeOp.getResultType(), oldFill.output(), in matchAndRewrite()
509 reshapeOp.getReassociation()); in matchAndRewrite()
1326 LogicalResult matchAndRewrite(TensorReshapeOp reshapeOp, in matchAndRewrite()
1328 if (!reshapeOp.getSrc().template getDefiningOp<InitTensorOp>()) in matchAndRewrite()
1330 Location loc = reshapeOp.getLoc(); in matchAndRewrite()
1340 reshapeOp.getResultType().getElementType()); in matchAndRewrite()
1341 if (initTensor.getType() != reshapeOp.getResultType()) { in matchAndRewrite()
1343 reshapeOp, reshapeOp.getResultType(), initTensor); in matchAndRewrite()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Tensor/Transforms/
H A DBufferizableOpInterfaceImpl.cpp801 auto reshapeOp = cast<tensor::ReshapeOp>(op); in bufferize() local
803 getBuffer(rewriter, reshapeOp.getSource(), options); in bufferize()
805 getBuffer(rewriter, reshapeOp.getShape(), options); in bufferize()
809 reshapeOp.getResult(), options, /*layout=*/{}, in bufferize()
/llvm-project-15.0.7/mlir/lib/Dialect/Tosa/IR/
H A DTosaCanonicalizations.cpp71 if (tosa::ReshapeOp reshapeOp = dyn_cast<tosa::ReshapeOp>(definingOp)) { in matchAndRewrite() local
73 op, op.getType(), reshapeOp.getInput1(), op.getNewShape()); in matchAndRewrite()