[all-commits] [llvm/llvm-project] 9b123c: [Polly] Sanitize optimization levels.

Michael Kruse via All-commits all-commits at lists.llvm.org
Thu Feb 11 21:09:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b123cde6340449669b88afc540d560080b4113b
      https://github.com/llvm/llvm-project/commit/9b123cde6340449669b88afc540d560080b4113b
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-02-11 (Thu, 11 Feb 2021)

  Changed paths:
    M polly/lib/Support/RegisterPasses.cpp

  Log Message:
  -----------
  [Polly] Sanitize optimization levels.

The description of the -polly switch stated that it was only enabled
with -O3. This was a lie, the optimization level was ignored. Only at
-O0 Polly was not added to the pass pipeline because the pass builder,
but only because the extension points were not triggered.

In the NewPM, the VectorizerStart extensions point is actually trigger
even with -O0 which leads to the following crash:

   Assertion `Level != OptimizationLevel::O0 && "Must request optimizations!"' failed.

We sanitize the optimization levels using the following rules for both
pass mangers:

 1. Only enable Polly if optimizing at all (-O1, -O2 or -O3).
 2. Do not enable Polly when optimizing for size.
 3. Ignore the optimization level for diagnostic passes (printer, viewer
    or JScop-exporter).
 4. If only diagnostic passes enabled, skip the code-generation.
 5. Fix the description of the -polly command line option.




More information about the All-commits mailing list