[Mlir-commits] [mlir] [mlir][spirv][tosa] Extend TOSA to SPIR-V TOSA op conversion (PR #200009)
Jakub Kuderski
llvmlistbot at llvm.org
Thu May 28 18:07:02 PDT 2026
================
@@ -49,311 +49,302 @@ struct TosaOpConvert final : public OpConversionPattern<SourceOp> {
Type type = this->getTypeConverter()->convertType(op.getType());
if (!type)
return rewriter.notifyMatchFailure(op, "type conversion failed");
- return Replacer::replace(op, adaptor, type, rewriter);
+ return Replace(op, adaptor, type, rewriter);
}
};
-template <typename TargetOp>
-struct UnaryInput1Replace {
- template <typename SourceOp>
- static LogicalResult replace(SourceOp op, typename SourceOp::Adaptor adaptor,
- Type type, ConversionPatternRewriter &rewriter) {
- rewriter.replaceOpWithNewOp<TargetOp>(op, type, adaptor.getInput1());
- return success();
- }
-};
+template <typename SourceOp, typename TargetOp>
+LogicalResult replaceUnaryInput1(SourceOp op,
+ typename SourceOp::Adaptor adaptor, Type type,
+ ConversionPatternRewriter &rewriter) {
+ rewriter.replaceOpWithNewOp<TargetOp>(op, type, adaptor.getInput1());
+ return success();
----------------
kuhar wrote:
Make these functions return void if the success is guaranteed?
https://github.com/llvm/llvm-project/pull/200009
More information about the Mlir-commits
mailing list