From 7a81002419075ad9244b2fc80fa294a69a5a5e55 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 11 Apr 2012 11:42:29 +0200 Subject: [PATCH] isl_union_set_compute_schedule: separate components by default Serialize (weakly connected) components by assigning them separate values at an outer dimension by default. Although it is possible for independent components to be executed in parallel, it is usually not a good idea to do so. Signed-off-by: Sven Verdoolaege --- include/isl/schedule.h | 3 +++ isl_options.c | 8 ++++++++ isl_options_private.h | 1 + isl_schedule.c | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/isl/schedule.h b/include/isl/schedule.h index 4b7f59e..b9b07aa 100644 --- a/include/isl/schedule.h +++ b/include/isl/schedule.h @@ -27,6 +27,9 @@ int isl_options_get_schedule_outer_zero_distance(isl_ctx *ctx); int isl_options_set_schedule_split_scaled(isl_ctx *ctx, int val); int isl_options_get_schedule_split_scaled(isl_ctx *ctx); +int isl_options_set_schedule_separate_components(isl_ctx *ctx, int val); +int isl_options_get_schedule_separate_components(isl_ctx *ctx); + #define ISL_SCHEDULE_FUSE_MAX 0 #define ISL_SCHEDULE_FUSE_MIN 1 int isl_options_set_schedule_fuse(isl_ctx *ctx, int val); diff --git a/isl_options.c b/isl_options.c index 75874c1..8f7ccd0 100644 --- a/isl_options.c +++ b/isl_options.c @@ -159,6 +159,9 @@ ISL_ARG_BOOL(struct isl_options, schedule_maximize_band_depth, 0, ISL_ARG_BOOL(struct isl_options, schedule_split_scaled, 0, "schedule-split-scaled", 1, "split non-tilable bands with scaled schedules") +ISL_ARG_BOOL(struct isl_options, schedule_separate_components, 0, + "schedule-separate-components", 1, + "separate components in dependence graph") ISL_ARG_CHOICE(struct isl_options, schedule_algorithm, 0, "schedule-algorithm", isl_schedule_algorithm_choice, ISL_SCHEDULE_ALGORITHM_ISL, "scheduling algorithm to use") @@ -210,6 +213,11 @@ ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, schedule_split_scaled) ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_separate_components) +ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, + schedule_separate_components) + +ISL_CTX_SET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, schedule_outer_zero_distance) ISL_CTX_GET_BOOL_DEF(isl_options, struct isl_options, isl_options_args, schedule_outer_zero_distance) diff --git a/isl_options_private.h b/isl_options_private.h index 941dbbb..80c9aa5 100644 --- a/isl_options_private.h +++ b/isl_options_private.h @@ -53,6 +53,7 @@ struct isl_options { int schedule_outer_zero_distance; int schedule_maximize_band_depth; int schedule_split_scaled; + int schedule_separate_components; unsigned schedule_algorithm; int schedule_fuse; }; diff --git a/isl_schedule.c b/isl_schedule.c index 7837295..8a804e8 100644 --- a/isl_schedule.c +++ b/isl_schedule.c @@ -2690,7 +2690,8 @@ static int compute_component_schedule(isl_ctx *ctx, int n_total_row, orig_total_row; int n_band, orig_band; - if (ctx->opt->schedule_fuse == ISL_SCHEDULE_FUSE_MIN) + if (ctx->opt->schedule_fuse == ISL_SCHEDULE_FUSE_MIN || + ctx->opt->schedule_separate_components) split_on_scc(graph); n_total_row = 0; -- 2.7.4