Lines Matching defs:unPackOp

4363 static bool hasSameInnerOuterAttribute(PackOp packOp, UnPackOp unPackOp) {
4364 if (packOp.getInnerDimsPos() != unPackOp.getInnerDimsPos())
4366 if (packOp.getOuterDimsPerm() == unPackOp.getOuterDimsPerm())
4372 isIdentityPermutation(unPackOp.getOuterDimsPerm());
4377 static bool haveSameTiles(PackOp packOp, UnPackOp unPackOp) {
4379 auto unPackTiles = unPackOp.getMixedTiles();
4441 if (auto unPackOp = packOp.getSource().getDefiningOp<UnPackOp>()) {
4442 if (unPackOp.getSourceType() != packOp.getDestType())
4445 !hasSameInnerOuterAttribute(packOp, unPackOp) ||
4446 !haveSameTiles(packOp, unPackOp))
4448 rewriter.replaceOp(packOp, unPackOp.getSource());
4698 LogicalResult UnPackOp::canonicalize(UnPackOp unPackOp,
4701 if (PackOp packOp = unPackOp.getSource().getDefiningOp<tensor::PackOp>()) {
4702 if (packOp.getSourceType() != unPackOp.getDestType())
4705 !hasSameInnerOuterAttribute(packOp, unPackOp) ||
4706 !haveSameTiles(packOp, unPackOp))
4708 rewriter.replaceOp(unPackOp, packOp.getSource());
4713 unPackOp.getDest().getDefiningOp<DestinationStyleOpInterface>()) {
4714 auto destValue = cast<OpResult>(unPackOp.getDest());
4716 rewriter.modifyOpInPlace(unPackOp,
4717 [&]() { unPackOp.setDpsInitOperand(0, newDest); });
4723 if (inferStaticShape(unPackOp, srcShape, destShape)) {
4724 Location loc = unPackOp.getLoc();
4725 Value source = unPackOp.getSource();
4726 if (srcShape != unPackOp.getSourceType().getShape()) {
4727 auto newSrcType = unPackOp.getSourceType().clone(srcShape);
4729 unPackOp.getSource());
4731 Value dest = unPackOp.getDest();
4732 if (destShape != unPackOp.getDestType().getShape()) {
4733 auto newDestType = unPackOp.getDestType().clone(destShape);
4735 rewriter.create<tensor::CastOp>(loc, newDestType, unPackOp.getDest());
4738 loc, source, dest, unPackOp.getInnerDimsPos(), unPackOp.getMixedTiles(),
4739 unPackOp.getOuterDimsPerm());
4741 unPackOp, unPackOp.getResult().getType(), newOp);