diff --git a/src/pass/inject_thread_bind.cc b/src/pass/inject_thread_bind.cc index 075f0cf8964d0ad025f4a5589d77d636057ed49c..a463be237af2789482dd1cdde1269e157fe9afd6 100644 --- a/src/pass/inject_thread_bind.cc +++ b/src/pass/inject_thread_bind.cc @@ -1373,10 +1373,11 @@ class ScalarPeel : public IRMutator { public: Stmt Run(const Stmt &s) { Stmt res = Mutate(s); - if (!before_scalar_store_) { + if (!before_scalar_store_ || !find_multi_core_) { multi_core_body_ = s; return Stmt(); } + CHECK(multi_core_body_.defined()) << "Error, multicore body is not defined."; return res; }