aboutsummaryrefslogtreecommitdiff
path: root/src/TosaSerialize.cpp
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-05-20 16:45:17 -0700
committerEric Kunze <eric.kunze@arm.com>2022-05-20 17:10:35 -0700
commitf284aea62f86193ba82bcb83f83583dc11dca5a2 (patch)
treef82cec9e43c1233df7f97db19128ef8fa1be09bc /src/TosaSerialize.cpp
parentef2c301b14dad329ab02810b44d2f157dbc4d944 (diff)
downloadtosa_mlir_translator-f284aea62f86193ba82bcb83f83583dc11dca5a2.tar.gz
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 <eric.kunze@arm.com>
Diffstat (limited to 'src/TosaSerialize.cpp')
-rw-r--r--src/TosaSerialize.cpp24
1 files changed, 13 insertions, 11 deletions
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 <functional>
#include <map>
@@ -1482,7 +1483,7 @@ mlir::LogicalResult TosaSerializationBlockBuilder::BuildAllOpsInRegion(
// Build tensor_map
for (auto &op : bb) {
if (!(llvm::isa<mlir::tosa::YieldOp>(op) ||
- llvm::isa<mlir::ReturnOp>(op) ||
+ llvm::isa<mlir::func::ReturnOp>(op) ||
llvm::isa<mlir::tensor::CastOp>(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<mlir::tosa::YieldOp>(op) || llvm::isa<mlir::ReturnOp>(op) ||
+ if (llvm::isa<mlir::tosa::YieldOp>(op) ||
+ llvm::isa<mlir::func::ReturnOp>(op) ||
llvm::isa<mlir::tensor::CastOp>(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();