Skip to content

Commit

Permalink
Fix print_loop_nest
Browse files Browse the repository at this point in the history
  • Loading branch information
abadams committed Jul 13, 2017
1 parent 1bd0550 commit 2aa759d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/PrintLoopNest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ string print_loop_nest(const vector<Function> &output_funcs) {
// Compute an environment
map<string, Function> env;
for (Function f : output_funcs) {
map<string, Function> more_funcs = find_transitive_calls(f);
env.insert(more_funcs.begin(), more_funcs.end());
populate_environment(f, env);
}

// Create a deep-copy of the entire graph of Funcs.
Expand All @@ -170,6 +169,11 @@ string print_loop_nest(const vector<Function> &output_funcs) {
Func(f).compute_root().store_root();
}

// Ensure that all ScheduleParams become well-defined constant Exprs.
for (auto &f : env) {
f.second.substitute_schedule_param_exprs();
}

// Substitute in wrapper Funcs
env = wrap_func_calls(env);

Expand Down

0 comments on commit 2aa759d

Please sign in to comment.