Skip to content

Commit

Permalink
Remove unused is_update argument (#8487)
Browse files Browse the repository at this point in the history
Affects apply_split in ApplySplit.cpp and build_loop_nest in
ScheduleFunctions.cpp. Fix callers in Func.cpp, too (rfactor).
  • Loading branch information
alexreinking authored Nov 23, 2024
1 parent 3b81521 commit b4b9911
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ApplySplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using std::map;
using std::string;
using std::vector;

vector<ApplySplitResult> apply_split(const Split &split, bool is_update, const string &prefix,
vector<ApplySplitResult> apply_split(const Split &split, const string &prefix,
map<string, Expr> &dim_extent_alignment) {
vector<ApplySplitResult> result;

Expand Down
2 changes: 1 addition & 1 deletion src/ApplySplit.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct ApplySplitResult {
* defined the values of variables referred by the predicates and substitutions
* (ordered from innermost to outermost let). */
std::vector<ApplySplitResult> apply_split(
const Split &split, bool is_update, const std::string &prefix,
const Split &split, const std::string &prefix,
std::map<std::string, Expr> &dim_extent_alignment);

/** Compute the loop bounds of the new dimensions resulting from applying the
Expand Down
8 changes: 4 additions & 4 deletions src/Func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ bool apply_split(const Split &s, vector<ReductionVariable> &rvars,

rvars.insert(it + 1, {s.outer, 0, simplify((old_extent - 1 + s.factor) / s.factor)});

vector<ApplySplitResult> splits_result = apply_split(s, true, "", dim_extent_alignment);
vector<ApplySplitResult> splits_result = apply_split(s, "", dim_extent_alignment);
vector<pair<string, Expr>> bounds_let_stmts = compute_loop_bounds_after_split(s, "");
apply_split_result(bounds_let_stmts, splits_result, predicates, args, values);

Expand Down Expand Up @@ -694,7 +694,7 @@ bool apply_fuse(const Split &s, vector<ReductionVariable> &rvars,
iter_outer->extent = extent;
rvars.erase(iter_inner);

vector<ApplySplitResult> splits_result = apply_split(s, true, "", dim_extent_alignment);
vector<ApplySplitResult> splits_result = apply_split(s, "", dim_extent_alignment);
vector<pair<string, Expr>> bounds_let_stmts = compute_loop_bounds_after_split(s, "");
apply_split_result(bounds_let_stmts, splits_result, predicates, args, values);

Expand All @@ -718,7 +718,7 @@ bool apply_purify(const Split &s, vector<ReductionVariable> &rvars,
<< ", deleting it from the rvars list\n";
rvars.erase(iter);

vector<ApplySplitResult> splits_result = apply_split(s, true, "", dim_extent_alignment);
vector<ApplySplitResult> splits_result = apply_split(s, "", dim_extent_alignment);
vector<pair<string, Expr>> bounds_let_stmts = compute_loop_bounds_after_split(s, "");
apply_split_result(bounds_let_stmts, splits_result, predicates, args, values);

Expand All @@ -738,7 +738,7 @@ bool apply_rename(const Split &s, vector<ReductionVariable> &rvars,
debug(4) << " Renaming " << iter->var << " into " << s.outer << "\n";
iter->var = s.outer;

vector<ApplySplitResult> splits_result = apply_split(s, true, "", dim_extent_alignment);
vector<ApplySplitResult> splits_result = apply_split(s, "", dim_extent_alignment);
vector<pair<string, Expr>> bounds_let_stmts = compute_loop_bounds_after_split(s, "");
apply_split_result(bounds_let_stmts, splits_result, predicates, args, values);

Expand Down
9 changes: 4 additions & 5 deletions src/ScheduleFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ Stmt build_loop_nest(
const string &prefix,
int start_fuse,
const Function &func,
const Definition &def,
bool is_update) {
const Definition &def) {
const auto &dims = func.args();
const auto &func_s = func.schedule();
const auto &stage_s = def.schedule();
Expand Down Expand Up @@ -220,7 +219,7 @@ Stmt build_loop_nest(
user_assert(predicated_vars.count(split.old_var) == 0)
<< "Cannot split a loop variable resulting from a split using PredicateLoads or PredicateStores.";

vector<ApplySplitResult> splits_result = apply_split(split, is_update, prefix, dim_extent_alignment);
vector<ApplySplitResult> splits_result = apply_split(split, prefix, dim_extent_alignment);

// To ensure we substitute all indices used in call or provide,
// we need to substitute all lets in, so we correctly guard x in
Expand Down Expand Up @@ -503,7 +502,7 @@ Stmt build_provide_loop_nest(const map<string, Function> &env,
}

// Default schedule/values if there is no specialization
Stmt stmt = build_loop_nest(body, prefix, start_fuse, func, def, is_update);
Stmt stmt = build_loop_nest(body, prefix, start_fuse, func, def);
stmt = inject_placeholder_prefetch(stmt, env, prefix, def.schedule().prefetches());

// Make any specialized copies
Expand Down Expand Up @@ -847,7 +846,7 @@ Stmt build_extern_produce(const map<string, Function> &env, Function f, const Ta

Definition f_def_no_pred = f.definition().get_copy();
f_def_no_pred.predicate() = const_true();
return build_loop_nest(check, f.name() + ".s0.", -1, f, f_def_no_pred, false);
return build_loop_nest(check, f.name() + ".s0.", -1, f, f_def_no_pred);
}

// A schedule may include explicit bounds on some dimension. This
Expand Down

0 comments on commit b4b9911

Please sign in to comment.