[Mlir-commits] [mlir] [MLIR] Fixes arith.sub folder crash on dynamically shaped tensors (PR #118908)
Ivan Butygin
llvmlistbot at llvm.org
Thu Dec 5 17:03:59 PST 2024
================
@@ -393,8 +393,12 @@ void arith::AddUIExtendedOp::getCanonicalizationPatterns(
OpFoldResult arith::SubIOp::fold(FoldAdaptor adaptor) {
// subi(x,x) -> 0
- if (getOperand(0) == getOperand(1))
- return Builder(getContext()).getZeroAttr(getType());
+ if (getOperand(0) == getOperand(1)) {
+ auto tensorType = dyn_cast<TensorType>(getType());
----------------
Hardcode84 wrote:
Actually, we already kinda have them with scalabale vectors. Can you add test for them too?
https://github.com/llvm/llvm-project/pull/118908
More information about the Mlir-commits
mailing list