[Mlir-commits] [mlir] [Mlir] decompose generic by unfolding projected permutation crash fix (PR #122449)
Adam Siemieniuk
llvmlistbot at llvm.org
Fri Jan 10 07:58:02 PST 2025
================
@@ -159,6 +159,15 @@ LogicalResult DecomposeProjectedPermutation::matchAndRewrite(
auto map = op.getMatchingIndexingMap(&opOperand);
if (!map.isProjectedPermutation(false))
return failure();
+
+ // If we have any inputs that aren't memref or ranked tensor types, reject
+ // the pattern.
+ if (!dyn_cast<ShapedType>(opOperand.get().getType()))
+ return op->emitError("Expected operand #")
----------------
adam-smnk wrote:
Thanks 👍
For the test, it is fine to have an invalid/negative examples and add `CHECK` statements to verify nothing has changed as expected.
Actually, could you add your test to the other `decompose-generic-by-unfolding-projected-permutation.mlir` file and just follow the existing convention.
https://github.com/llvm/llvm-project/pull/122449
More information about the Mlir-commits
mailing list