[BACKEND] Add generic support of convert_layout from distributed to shared (#1025)

This commit is contained in:
goostavz
2022-12-31 03:29:58 +08:00
committed by GitHub
parent 194ba103b1
commit 0e8590f1c9
5 changed files with 68 additions and 110 deletions

View File

@@ -639,10 +639,9 @@ struct InsertSliceOpConversion
auto smemBase = gep(elemPtrTy, smemObj.base, offset);
auto llSrc = adaptor.source();
auto srcIndices =
emitBaseIndexForLayout(loc, rewriter, srcLayout, srcShape);
storeBlockedToShared(src, llSrc, srcStrides, srcIndices, dst, smemBase,
elemTy, loc, rewriter);
auto srcIndices = emitIndices(loc, rewriter, srcLayout, srcShape);
storeDistributedToShared(src, llSrc, srcStrides, srcIndices, dst, smemBase,
elemTy, loc, rewriter);
// Barrier is not necessary.
// The membar pass knows that it writes to shared memory and will handle it
// properly.