[llvm-commits] [polly] r149265 - /polly/trunk/lib/ScheduleOptimizer.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Mon Jan 30 11:38:50 PST 2012
Author: grosser
Date: Mon Jan 30 13:38:50 2012
New Revision: 149265
URL: http://llvm.org/viewvc/llvm-project?rev=149265&view=rev
Log:
Scheduler: Allow to select the fusion strategy
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=149265&r1=149264&r2=149265&view=diff
==============================================================================
--- polly/trunk/lib/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/ScheduleOptimizer.cpp Mon Jan 30 13:38:50 2012
@@ -56,6 +56,11 @@
cl::desc("Dependences should be simplified (yes/no)"),
cl::Hidden, cl::init("yes"));
+static cl::opt<std::string>
+FusionStrategy("polly-opt-fusion",
+ cl::desc("The fusion strategy to choose (min/max)"),
+ cl::Hidden, cl::init("max"));
+
namespace {
class IslScheduleOptimizer : public ScopPass {
@@ -459,6 +464,19 @@
DEBUG(dbgs() << "Validity := "; isl_union_map_dump(validity);
dbgs() << ";\n");
+ int IslFusionStrategy;
+
+ if (FusionStrategy == "max") {
+ IslFusionStrategy = ISL_SCHEDULE_FUSE_MAX;
+ } else if (FusionStrategy == "min") {
+ IslFusionStrategy = ISL_SCHEDULE_FUSE_MIN;
+ } else {
+ errs() << "warning: Unknown fusion strategy. Falling back to maximal "
+ "fusion.\n";
+ IslFusionStrategy = ISL_SCHEDULE_FUSE_MAX;
+ }
+
+ isl_options_set_schedule_fuse(S.getIslCtx(), IslFusionStrategy);
isl_options_set_schedule_max_constant_term(S.getIslCtx(), CONSTANT_BOUND);
isl_options_set_schedule_maximize_band_depth(S.getIslCtx(), 1);
More information about the llvm-commits
mailing list