[Mlir-commits] [mlir] [mlir][tosa] Harden folds/canonicalizations for unranked and dynamic shapes (PR #188188)

Sayan Saha llvmlistbot at llvm.org
Fri Mar 27 07:06:42 PDT 2026


================
@@ -423,7 +430,7 @@ struct ClampIsNoOp : public OpRewritePattern<tosa::ClampOp> {
   LogicalResult matchAndRewrite(tosa::ClampOp op,
                                 PatternRewriter &rewriter) const override {
     Value input = op.getInput();
-    auto inputType = llvm::dyn_cast<RankedTensorType>(op.getInput().getType());
+    auto inputType = llvm::dyn_cast<ShapedType>(op.getInput().getType());
----------------
sahas3 wrote:

This can just be `cast` as per the ClampOp definition as it only accepts `Tosa_Tensor`.

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


More information about the Mlir-commits mailing list