[Mlir-commits] [mlir] [Mlir] decompose generic by unfolding projected permutation crash fix (PR #122449)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Mon Feb 10 10:38:22 PST 2025
================
@@ -159,6 +160,16 @@ LogicalResult DecomposeProjectedPermutation::matchAndRewrite(
auto map = op.getMatchingIndexingMap(&opOperand);
if (!map.isProjectedPermutation(false))
return failure();
+
+ // If we have any inputs that aren't ranked tensor types, reject
+ // the pattern.
+ if (!dyn_cast<RankedTensorType>(opOperand.get().getType()))
+ return rewriter.notifyMatchFailure(
+ opOperand.get().getLoc(),
+ llvm::formatv("Expected operand #{0} to be "
+ "ranked tensor of any type values, but got {1}",
+ opOperand.getOperandNumber(),
+ opOperand.get().getType()));
----------------
banach-space wrote:
[nit] `notifyMatchFailure` messages tend to be fairly simple. My preference would be to keep this one simple as well and avoid this formatting.
https://github.com/llvm/llvm-project/pull/122449
More information about the Mlir-commits
mailing list