Lines Matching refs:guard
52 /* Create a graft for "node" with guards "guard" and
56 __isl_take isl_set *guard, __isl_take isl_basic_set *enforced)
61 if (!node || !guard || !enforced)
71 graft->guard = guard;
77 isl_set_free(guard);
88 isl_set *guard;
96 guard = isl_set_universe(isl_space_copy(space));
99 return graft_alloc(node, guard, enforced);
126 /* Do all the grafts in "list" have the same guard and is this guard
148 dim = isl_set_dim(graft_0->guard, isl_dim_set);
154 skip = isl_set_involves_dims(graft_0->guard,
167 equal = isl_set_is_equal(graft_0->guard, graft->guard);
178 /* Hoist "guard" out of the current level (given by "build").
182 static __isl_give isl_set *hoist_guard(__isl_take isl_set *guard,
189 dim = isl_set_dim(guard, isl_dim_set);
191 return isl_set_free(guard);
193 guard = isl_set_remove_divs_involving_dims(guard,
195 guard = isl_set_eliminate(guard, isl_dim_set, depth, 1);
196 guard = isl_set_compute_divs(guard);
199 return guard;
202 /* Extract a common guard from the grafts in "list" that can be hoisted
203 * out of the current level. If no such guard can be found, then return
206 * If all the grafts in the list have the same guard and if this guard
208 * If there is only one graft in the list and if its guard
235 isl_set *guard;
258 guard = isl_set_copy(graft_0->guard);
260 guard = hoist_guard(guard, build);
262 return guard;
267 guard = isl_set_empty(isl_ast_build_get_space(build, 1));
275 guard_i = isl_set_copy(graft->guard);
282 guard = isl_set_union(guard, guard_i);
284 hull = isl_set_unshifted_simple_hull_from_set_list(guard, set_list);
285 guard = isl_set_from_basic_set(hull);
286 return hoist_guard(guard, build);
304 * in guard "guard".
307 * and if "guard" does involve a disjunction, then we make the different
313 __isl_take isl_ast_node *node, __isl_take isl_set *guard,
320 n = isl_set_n_basic_set(guard);
328 expr = isl_ast_build_expr_from_set_internal(build, guard);
334 guard = isl_set_make_disjoint(guard);
339 if (isl_set_foreach_basic_set(guard, &insert_if, &data) < 0)
342 isl_set_free(guard);
346 isl_set_free(guard);
352 * encoded in guard "bset" and add the result to data->list.
369 * in guard "guard", assuming guard involves any conditions.
372 __isl_take isl_ast_graft *graft, __isl_take isl_set *guard,
380 univ = isl_set_plain_is_universe(guard);
384 isl_set_free(guard);
388 graft->node = ast_node_insert_if(graft->node, guard, build);
395 isl_set_free(guard);
400 * in graft->guard, assuming graft->guard involves any conditions.
408 return insert_if_node(graft, isl_set_copy(graft->guard), build);
549 * "guard" is the original, non-simplified guard of the node
550 * "complement" is the complement of "guard" in the context of outer if nodes
554 isl_set *guard;
566 isl_set_free(if_node[i].guard);
575 * in graft->guard, assuming graft->guard involves any conditions.
579 * If the guard of a graft is a subset of either the guard or its complement
583 * The guard
618 isl_set *guard;
630 test = isl_set_copy(graft->guard);
635 if_node[j].guard);
657 guard = isl_set_copy(graft->guard);
659 graft->guard = isl_set_gist(graft->guard,
660 isl_set_copy(if_node[found_then].guard));
662 graft->guard = isl_set_gist(graft->guard,
666 if (!graft->guard)
672 if_node[n_if].guard = guard;
674 set = if_node[found_then].guard;
680 set = isl_set_subtract(set, isl_set_copy(guard));
684 isl_set_free(guard);
708 * in graft->guard, assuming graft->guard involves any conditions.
730 isl_set_free(graft->guard);
731 graft->guard = isl_set_copy(universe);
732 if (!graft->guard)
805 /* Record "guard" in "graft" so that it will be enforced somewhere
806 * up the tree. If the graft already has a guard, then it may be partially
807 * redundant in combination with the new guard and in the context
808 * the generated constraints of "build". In fact, the new guard
814 __isl_take isl_set *guard, __isl_keep isl_ast_build *build)
821 is_universe = isl_set_plain_is_universe(guard);
825 isl_set_free(guard);
829 graft->guard = isl_set_intersect(graft->guard, guard);
830 graft->guard = isl_set_gist(graft->guard,
832 graft->guard = isl_set_coalesce(graft->guard);
833 if (!graft->guard)
838 isl_set_free(guard);
842 /* For each graft in "list", replace its guard with the gist with
861 graft->guard = isl_set_gist(graft->guard,
863 if (!graft->guard)
873 /* For each graft in "list", replace its guard with the gist with
886 * "guard" and "enforced" are the guard and enforced constraints
887 * of the allocated graft. The guard is used to simplify the guards
896 __isl_take isl_ast_graft_list *list, __isl_take isl_set *guard,
907 isl_set_copy(guard));
908 list = gist_guards(list, guard);
917 graft = store_guard(graft, guard, build);
925 * The guard is initialized to the shared guard of the list elements (if any),
928 * hoisted guard and materialized as if nodes around the contained AST nodes
943 isl_set *guard;
949 guard = isl_ast_graft_list_extract_hoistable_guard(list, build);
950 graft = isl_ast_graft_alloc_from_children(list, guard, enforced,
1059 isl_set_free(graft->guard);
1097 return graft ? isl_set_copy(graft->guard) : NULL;
1100 /* Record that "guard" needs to be inserted in "graft".
1104 __isl_take isl_set *guard, __isl_keep isl_ast_build *build)
1106 return store_guard(graft, guard, build);
1135 graft->guard = isl_map_domain(isl_set_unwrap(graft->guard));
1138 graft->guard = isl_set_params(graft->guard);
1140 graft->guard = isl_set_compute_divs(graft->guard);
1142 if (!graft->enforced || !graft->guard)
1173 * In other words, plug in "ma" in "enforced" and "guard" fields of "graft".
1186 graft->guard = isl_set_preimage_multi_aff(graft->guard, ma);
1188 if (!graft->enforced || !graft->guard)
1224 return isl_set_plain_cmp(a->guard, b->guard);
1236 * merging grafts with the same guard into a single graft.
1243 * but if the guard of a graft in "list2" is disjoint from the guards
1249 * after g as long as each of these elements has a guard that is disjoint
1254 * that element didn't move up further was that its guard was not disjoint
1289 cmp = isl_set_plain_cmp(list1->p[j - 1]->guard,
1290 graft->guard);
1292 disjoint = isl_set_is_disjoint(graft->guard,
1293 list1->p[j - 1]->guard);
1344 * "any_match" gets set if any guard was seen more than once.
1351 /* Add "graft" to the list associated to its guard in data->guard2list.
1352 * If some other graft was already associated to this guard,
1358 isl_set *guard;
1363 m = isl_set_to_ast_graft_list_try_get(data->guard2list, graft->guard);
1373 guard = isl_set_copy(graft->guard);
1375 isl_set_to_ast_graft_list_set(data->guard2list, guard, m.value);
1382 * If any guard appears more than once, then set "any_match".
1406 static isl_stat add_same_guard(__isl_take isl_set *guard,
1411 isl_set_free(guard);
1419 * by placing elements with the same guard consecutively.
1440 * If any guard was seen more than once, then reconstruct the list
1479 [isl_graft_key_guard] = "guard",
1495 p = isl_printer_print_set(p, graft->guard);
1547 isl_set *guard;
1555 guard = isl_stream_read_set(s);
1556 if (!guard)
1574 return graft_alloc(node, guard, enforced);
1576 isl_set_free(guard);