llvm-project/polly
Michael Kruse 7860c5fe4e [IslAst] Fix InParallelFor nesting.
IslAst could mark two nested outer loops as "OutermostParallel". It
caused that the code generator tried to OpenMP-parallelize both loops,
which it is not prepared loop.

It was because the recursive AST build algorithm managed a flag
"InParallelFor" to ensure that no nested loop is also marked as
"OutermostParallel". Unfortunatetly the same flag was used by nodes
marked as SIMD, and reset to false after the SIMD node. Since loops can
be marked as SIMD inside "OutermostParallel" loops, the recursive
algorithm again tried to mark loops as "OutermostParellel" although
still nested inside another "OutermostParallel" loop.

The fix exposed another bug: The function "astScheduleDimIsParallel" was
only called when a loop was potentially "OutermostParallel" or
"InnermostParallel", but as a side-effect also determines the minimum
dependence distance. Hence, changing when we need to know whether a loop
is "OutermostParallel" also changed which loop was annotated with
"#pragma minimal dependence distance".

Moreover, some complex condition linked with "InParallelFor" determined
whether a loop should be an "InnermostParallel" loop. It missed some
situations where it would not use mark as such although being inside an
SIMD mark node, and therefore not be annotated using "#pragma simd".

The changes in particular:

1. Split the "InParallelFor" flag into an "InParallelFor" and an
   "InSIMD" flag.

2. Unconditionally call "astScheduleDimIsParallel" for its side-effects
   and store the result in "InParallel" for later use.

3. Simplify the condition when a loop is "InnermostParallel".

Fixes llvm.org/PR33153 and llvm.org/PR38073.

llvm-svn: 343212
2018-09-27 13:39:37 +00:00
..
cmake [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC. 2018-08-01 00:15:16 +00:00
docs [doc] Fix HowToManuallyUseTheIndividualPiecesOfPolly 2018-09-26 15:22:39 +00:00
include/polly [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
lib [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
test [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
tools Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
unittests Update isl-cpp bindings 2018-08-09 05:07:14 +00:00
utils [arc] Remove unittesting from arcconfig 2018-05-15 13:43:42 +00:00
www Move www/experiments to docs/experiments 2018-09-26 15:21:43 +00:00
.arcconfig [arc] Remove unittesting from arcconfig 2018-05-15 13:43:42 +00:00
.arclint [External] Move lib/JSON to lib/External/JSON. NFC. 2017-02-05 15:26:56 +00:00
.gitattributes
.gitignore Do not track the isl PDF manual in SVN 2017-01-16 11:48:03 +00:00
CMakeLists.txt [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC. 2018-08-01 00:15:16 +00:00
CREDITS.txt
LICENSE.txt [External] Move lib/JSON to lib/External/JSON. NFC. 2017-02-05 15:26:56 +00:00
README Test commit 2017-06-28 12:58:44 +00:00

README

Polly - Polyhedral optimizations for LLVM
-----------------------------------------
http://polly.llvm.org/

Polly uses a mathematical representation, the polyhedral model, to represent and
transform loops and other control flow structures. Using an abstract
representation it is possible to reason about transformations in a more general
way and to use highly optimized linear programming libraries to figure out the
optimal loop structure. These transformations can be used to do constant
propagation through arrays, remove dead loop iterations, optimize loops for
cache locality, optimize arrays, apply advanced automatic parallelization, drive
vectorization, or they can be used to do software pipelining.