[Mlir-commits] [mlir] [mlir][spirv][tosa] Extend TOSA to SPIR-V TOSA op conversion (PR #200009)

Jakub Kuderski llvmlistbot at llvm.org
Wed May 27 18:01:26 PDT 2026


================
@@ -41,42 +49,223 @@ struct UnaryElementwiseOpConvert final : public OpConversionPattern<SourceOp> {
     Type type = this->getTypeConverter()->convertType(op.getType());
     if (!type)
       return rewriter.notifyMatchFailure(op, "type conversion failed");
-    rewriter.replaceOpWithNewOp<TargetOp>(op, type, getInput1(adaptor));
+    return Replacer::replace(op, adaptor, type, rewriter);
+  }
+};
+
+template <typename TargetOp>
+struct UnaryInput1Replace {
+  template <typename SourceOp>
+  static LogicalResult replace(SourceOp op, typename SourceOp::Adaptor adaptor,
----------------
kuhar wrote:

This could be a plain function, passed to `TosaOpConvert` as a non-type template parameter. Same for all the other ones.

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


More information about the Mlir-commits mailing list