[Mlir-commits] [mlir] [mlir][linalg] unfold projected permutation. (PR #114704)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Sat Nov 9 10:57:19 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.
----------------
banach-space wrote:
https://mlir.llvm.org/docs/Dialects/TensorOps/#tensordim-tensordimop ?
https://github.com/llvm/llvm-project/pull/114704
More information about the Mlir-commits
mailing list