As title,
I found that though SequentialNode::operator()
invokes PassEnabled()
on all the pass instances it owns; it does not check dependency passes before invoke their call operator.
IRModule SequentialNode::operator()(IRModule mod, const PassContext& pass_ctx) const {
for (const Pass& pass : passes) {
CHECK(pass.defined()) << "Found undefined pass for optimization.";
const PassInfo& pass_info = pass->Info();
if (!PassEnabled(pass_info)) continue; // THE PROBLEM: only check pass itself
// resolve dependencies
for (const auto& it : pass_info->required) {
mod = GetPass(it)(std::move(mod), pass_ctx);
}
mod = pass(std::move(mod), pass_ctx);
}
return mod;
}
I think there might be a problem that even a pass is disabled, it can still be ran while resolving dependencies. I wonder if there are some design concerns, thanks.