This repository was archived by the owner on Apr 28, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -174,16 +174,9 @@ std::vector<isl::aff> makeIslAffBoundsFromExpr(
174
174
const Max* maxOp = e.as <Max>();
175
175
176
176
if (const Variable* op = e.as <Variable>()) {
177
- isl::local_space ls = isl::local_space (space);
178
- int pos = space.find_dim_by_name (isl::dim_type::param, op->name );
179
- if (pos >= 0 ) {
180
- return {isl::aff (ls, isl::dim_type::param, pos)};
181
- } else {
182
- // FIXME: thou shalt not rely upon set dimension names
183
- pos = space.find_dim_by_name (isl::dim_type::set, op->name );
184
- if (pos >= 0 ) {
185
- return {isl::aff (ls, isl::dim_type::set, pos)};
186
- }
177
+ isl::id id (space.get_ctx (), op->name );
178
+ if (space.has_param (id)) {
179
+ return {isl::aff::param_on_domain_space (space, id)};
187
180
}
188
181
LOG (FATAL) << " Variable not found in isl::space: " << space << " : " << op
189
182
<< " : " << op->name << ' \n ' ;
Original file line number Diff line number Diff line change @@ -53,7 +53,10 @@ isl::aff makeIslAffFromInt(isl::space space, int64_t i);
53
53
54
54
// Make an affine function over a space from a Halide Expr. Returns a
55
55
// null isl::aff if the expression is not affine. Fails if Variable
56
- // does not correspond to a parameter or set dimension of the space.
56
+ // does not correspond to a parameter of the space.
57
+ // Note that the input space can be either a parameter space or
58
+ // a set space, but the expression can only reference
59
+ // the parameters in the space.
57
60
isl::aff makeIslAffFromExpr (isl::space space, const Halide::Expr& e);
58
61
59
62
// Iteration domain information associated to a statement identifier.
You can’t perform that action at this time.
0 commit comments