Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to disable pass #3462

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/pass_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ inline namespace MIGRAPHX_INLINE_NS {

MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TRACE_PASSES);
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_TIME_PASSES);
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_DISABLE_PASSES);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to update the docs/dev/env_vars.rst to describe what this is does


static bool is_pass_disabled(const std::string& name)
{
static const auto passes = split_string(string_value_of(MIGRAPHX_DISABLE_PASSES{}, ""), ',');
return contains(passes, name);
}

void validate_pass(module& mod, const pass& p, tracer trace)
{
Expand Down Expand Up @@ -126,6 +133,8 @@ struct module_pm : module_pass_manager

virtual void run_pass(const pass& p) override
{
if(is_pass_disabled(p.name()))
return;
trace("Pass: ", p.name());
assert(mod);
assert(mod->validate() == mod->end());
Expand Down
Loading