isl_union_set_compute_schedule: make preference for large bands configurable
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 11 Jul 2011 11:55:23 +0000 (13:55 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 11 Jul 2011 11:55:23 +0000 (13:55 +0200)
The original code would always try to maximize the number of scheduling
dimensions in a band, but this is not always desirable.
Make this heuristic configurable and turn it off by default.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
include/isl/options.h
isl_options.c
isl_schedule.c

index f2a14b7..d280ab3 100644 (file)
@@ -61,6 +61,7 @@ struct isl_options {
 
        int                     schedule_parametric;
        int                     schedule_outer_zero_distance;
+       int                     schedule_maximize_band_depth;
        int                     schedule_split_parallel;
 };
 
index 1879c7b..1948c2b 100644 (file)
@@ -121,6 +121,9 @@ ISL_ARG_BOOL(struct isl_options, schedule_outer_zero_distance, 0,
        "schedule-outer-zero-distance", 0,
        "try to construct schedules with outer zero distances over "
        "proximity dependences")
+ISL_ARG_BOOL(struct isl_options, schedule_maximize_band_depth, 0,
+       "schedule-maximize-band-depth", 0,
+       "maximize the number of scheduling dimensions in a band")
 ISL_ARG_BOOL(struct isl_options, schedule_split_parallel, 0,
        "schedule-split-parallel", 1,
        "split non-tilable bands with parallel schedules")
index 90dadee..320db6c 100644 (file)
@@ -2273,6 +2273,9 @@ static int compute_schedule_wcc(isl_ctx *ctx, struct isl_sched_graph *graph)
                        return -1;
                if (sol->size == 0) {
                        isl_vec_free(sol);
+                       if (!ctx->opt->schedule_maximize_band_depth &&
+                           graph->n_total_row > graph->band_start)
+                               return compute_next_band(ctx, graph);
                        if (graph->src_scc >= 0)
                                return compute_split_schedule(ctx, graph);
                        if (graph->n_total_row > graph->band_start)