2 * Copyright 2019 Cerebras Systems
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege,
7 * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
10 /* Given a function defined over a parameter domain,
11 * convert it to a function defined over a domain corresponding
14 __isl_give TYPE
*FN(TYPE
,insert_domain
)(__isl_take TYPE
*obj
,
15 __isl_take isl_space
*domain
)
20 obj_space
= FN(TYPE
,peek_space
)(obj
);
21 if (isl_space_check_is_set(domain
) < 0 ||
22 isl_space_check_is_set(obj_space
) < 0)
24 dim
= isl_space_dim(domain
, isl_dim_set
);
28 domain
= isl_space_replace_params(domain
, obj_space
);
30 obj
= FN(TYPE
,from_range
)(obj
);
31 obj
= FN(TYPE
,add_dims
)(obj
, isl_dim_in
, dim
);
32 obj
= FN(TYPE
,reset_domain_space
)(obj
, domain
);
36 isl_space_free(domain
);