Lines Matching defs:xferOp

44                                 VectorTransferOpInterface xferOp) {
45 assert(xferOp.getPermutationMap().isMinorIdentity() &&
48 xferOp.zipResultAndIndexing([&](int64_t resultIdx, int64_t indicesIdx) {
52 if (xferOp.isDimInBounds(resultIdx))
55 Location loc = xferOp.getLoc();
56 int64_t vectorSize = xferOp.getVectorType().getDimSize(resultIdx);
59 {xferOp.getIndices()[indicesIdx]});
61 memref::getMixedSize(b, loc, xferOp.getSource(), indicesIdx);
108 /// 1. `xferOp.getPermutationMap()` must be a minor identity map
109 /// 2. the rank of the `xferOp.memref()` and the rank of the
110 /// `xferOp.getVector()` must be equal. This will be relaxed in the future
113 splitFullAndPartialTransferPrecondition(VectorTransferOpInterface xferOp) {
115 if (xferOp.getTransferRank() == 0)
119 if (!xferOp.getPermutationMap().isMinorIdentity())
122 if (!xferOp.hasOutOfBoundsDim())
127 if (isa<scf::IfOp>(xferOp->getParentOp()))
188 /// view `xferOp.getSource()` @ `xferOp.getIndices()` and the view `alloc`.
191 createSubViewIntersection(RewriterBase &b, VectorTransferOpInterface xferOp,
193 Location loc = xferOp.getLoc();
194 int64_t memrefRank = xferOp.getShapedType().getRank();
199 xferOp.getIndices().take_front(xferOp.getLeadingShapedRank());
202 auto isaWrite = isa<vector::TransferWriteOp>(xferOp);
203 xferOp.zipResultAndIndexing([&](int64_t resultIdx, int64_t indicesIdx) {
205 Value dimMemRef = b.create<memref::DimOp>(xferOp.getLoc(),
206 xferOp.getSource(), indicesIdx);
208 Value index = xferOp.getIndices()[indicesIdx];
210 bindDims(xferOp.getContext(), i, j, k);
220 xferOp.getIndices(), [](Value idx) -> OpFoldResult { return idx; }));
224 loc, isaWrite ? alloc : xferOp.getSource(), srcIndices, sizes, strides);
226 loc, isaWrite ? xferOp.getSource() : alloc, destIndices, sizes, strides);
230 /// Given an `xferOp` for which:
250 createFullPartialLinalgCopy(RewriterBase &b, vector::TransferReadOp xferOp,
253 Location loc = xferOp.getLoc();
255 Value memref = xferOp.getSource();
261 viewAndIndices.insert(viewAndIndices.end(), xferOp.getIndices().begin(),
262 xferOp.getIndices().end());
266 b.create<linalg::FillOp>(loc, ValueRange{xferOp.getPadding()},
272 rewriter, cast<VectorTransferOpInterface>(xferOp.getOperation()),
278 viewAndIndices.insert(viewAndIndices.end(), xferOp.getTransferRank(),
284 /// Given an `xferOp` for which:
304 RewriterBase &b, vector::TransferReadOp xferOp, TypeRange returnTypes,
306 Location loc = xferOp.getLoc();
309 Value memref = xferOp.getSource();
315 viewAndIndices.insert(viewAndIndices.end(), xferOp.getIndices().begin(),
316 xferOp.getIndices().end());
320 Operation *newXfer = b.clone(*xferOp.getOperation());
330 viewAndIndices.insert(viewAndIndices.end(), xferOp.getTransferRank(),
336 /// Given an `xferOp` for which:
352 getLocationToWriteFullVec(RewriterBase &b, vector::TransferWriteOp xferOp,
355 Location loc = xferOp.getLoc();
357 Value memref = xferOp.getSource();
366 xferOp.getIndices().begin(),
367 xferOp.getIndices().end());
375 xferOp.getTransferRank(), zero);
381 /// Given an `xferOp` for which:
395 vector::TransferWriteOp xferOp,
397 Location loc = xferOp.getLoc();
403 rewriter, cast<VectorTransferOpInterface>(xferOp.getOperation()),
410 /// Given an `xferOp` for which:
423 vector::TransferWriteOp xferOp,
426 Location loc = xferOp.getLoc();
434 loc, MemRefType::get({}, xferOp.getVector().getType()), alloc),
436 mapping.map(xferOp.getVector(), load);
437 b.clone(*xferOp.getOperation(), mapping);
515 /// 1. `xferOp.getPermutationMap()` must be a minor identity map
516 /// 2. the rank of the `xferOp.getSource()` and the rank of the
517 /// `xferOp.getVector()` must be equal. This will be relaxed in the future
520 RewriterBase &b, VectorTransferOpInterface xferOp,
525 SmallVector<bool, 4> bools(xferOp.getTransferRank(), true);
528 b.modifyOpInPlace(xferOp, [&]() {
529 xferOp->setAttr(xferOp.getInBoundsAttrName(), inBoundsAttr);
537 assert(succeeded(splitFullAndPartialTransferPrecondition(xferOp)) &&
540 auto xferReadOp = dyn_cast<vector::TransferReadOp>(xferOp.getOperation());
541 auto xferWriteOp = dyn_cast<vector::TransferWriteOp>(xferOp.getOperation());
552 b.setInsertionPoint(xferOp);
554 b, cast<VectorTransferOpInterface>(xferOp.getOperation()));
562 Operation *scope = getAutomaticAllocationScope(xferOp);
566 auto shape = xferOp.getVectorType().getShape();
567 Type elementType = xferOp.getVectorType().getElementType();
574 getCastCompatibleMemRefType(cast<MemRefType>(xferOp.getShapedType()),
579 SmallVector<Type, 4> returnTypes(1 + xferOp.getTransferRank(),
584 dyn_cast<vector::TransferReadOp>(xferOp.getOperation())) {
601 b.modifyOpInPlace(xferOp, [&]() {
602 xferOp->setAttr(xferOp.getInBoundsAttrName(), inBoundsAttr);
608 auto xferWriteOp = cast<vector::TransferWriteOp>(xferOp.getOperation());
630 b.eraseOp(xferOp);
664 auto xferOp = dyn_cast<VectorTransferOpInterface>(op);
665 if (!xferOp || failed(splitFullAndPartialTransferPrecondition(xferOp)) ||
666 failed(filter(xferOp)))
668 return splitFullAndPartialTransfer(rewriter, xferOp, options);