From e449435dbe2bf73b56724cfc150a19be9bb3262e Mon Sep 17 00:00:00 2001 From: nihuini Date: Fri, 5 Mar 2021 16:33:29 +0800 Subject: [PATCH] fix mlir2ncnn warning, prettier alignment :) --- tools/mlir/mlir2ncnn.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/mlir/mlir2ncnn.cpp b/tools/mlir/mlir2ncnn.cpp index f0b45a278..ac564012f 100644 --- a/tools/mlir/mlir2ncnn.cpp +++ b/tools/mlir/mlir2ncnn.cpp @@ -262,7 +262,11 @@ int main(int argc, char** argv) // Add a run of the canonicalizer to optimize the mlir module. pm.addNestedPass(mlir::createCanonicalizerPass()); - pm.run(*m); + if (pm.run(*m).failed()) + { + fprintf(stderr, "canonicalizer pass failed\n"); + return -1; + } // m->dump(); @@ -767,7 +771,10 @@ int main(int argc, char** argv) fprintf(pp, "%-16s", op.c_str()); } - fprintf(pp, " op_%d %d %d", opid, num_input, num_output); + char opid_name[64]; + sprintf(opid_name, "op_%d", opid); + + fprintf(pp, " %-24s %d %d", opid_name, num_input, num_output); for (int i = 0; i < (int)operation.getNumOperands(); i++) {