[Mlir-commits] [mlir] [MLIR] Folding unpack and pack sequence in data layout propagation from padded domain (PR #138332)
Han-Chung Wang
llvmlistbot at llvm.org
Mon May 5 14:24:16 PDT 2025
================
@@ -298,20 +298,60 @@ getOrCreatePackedViewOfOperand(OpBuilder &b, Location loc, PackInfo packInfo,
return std::make_tuple(packedOperand, indexingMap);
}
+static bool isGenericOutsNotUsed(linalg::GenericOp genericOp) {
+ int numDpsOuts = genericOp.getNumDpsInits();
+ Block *block = genericOp.getBody();
+ int numBlockArgs = block->getNumArguments();
+ int initArgStartIndex = numBlockArgs - numDpsOuts;
+ for (int i = 0; i < numDpsOuts; ++i) {
+ int matchingInitArgIndex = initArgStartIndex + i;
+ return block->getArgument(matchingInitArgIndex).use_empty();
+ }
+ return true;
----------------
hanhanW wrote:
This is wrong when one is not used and the other is used, right? You only check the first out argument.
IIUC, we return true iff all the outs are not used. Please add a comment to the method. It could be my own issue, but I think there could be two cases? One is all of outs are not used, and the other is any of outs is not used. Or maybe we can rename it as `isAllGenericOutsNotUsed`?
https://github.com/llvm/llvm-project/pull/138332
More information about the Mlir-commits
mailing list