From 0d93f3c76bad1f4a4d52bc0a28c2f2a01c3a1357 Mon Sep 17 00:00:00 2001 From: Franck Slama Date: Tue, 9 Nov 2021 13:59:57 -0600 Subject: [PATCH 1/2] Fixed some warnings, including lambdas closure that are bigger than necessary, and some missing parenthesis around an assignment in a conditional (LLVM fears a mistake where one wanted to use the equality test ==) --- src/driver/driver_api.cc | 2 +- src/relay/backend/vm/compiler.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/driver_api.cc b/src/driver/driver_api.cc index 17ab38ed450f..ad1f51ba6d71 100644 --- a/src/driver/driver_api.cc +++ b/src/driver/driver_api.cc @@ -166,7 +166,7 @@ transform::Pass BindTarget(Target target) { } static transform::Pass AnnotateEntryFunc(bool b) { - auto fpass = [b](tir::PrimFunc f, IRModule m, transform::PassContext ctx) { + auto fpass = [](tir::PrimFunc f, IRModule m, transform::PassContext ctx) { return WithAttr(std::move(f), tir::attr::kIsEntryFunc, Bool(true)); }; return tir::transform::CreatePrimFuncPass(fpass, 0, "AnnotateEntryFunc", {}); diff --git a/src/relay/backend/vm/compiler.cc b/src/relay/backend/vm/compiler.cc index c4c50c6c5646..bc359427cb94 100644 --- a/src/relay/backend/vm/compiler.cc +++ b/src/relay/backend/vm/compiler.cc @@ -618,7 +618,7 @@ class VMFunctionCompiler : DeviceAwareExprFunctor { } }) .Match("memory.alloc_storage", - [this, call_node](const Array& args, const Attrs& attrs, + [this](const Array& args, const Attrs& attrs, const Array& type_arg) { ICHECK_EQ(args.size(), 2); // Compute the size of the allocation. From ec1cc99dcb30f7be30541a807378ca09db1f9919 Mon Sep 17 00:00:00 2001 From: Franck Slama Date: Tue, 9 Nov 2021 18:29:41 -0600 Subject: [PATCH 2/2] Fixed formatting as two lines can now be merged while still being under 100 characters --- src/relay/backend/vm/compiler.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/relay/backend/vm/compiler.cc b/src/relay/backend/vm/compiler.cc index bc359427cb94..02477d05673b 100644 --- a/src/relay/backend/vm/compiler.cc +++ b/src/relay/backend/vm/compiler.cc @@ -618,8 +618,7 @@ class VMFunctionCompiler : DeviceAwareExprFunctor { } }) .Match("memory.alloc_storage", - [this](const Array& args, const Attrs& attrs, - const Array& type_arg) { + [this](const Array& args, const Attrs& attrs, const Array& type_arg) { ICHECK_EQ(args.size(), 2); // Compute the size of the allocation. this->VisitExpr(args[0]);