[Mlir-commits] [mlir] [MLIR][Math] Handle dynamic-shaped tensors without assertion (PR #204510)

Matthias Springer llvmlistbot at llvm.org
Thu Jun 25 06:17:49 PDT 2026


================
@@ -77,6 +86,9 @@ static LogicalResult convertSinhOp(math::SinhOp op, PatternRewriter &rewriter) {
   Value operand = op.getOperand();
   Type opType = operand.getType();
 
+  if (isDynamicShaped(opType))
----------------
matthias-springer wrote:

There is a better way. Change the implementation of `createFloatConst` to create a scalar tensor, then use `tensor.dim`+`tensor.splat` to turn it into a tensor. I didn't check all functions here, but at least this one should be able to support dynamic shapes.

https://github.com/llvm/llvm-project/pull/204510


More information about the Mlir-commits mailing list