isl_union_set_compute_schedule: separate components by default
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 11 Apr 2012 09:42:29 +0000 (11:42 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 6 May 2012 12:33:06 +0000 (14:33 +0200)
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 <skimo@kotnet.org>
include/isl/schedule.h
isl_options.c
isl_options_private.h
isl_schedule.c

index 4b7f59e..b9b07aa 100644 (file)
@@ -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);
index 75874c1..8f7ccd0 100644 (file)
@@ -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)
index 941dbbb..80c9aa5 100644 (file)
@@ -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;
 };
index 7837295..8a804e8 100644 (file)
@@ -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;