[Mlir-commits] [mlir] [mlir][linalg] unfold projected permutation. (PR #114704)
Javed Absar
llvmlistbot at llvm.org
Sat Nov 9 10:55:58 PST 2024
================
@@ -147,14 +150,19 @@ LogicalResult DecomposeProjectedPermutation::matchAndRewrite(
op.isSingleYieldOp() || !op.isAllParallelLoops())
return failure();
- // All maps need to be projected permutations.
+ // If the map of an operand is not a `projected permutation` then
+ // it cannot be decomposed to mere transpose and broadcast.
+ // The requirement that all maps be `projected permutation` may be
+ // over-restrictive but since we need to determine shape of the
+ // iteration space as well, reject if any map violates assumption.
for (auto &opOperand : op->getOpOperands()) {
auto map = op.getMatchingIndexingMap(&opOperand);
if (!map.isProjectedPermutation(false))
return failure();
}
- // Currently we handle only static shapes.
+ // Decomposing linalg.generic involves creating `tensor.empty`
+ // which cannot have dnyamic shapes.
----------------
javedabsar1 wrote:
the tensor.empty needs to be passed in a runtime value for '?' . For our case i dont see how to derive it from the linalg.generic
https://github.com/llvm/llvm-project/pull/114704
More information about the Mlir-commits
mailing list