hanchenye-llvm-project/polly
Tobias Grosser 349d1c3368 [ScopDetection] Remove redundant checks for endless loops
Summary:
Both `canUseISLTripCount()` and `addOverApproximatedRegion()` contained checks
to reject endless loops which are now removed and replaced by a single check
in `isValidLoop()`.

For reporting such loops the `ReportLoopOverlapWithNonAffineSubRegion` is
renamed to `ReportLoopHasNoExit`. The test case
`ReportLoopOverlapWithNonAffineSubRegion.ll` is adapted and renamed as well.

The schedule generation in `buildSchedule()` is based on the following
assumption:

Given some block B that is contained in a loop L and a SESE region R,
we assume that L is contained in R or the other way around.

However, this assumption is broken in the presence of endless loops that are
nested inside other loops. Therefore, in order to prevent erroneous behavior
in `buildSchedule()`, r265280 introduced a corresponding check in
`canUseISLTripCount()` to reject endless loops. Unfortunately, it was possible
to bypass this check with -polly-allow-nonaffine-loops which was fixed by adding
another check to reject endless loops in `allowOverApproximatedRegion()` in
r273905. Hence there existed two separate locations that handled this case.

Thank you Johannes Doerfert for helping to provide the above background
information.

Reviewers: Meinersbur, grosser

Subscribers: _jdoerfert, pollydev

Differential Revision: https://reviews.llvm.org/D24560

Contributed-by: Matthias Reisinger <d412vv1n@gmail.com>
llvm-svn: 281987
2016-09-20 17:05:22 +00:00
..
cmake Remove -fvisibility=hidden and FORCE_STATIC. 2016-09-12 18:25:00 +00:00
docs docs: Remove reference to PoCC 2016-05-17 19:44:16 +00:00
include/polly [ScopDetection] Remove redundant checks for endless loops 2016-09-20 17:05:22 +00:00
lib [ScopDetection] Remove redundant checks for endless loops 2016-09-20 17:05:22 +00:00
test [ScopDetection] Remove redundant checks for endless loops 2016-09-20 17:05:22 +00:00
tools GPURuntime: ensure compilation with C99 2016-09-11 07:32:50 +00:00
unittests Add -polly-flatten-schedule pass. 2016-09-08 15:02:36 +00:00
utils Revise polly-{update|check}-format targets 2015-09-14 16:59:50 +00:00
www Add forgotten image 2016-08-30 12:41:29 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.arclint Adjusted arc linter config for modern version of arcanist 2015-08-12 09:01:16 +00:00
.gitattributes
.gitignore Add git patch files to .gitignore 2015-06-23 20:55:01 +00:00
CMakeLists.txt Query llvm-config to get system libs required for linking. 2016-08-25 14:58:29 +00:00
CREDITS.txt
LICENSE.txt Update copyright year to 2016. 2016-03-30 22:41:38 +00:00
README

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.