isl_ctx *ctx, int val);
int isl_options_get_ast_build_scale_strides(
isl_ctx *ctx);
+ int isl_options_set_ast_build_allow_else(isl_ctx *ctx,
+ int val);
+ int isl_options_get_ast_build_allow_else(isl_ctx *ctx);
=over
This option specifies whether the AST generator is allowed
to scale down iterators of strided loops.
+=item * ast_build_allow_else
+
+This option specifies whether the AST generator is allowed
+to construct if statements with else branches.
+
=back
=head3 Fine-grained Control over AST Generation
int isl_options_set_ast_build_scale_strides(isl_ctx *ctx, int val);
int isl_options_get_ast_build_scale_strides(isl_ctx *ctx);
+int isl_options_set_ast_build_allow_else(isl_ctx *ctx, int val);
+int isl_options_get_ast_build_allow_else(isl_ctx *ctx);
isl_ctx *isl_ast_build_get_ctx(__isl_keep isl_ast_build *build);
* The guard of the node is then simplified based on the conditions
* enforced at that then or else branch.
* Otherwise, the current graft is appended to the list.
+ *
+ * We only construct else branches if allowed by the user.
*/
static __isl_give isl_ast_graft_list *insert_pending_guard_nodes(
__isl_take isl_ast_graft_list *list,
__isl_keep isl_ast_build *build)
{
int i, j, n, n_if;
+ int allow_else;
isl_ctx *ctx;
isl_ast_graft_list *res;
struct isl_if_node *if_node = NULL;
ctx = isl_ast_build_get_ctx(build);
n = isl_ast_graft_list_n_ast_graft(list);
+ allow_else = isl_options_get_ast_build_allow_else(ctx);
+
n_if = 0;
if (n > 0) {
if_node = isl_alloc_array(ctx, struct isl_if_node, n - 1);
found_then = j;
break;
}
+ if (!allow_else)
+ continue;
subset = isl_set_is_subset(test,
if_node[j].complement);
if (subset < 0 || subset) {
ISL_ARG_BOOL(struct isl_options, ast_build_scale_strides, 0,
"ast-build-scale-strides", 1,
"allow iterators of strided loops to be scaled down")
+ISL_ARG_BOOL(struct isl_options, ast_build_allow_else, 0,
+ "ast-build-allow-else", 1, "generate if statements with else branches")
ISL_ARG_VERSION(print_version)
ISL_ARGS_END
ast_build_scale_strides)
ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
ast_build_scale_strides)
+
+ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
+ ast_build_allow_else)
+ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args,
+ ast_build_allow_else)
int ast_build_group_coscheduled;
int ast_build_separation_bounds;
int ast_build_scale_strides;
+ int ast_build_allow_else;
};
#endif