From 499f8513d0c797981d9c7786374003e8b7b1852d Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 27 May 2019 18:24:22 -0700 Subject: [PATCH] fix rebase --- include/tvm/relay/transform.h | 4 +++- src/relay/pass/dead_code.cc | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/tvm/relay/transform.h b/include/tvm/relay/transform.h index 4d6921a6b860b..76db62c2816b9 100644 --- a/include/tvm/relay/transform.h +++ b/include/tvm/relay/transform.h @@ -317,9 +317,11 @@ TVM_DLL Pass CreateFunctionPass(const runtime::TypedPackedFunc< * * As another example, `let a = 1 in a` will be optimized into 1. * + * \param inline_once whether or not to inline binding used one. + * * \return the pass. */ -TVM_DLL Pass DeadCodeElimination(); +TVM_DLL Pass DeadCodeElimination(bool inline_once = false); /*! * \brief Fold constant expressions. diff --git a/src/relay/pass/dead_code.cc b/src/relay/pass/dead_code.cc index a008b1ee461c2..329021d3e1801 100644 --- a/src/relay/pass/dead_code.cc +++ b/src/relay/pass/dead_code.cc @@ -161,10 +161,10 @@ TVM_REGISTER_API("relay._ir_pass.dead_code_elimination") namespace transform { -Pass DeadCodeElimination() { +Pass DeadCodeElimination(bool inline_once) { runtime::TypedPackedFunc pass_func = [=](Function f, Module m, PassContext pc) { - return Downcast(DeadCodeElimination(f)); + return Downcast(DeadCodeElimination(f, inline_once)); }; return CreateFunctionPass(pass_func, 1, "dead_code_elimination", {}); }