| /llvm-project-15.0.7/mlir/include/mlir/Dialect/Utils/ |
| H A D | ReshapeOpsUtils.h | 84 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 D | ElementwiseOpFusion.cpp | 684 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 D | TensorInferTypeOpInterfaceImpl.cpp | 155 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 D | TensorOps.cpp | 894 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 D | MemRefToLLVM.cpp | 1109 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 D | LinalgOps.cpp | 500 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 D | BufferizableOpInterfaceImpl.cpp | 801 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 D | TosaCanonicalizations.cpp | 71 if (tosa::ReshapeOp reshapeOp = dyn_cast<tosa::ReshapeOp>(definingOp)) { in matchAndRewrite() local 73 op, op.getType(), reshapeOp.getInput1(), op.getNewShape()); in matchAndRewrite()
|