llvm-project/polly/include/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
..
CodeGen [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
Config [CMake] Retire Polly's FindCUDA.cmake in favour of CMake's default FindCUDA.cmake script. 2017-06-06 19:20:48 +00:00
Support [isl] Simplify iterator implementation by building on top of list accessors 2018-07-23 15:28:50 +00:00
Canonicalization.h Drop '@brief' from doxygen comments 2016-09-02 06:33:33 +00:00
CodePreparation.h Add missing license text to two headers. NFC. 2017-08-10 15:40:36 +00:00
DeLICM.h [DeLICM] Export Known and Written to DeLICMTests. NFC. 2017-04-13 16:32:39 +00:00
DependenceInfo.h [DepInfo] Use isl++ in Dependences::isValidSchedule. NFC. 2018-08-10 22:33:27 +00:00
FlattenAlgo.h Introduce isl C++ bindings, Part 1: value_ptr style interface 2017-03-10 11:41:03 +00:00
FlattenSchedule.h Fix namespaces after clang-format update 2017-03-01 15:54:27 +00:00
ForwardOpTree.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
JSONExporter.h Add missing license text to two headers. NFC. 2017-08-10 15:40:36 +00:00
LinkAllPasses.h [ScopInliner] Add a simple Scop-based inliner to polly. 2017-08-17 21:57:23 +00:00
Options.h
PolyhedralInfo.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
PruneUnprofitable.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
RegisterPasses.h clang-tidy: Add llvm namespace comments 2016-06-23 22:17:27 +00:00
ScheduleOptimizer.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
ScopBuilder.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
ScopDetection.h Adjust to clang-format changes 2018-03-20 17:16:32 +00:00
ScopDetectionDiagnostic.h [ScopDetect] Reject loop with multiple exit blocks. 2018-04-25 18:53:33 +00:00
ScopInfo.h [ScopBuilder] Set domain to empty instead of NULL. 2018-08-01 22:28:32 +00:00
ScopPass.h Remove namespace comment at end of class. NFC. 2018-04-05 15:32:06 +00:00
Simplify.h Add more statistics. 2017-08-23 13:50:30 +00:00
ZoneAlgo.h [ZoneAlgo] Use getDefToTarget in makeValInst. NFC. 2018-06-26 14:29:09 +00:00