From f284aea62f86193ba82bcb83f83583dc11dca5a2 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Fri, 20 May 2022 16:45:17 -0700 Subject: Update TOSA passes Now works with LLVM hash 1cb299165c85 Primarily changes to match the upstream FuncOp move to the func dialect Change-Id: Ibc5c81c9f10d86d42970e2ec4885844826cd4868 Signed-off-by: Eric Kunze --- src/TosaSerialize.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/TosaSerialize.cpp') diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp index 4e75cf8..31ddafd 100644 --- a/src/TosaSerialize.cpp +++ b/src/TosaSerialize.cpp @@ -16,12 +16,13 @@ // TOSA flatbuffer generation #include "include/SerializationPasses.h" -#include "mlir/Dialect/Quant/QuantTypes.h" // from @llvm-project -#include "mlir/Dialect/StandardOps/IR/Ops.h" // from @llvm-project -#include "mlir/Dialect/Tosa/IR/TosaOps.h" // from @llvm-project -#include "mlir/IR/Matchers.h" // from @llvm-project -#include "mlir/Pass/Pass.h" // from @llvm-project -#include "mlir/Support/LogicalResult.h" // from @llvm-project +#include "mlir/Dialect/Func/IR/FuncOps.h" // from @llvm-project +#include "mlir/Dialect/Quant/QuantTypes.h" // from @llvm-project +#include "mlir/Dialect/Tensor/IR/Tensor.h" // from @llvm-project +#include "mlir/Dialect/Tosa/IR/TosaOps.h" // from @llvm-project +#include "mlir/IR/Matchers.h" // from @llvm-project +#include "mlir/Pass/Pass.h" // from @llvm-project +#include "mlir/Support/LogicalResult.h" // from @llvm-project #include "tosa_serialization_handler.h" #include #include @@ -1482,7 +1483,7 @@ mlir::LogicalResult TosaSerializationBlockBuilder::BuildAllOpsInRegion( // Build tensor_map for (auto &op : bb) { if (!(llvm::isa(op) || - llvm::isa(op) || + llvm::isa(op) || llvm::isa(op))) { for (uint32_t i = 0; i < op.getNumResults(); i++) { std::string intermediate_tensor_name = @@ -1546,7 +1547,8 @@ mlir::LogicalResult TosaSerializationBlockBuilder::BuildAllOpsInRegion( // Build operator for (auto &op : bb) { - if (llvm::isa(op) || llvm::isa(op) || + if (llvm::isa(op) || + llvm::isa(op) || llvm::isa(op)) continue; ser_operator = BuildTosaSerializationOperator(op_builder, op); @@ -1627,7 +1629,7 @@ TosaSerializationBlockBuilder::BuildTosaSerializationTensor( return ts; } -mlir::LogicalResult translate2FlatBuffer(mlir::FuncOp &func, +mlir::LogicalResult translate2FlatBuffer(mlir::func::FuncOp &func, TosaSerializationHandler &tsh) { TosaSerializationBasicBlock *main_block; @@ -1664,7 +1666,7 @@ mlir::LogicalResult translate2FlatBuffer(mlir::FuncOp &func, return mlir::success(); } -mlir::LogicalResult dumpTosaFlatbuffer(mlir::FuncOp &func) { +mlir::LogicalResult dumpTosaFlatbuffer(mlir::func::FuncOp &func) { tosa::TosaSerializationHandler tsh; std::string tosa_flatbuffer_directory_fullpath; @@ -1681,7 +1683,7 @@ mlir::LogicalResult dumpTosaFlatbuffer(mlir::FuncOp &func) { return mlir::success(); } -mlir::LogicalResult dumpTosaJSON(mlir::FuncOp &func) { +mlir::LogicalResult dumpTosaJSON(mlir::func::FuncOp &func) { tosa::TosaSerializationHandler tsh; const char *tosa_schema = tosa_flatbuffer_schema.c_str(); -- cgit v1.2.1