[polly] r274271 - Simplify: get isl_ctx only once [NFC]

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 13:42:57 PDT 2016


Author: grosser
Date: Thu Jun 30 15:42:56 2016
New Revision: 274271

URL: http://llvm.org/viewvc/llvm-project?rev=274271&view=rev
Log:
Simplify: get isl_ctx only once [NFC]

... instead of call S.getIslCtx() many times.

Modified:
    polly/trunk/lib/Transform/ScheduleOptimizer.cpp

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=274271&r1=274270&r2=274271&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Thu Jun 30 15:42:56 2016
@@ -712,15 +712,16 @@ bool IslScheduleOptimizer::runOnScop(Sco
     IslOuterCoincidence = 0;
   }
 
-  isl_options_set_schedule_outer_coincidence(S.getIslCtx(),
-                                             IslOuterCoincidence);
-  isl_options_set_schedule_serialize_sccs(S.getIslCtx(), IslSerializeSCCs);
-  isl_options_set_schedule_maximize_band_depth(S.getIslCtx(), IslMaximizeBands);
-  isl_options_set_schedule_max_constant_term(S.getIslCtx(), MaxConstantTerm);
-  isl_options_set_schedule_max_coefficient(S.getIslCtx(), MaxCoefficient);
-  isl_options_set_tile_scale_tile_loops(S.getIslCtx(), 0);
+  isl_ctx *Ctx = S.getIslCtx();
 
-  isl_options_set_on_error(S.getIslCtx(), ISL_ON_ERROR_CONTINUE);
+  isl_options_set_schedule_outer_coincidence(Ctx, IslOuterCoincidence);
+  isl_options_set_schedule_serialize_sccs(Ctx, IslSerializeSCCs);
+  isl_options_set_schedule_maximize_band_depth(Ctx, IslMaximizeBands);
+  isl_options_set_schedule_max_constant_term(Ctx, MaxConstantTerm);
+  isl_options_set_schedule_max_coefficient(Ctx, MaxCoefficient);
+  isl_options_set_tile_scale_tile_loops(Ctx, 0);
+
+  isl_options_set_on_error(Ctx, ISL_ON_ERROR_CONTINUE);
 
   isl_schedule_constraints *ScheduleConstraints;
   ScheduleConstraints = isl_schedule_constraints_on_domain(Domain);
@@ -732,7 +733,7 @@ bool IslScheduleOptimizer::runOnScop(Sco
       isl_schedule_constraints_set_coincidence(ScheduleConstraints, Validity);
   isl_schedule *Schedule;
   Schedule = isl_schedule_constraints_compute_schedule(ScheduleConstraints);
-  isl_options_set_on_error(S.getIslCtx(), ISL_ON_ERROR_ABORT);
+  isl_options_set_on_error(Ctx, ISL_ON_ERROR_ABORT);
 
   // In cases the scheduler is not able to optimize the code, we just do not
   // touch the schedule.
@@ -740,7 +741,7 @@ bool IslScheduleOptimizer::runOnScop(Sco
     return false;
 
   DEBUG({
-    auto *P = isl_printer_to_str(S.getIslCtx());
+    auto *P = isl_printer_to_str(Ctx);
     P = isl_printer_set_yaml_style(P, ISL_YAML_STYLE_BLOCK);
     P = isl_printer_print_schedule(P, Schedule);
     dbgs() << "NewScheduleTree: \n" << isl_printer_get_str(P) << "\n";




More information about the llvm-commits mailing list