Lines Matching refs:shape

31 using namespace mlir::shape;
39 RankedTensorType shape::getExtentTensorType(MLIRContext *ctx, int64_t rank) { in getExtentTensorType()
43 bool shape::isExtentTensorType(Type type) { in isExtentTensorType()
48 LogicalResult shape::getShapeVec(Value input, in getShapeVec()
175 return isa<shape::FunctionLibraryOp>(symbol) in verifyOperationAttribute()
190 auto shapeFnLib = dyn_cast<shape::FunctionLibraryOp>( in verifyOperationAttribute()
397 LogicalResult mlir::shape::AddOp::inferReturnTypes( in inferReturnTypes()
409 bool mlir::shape::AddOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
414 OpFoldResult mlir::shape::AddOp::fold(ArrayRef<Attribute> operands) { in fold()
423 LogicalResult shape::AddOp::verify() { return verifySizeOrIndexOp(*this); } in verify()
541 for (auto &shape : shapes) in matchAndRewrite() local
542 uniqueConstraints.push_back(shape.first.getResult()); in matchAndRewrite()
681 auto isPotentiallyNonEmptyShape = [](Value shape) { in matchAndRewrite() argument
682 if (auto extentTensorTy = shape.getType().dyn_cast<RankedTensorType>()) { in matchAndRewrite()
686 if (auto constShape = shape.getDefiningOp<ConstShapeOp>()) { in matchAndRewrite()
743 for (Value shape : op.getShapes()) { in matchAndRewrite() local
744 if (auto constShape = shape.getDefiningOp<ConstShapeOp>()) { in matchAndRewrite()
754 newShapeOperands.push_back(shape); in matchAndRewrite()
818 for (Value shape : op.getShapes()) { in matchAndRewrite() local
819 if (auto extentTensorTy = shape.getType().dyn_cast<RankedTensorType>()) { in matchAndRewrite()
914 LogicalResult mlir::shape::ConstShapeOp::inferReturnTypes( in inferReturnTypes()
919 auto shape = attributes.getAs<DenseIntElementsAttr>("shape"); in inferReturnTypes() local
920 if (!shape) in inferReturnTypes()
923 {static_cast<int64_t>(shape.size())}, b.getIndexType())}); in inferReturnTypes()
927 bool mlir::shape::ConstShapeOp::isCompatibleReturnTypes(TypeRange l, in isCompatibleReturnTypes()
1092 LogicalResult mlir::shape::DivOp::inferReturnTypes( in inferReturnTypes()
1104 bool mlir::shape::DivOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1257 void GetExtentOp::build(OpBuilder &builder, OperationState &result, Value shape, in build() argument
1261 if (shape.getType().isa<ShapeType>()) { in build()
1263 build(builder, result, builder.getType<SizeType>(), shape, dim); in build()
1267 build(builder, result, builder.getIndexType(), shape, dim); in build()
1271 LogicalResult mlir::shape::GetExtentOp::inferReturnTypes( in inferReturnTypes()
1279 bool mlir::shape::GetExtentOp::isCompatibleReturnTypes(TypeRange l, in isCompatibleReturnTypes()
1309 LogicalResult mlir::shape::MeetOp::inferReturnTypes( in inferReturnTypes()
1317 bool mlir::shape::MeetOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1341 OpFoldResult shape::RankOp::fold(ArrayRef<Attribute> operands) { in fold()
1342 auto shape = operands[0].dyn_cast_or_null<DenseIntElementsAttr>(); in fold() local
1343 if (!shape) in fold()
1345 int64_t rank = shape.getNumElements(); in fold()
1366 : public OpRewritePattern<shape::RankOp> {
1367 using OpRewritePattern<shape::RankOp>::OpRewritePattern;
1369 LogicalResult matchAndRewrite(shape::RankOp op, in matchAndRewrite()
1382 } else if (op.getType().isa<shape::SizeType>()) { in matchAndRewrite()
1383 rewriter.replaceOpWithNewOp<shape::ConstSizeOp>(op.getOperation(), rank); in matchAndRewrite()
1392 void shape::RankOp::getCanonicalizationPatterns(RewritePatternSet &patterns, in getCanonicalizationPatterns()
1397 LogicalResult mlir::shape::RankOp::inferReturnTypes( in inferReturnTypes()
1408 bool mlir::shape::RankOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1413 LogicalResult shape::RankOp::verify() { return verifySizeOrIndexOp(*this); } in verify()
1422 Attribute shape = operands[0]; in fold() local
1423 if (!shape) in fold()
1427 for (auto value : shape.cast<DenseIntElementsAttr>()) in fold()
1433 LogicalResult mlir::shape::NumElementsOp::inferReturnTypes( in inferReturnTypes()
1444 bool mlir::shape::NumElementsOp::isCompatibleReturnTypes(TypeRange l, in isCompatibleReturnTypes()
1450 LogicalResult shape::NumElementsOp::verify() { in verify()
1465 LogicalResult mlir::shape::MaxOp::inferReturnTypes( in inferReturnTypes()
1476 bool mlir::shape::MaxOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1497 LogicalResult mlir::shape::MinOp::inferReturnTypes( in inferReturnTypes()
1508 bool mlir::shape::MinOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1534 LogicalResult mlir::shape::MulOp::inferReturnTypes( in inferReturnTypes()
1546 bool mlir::shape::MulOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1551 LogicalResult shape::MulOp::verify() { return verifySizeOrIndexOp(*this); } in verify()
1566 struct ShapeOfWithTensor : public OpRewritePattern<shape::ShapeOfOp> {
1567 using OpRewritePattern<shape::ShapeOfOp>::OpRewritePattern;
1569 LogicalResult matchAndRewrite(shape::ShapeOfOp op, in matchAndRewrite()
1576 rewriter.replaceOpWithNewOp<shape::ShapeOfOp>(op.getOperation(), in matchAndRewrite()
1621 LogicalResult mlir::shape::ShapeOfOp::inferReturnTypes( in inferReturnTypes()
1638 bool mlir::shape::ShapeOfOp::isCompatibleReturnTypes(TypeRange l, TypeRange r) { in isCompatibleReturnTypes()
1659 LogicalResult shape::ShapeOfOp::verify() { in verify()
1690 LogicalResult shape::YieldOp::verify() { in verify()
1715 auto shape = llvm::makeArrayRef(shapeVec); in fold() local
1719 int64_t rank = shape.size(); in fold()
1723 splitPoint += shape.size(); in fold()
1725 results.push_back(builder.getIndexTensorAttr(shape.take_front(splitPoint))); in fold()
1726 results.push_back(builder.getIndexTensorAttr(shape.drop_front(splitPoint))); in fold()
1738 auto shape = llvm::to_vector<6>( in fold() local
1740 auto type = RankedTensorType::get({static_cast<int64_t>(shape.size())}, in fold()
1742 return DenseIntElementsAttr::get(type, shape); in fold()
1764 void ReduceOp::build(OpBuilder &builder, OperationState &result, Value shape, in build() argument
1766 result.addOperands(shape); in build()
1775 if (auto tensorType = shape.getType().dyn_cast<TensorType>()) in build()
1779 bodyBlock.addArgument(elementType, shape.getLoc()); in build()