[mlir] Fix legal/illegal ops in TosaToTensor & TosaToLinalg
authorMaya Amrami <mayaam88@gmail.com>
Thu, 16 Mar 2023 10:59:38 +0000 (12:59 +0200)
committerMaya Amrami <mayaam88@gmail.com>
Thu, 16 Mar 2023 13:15:38 +0000 (15:15 +0200)
tosa.reshape and tosa.concat were moved from TosaToLinalg to TosaToTensor
(D145119 & D145952). So now they are legal after applying TosaToLinalg patterns,
and illegal after applying TosaToTensor patterns.

This includes D146174 (thanks @ramiro050!)

Reviewed By: krzysz00

Differential Revision: https://reviews.llvm.org/D146213

mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
mlir/lib/Conversion/TosaToTensor/TosaToTensorPass.cpp

index f3a76dd..820cadb 100644 (file)
@@ -55,6 +55,7 @@ public:
     target.addLegalOp<tosa::IfOp>();
     target.addLegalOp<tosa::ConstOp>();
     target.addLegalOp<tosa::WhileOp>();
+    target.addLegalOp<tosa::ConcatOp>();
     target.addLegalOp<tosa::SliceOp>();
     target.addLegalOp<tosa::ReshapeOp>();
     target.addLegalOp<tosa::PadOp>();
index af6a08e..50dc556 100644 (file)
@@ -35,6 +35,8 @@ public:
   void runOnOperation() override {
     RewritePatternSet patterns(&getContext());
     ConversionTarget target(getContext());
+    target.addIllegalOp<tosa::ConcatOp>();
+    target.addIllegalOp<tosa::ReshapeOp>();
     target.addIllegalOp<tosa::SliceOp>();
     target.addIllegalOp<tosa::PadOp>();
     target.addLegalDialect<arith::ArithDialect>();