[llvm-commits] [polly] r142773 - in /polly/trunk: lib/RegisterPasses.cpp www/example_load_Polly_into_clang.html

Sebastian Pop spop at codeaurora.org
Tue Nov 15 13:42:00 PST 2011


On Sun, Oct 23, 2011 at 3:59 PM, Tobias Grosser
<grosser at fim.uni-passau.de> wrote:
> Author: grosser
> Date: Sun Oct 23 15:59:35 2011
> New Revision: 142773
>
> URL: http://llvm.org/viewvc/llvm-project?rev=142773&view=rev
> Log:
> Add an option to run the PoCC optimizer
>
> Modified:
>    polly/trunk/lib/RegisterPasses.cpp
>    polly/trunk/www/example_load_Polly_into_clang.html
>
> Modified: polly/trunk/lib/RegisterPasses.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/RegisterPasses.cpp?rev=142773&r1=142772&r2=142773&view=diff
> ==============================================================================
> --- polly/trunk/lib/RegisterPasses.cpp (original)
> +++ polly/trunk/lib/RegisterPasses.cpp Sun Oct 23 15:59:35 2011
> @@ -37,6 +37,10 @@
>        cl::desc("Disable Polly Code Generation"), cl::Hidden,
>        cl::init(false));
>  static cl::opt<bool>
> +UsePocc("polly-use-pocc",
> +       cl::desc("Use the PoCC optimizer instead of the one in isl"), cl::Hidden,
> +       cl::init(false));
> +static cl::opt<bool>
>  PollyViewer("polly-show",
>        cl::desc("Enable the Polly DOT viewer in -O3"), cl::Hidden,
>        cl::value_desc("Run the Polly DOT viewer at -O3"),
> @@ -124,8 +128,21 @@
>   if (PollyOnlyPrinter)
>     PM.add(polly::createDOTOnlyPrinterPass());
>
> -  if (!DisableScheduler)
> -    PM.add(polly::createIslScheduleOptimizerPass());
> +  if (!DisableScheduler) {

Could you please avoid double negation: what about declaring
a bool EnableScheduler and then use that?

> +    if (!UsePocc)
> +      PM.add(polly::createIslScheduleOptimizerPass());
> +    else {

Also here, please use the positive condition to avoid the negation:

if (UsePocc) {
  #ifdef SCOPLIB_FOUND
  etc.
} else {
  PM.add(polly::createIslScheduleOptimizerPass());
}

> +#ifdef SCOPLIB_FOUND
> +      PM.add(polly::createPoccPass());
> +#else
> +      errs() << "Polly is compiled without scoplib support. As scoplib is "
> +             << "required to run PoCC, PoCC is also not available. Falling "
> +             << "back to the isl optimizer.\n";
> +      PM.add(polly::createIslScheduleOptimizerPass());
> +#endif
> +    }
> +
> +  }
>
>   if (!DisableCodegen)
>     PM.add(polly::createCodeGenerationPass());
>
> Modified: polly/trunk/www/example_load_Polly_into_clang.html
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/www/example_load_Polly_into_clang.html?rev=142773&r1=142772&r2=142773&view=diff
> ==============================================================================
> --- polly/trunk/www/example_load_Polly_into_clang.html (original)
> +++ polly/trunk/www/example_load_Polly_into_clang.html Sun Oct 23 15:59:35 2011
> @@ -67,6 +67,13 @@
>  Polly automatically runs a polyhedral optimizer to optimize the schedules. To
>  disable it add the option '-polly-no-optimizer'.
>
> +<h3>Use the PoCC optimizer</h3>
> +Polly uses by default the isl scheduling optimizer, a new implementation of the
> +well known Pluto algorithm. The main reason for the isl scheduler being the
> +default is that it does not require any additional libraries or tools to be
> +installed. As the new scheduler may still have some bugs and because being
> +able to compare is good in general, it is possible to switch the used optimizer
> +back to PoCC. For this add the option '-polly-use-pocc'.
>
>  </div>
>  </body>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
Sebastian Pop
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum




More information about the llvm-commits mailing list