[llvm-commits] [polly] r146556 - /polly/trunk/lib/ScheduleOptimizer.cpp

Tobias Grosser grosser at fim.uni-passau.de
Wed Dec 14 00:58:40 PST 2011


Author: grosser
Date: Wed Dec 14 02:58:39 2011
New Revision: 146556

URL: http://llvm.org/viewvc/llvm-project?rev=146556&view=rev
Log:
Scheduler: Set maximal constant term

If larger coefficients appear as part of the input dependences, the schedule
calculation can take a very long time. We observed that the main overhead in
this calculation is due to optimizing the constant coefficients. They are
misused to increase locality by merging several unrelated dimensions into a
single dimension. This unwanted optimization increases the complexity of the
generated code and furthermore slows it down.

We use a new isl scheduler option to bound the values in the constant dimension
by a user defined value (20 in our case). If the right value is choosen, costly
overoptimization is prevented.

This solution works, but requires a specific (here almost randomly choosen)
value by which the constants are bound. For the moment, this is our best
solution, but we hope to to find a more generic one later on.

After these patch the extremly long compile time for simple kernels like 2mm or
3mm is reduced to a reasonable amount of time (Not more than a couple of seconds
even in debug mode).

Modified:
    polly/trunk/lib/ScheduleOptimizer.cpp

Modified: polly/trunk/lib/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/ScheduleOptimizer.cpp?rev=146556&r1=146555&r2=146556&view=diff
==============================================================================
--- polly/trunk/lib/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/ScheduleOptimizer.cpp Wed Dec 14 02:58:39 2011
@@ -37,6 +37,8 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/CommandLine.h"
 
+static const int CONSTANT_BOUND = 20;
+
 using namespace llvm;
 using namespace polly;
 
@@ -433,6 +435,7 @@
 
   isl_schedule *schedule;
 
+  isl_options_set_schedule_max_constant_term(S.getIslCtx(), CONSTANT_BOUND);
   schedule  = isl_union_set_compute_schedule(domain, validity, proximity);
 
   DEBUG(dbgs() << "Computed schedule: ");





More information about the llvm-commits mailing list