Lines Matching defs:castOp
318 bool mlir::tensor::canFoldIntoConsumerOp(CastOp castOp) {
319 if (!castOp)
324 return preservesStaticInformation(castOp.getType(),
325 castOp.getSource().getType());
348 bool mlir::tensor::canFoldIntoProducerOp(CastOp castOp) {
349 if (!castOp)
351 return preservesStaticInformation(castOp.getSource().getType(),
352 castOp.getType());
360 auto castOp = operand.get().getDefiningOp<tensor::CastOp>();
361 if (castOp && tensor::canFoldIntoConsumerOp(castOp)) {
362 operand.set(castOp.getOperand());
853 auto castOp = dimOp.getSource().getDefiningOp<CastOp>();
854 if (!castOp)
856 Value newSource = castOp.getOperand();
1060 LogicalResult matchAndRewrite(CastOp castOp,
1062 if (!canFoldIntoProducerOp(castOp))
1064 auto producer = castOp.getSource().getDefiningOp<EmptyOp>();
1069 llvm::cast<RankedTensorType>(castOp->getResult(0).getType());
1108 rewriter.replaceOpWithNewOp<EmptyOp>(castOp, newMixedSizes,
1940 auto castOp = collapseShapeOp.getSrc().getDefiningOp<tensor::CastOp>();
1941 if (!tensor::canFoldIntoConsumerOp(castOp))
1945 llvm::cast<RankedTensorType>(castOp.getSource().getType());
1951 collapseShapeOp.getSrcMutable().assign(castOp.getSource());
1955 collapseShapeOp.getLoc(), newResultType, castOp.getSource(),
2057 auto castOp = expandOp.getSrc().getDefiningOp<CastOp>();
2058 if (!canFoldIntoConsumerOp(castOp))
2061 ArrayRef<int64_t> castSrcShape = castOp.getSource().getType().getShape();
2403 auto castOp = sliceOp.getSource().getDefiningOp<CastOp>();
2404 if (!castOp)
2407 if (!canFoldIntoConsumerOp(castOp))
2413 loc, sliceOp.getType(), castOp.getSource(), sliceOp.getOffsets(),
2861 auto castOp = v.getDefiningOp<tensor::CastOp>();
2862 if (!castOp || !canFoldIntoConsumerOp(castOp))
2864 return castOp.getSource();
3227 auto castOp = padTensorOp.getSource().getDefiningOp<tensor::CastOp>();
3228 if (!tensor::canFoldIntoConsumerOp(castOp))
3232 llvm::cast<RankedTensorType>(castOp.getSource().getType()),
3238 padTensorOp.getSourceMutable().assign(castOp.getSource());
4486 auto castOp =
4488 rewriter.replaceAllUsesExcept(packOp, castOp, castOp);
4777 auto castOp = opOperand.get().getDefiningOp<tensor::CastOp>();
4778 return castOp && canFoldIntoConsumerOp(castOp);