llvm-capstone/polly/lib/CodeGen
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
..
BlockGenerators.cpp Fix formatting 2018-06-05 09:03:46 +00:00
CodegenCleanup.cpp [polly] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:37:17 +00:00
CodeGeneration.cpp [polly] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:37:17 +00:00
IRBuilder.cpp [CodeGen] Fix potential null pointer dereference. NFC. 2018-07-05 13:44:50 +00:00
IslAst.cpp [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
IslExprBuilder.cpp [IslExprBuilder] Do not generate RTC with more than 64 bit 2017-09-23 15:32:07 +00:00
IslNodeBuilder.cpp [CodeGen] Convert IslNodeBuilder::getNumberOfIterations to isl++. NFC. 2018-07-31 23:01:50 +00:00
LoopGenerators.cpp Fix the build after r314375 2017-09-28 12:20:24 +00:00
ManagedMemoryRewrite.cpp [polly] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:37:17 +00:00
PerfMonitor.cpp [PerfMonitor] Fix rdtscp callsites 2018-09-11 14:17:44 +00:00
PPCGCodeGeneration.cpp PPCG codegen 2018-08-01 10:48:38 +00:00
RuntimeDebugBuilder.cpp [CodeGen] Print executed statement instances at runtime. 2018-04-25 19:43:49 +00:00
Utils.cpp [PPCGCodeGeneration] Fix runtime check adjustments since they make assumptions about BB layout. 2017-07-14 10:00:25 +00:00