polly: update for LLVM API change

SVN r209103 removed the OwningPtr variant of the MemoryBuffer APIs.  Switch to
the equivalent std::unique_ptr versions.  This should clear up the build bots.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209104 91177308-0d34-0410-b5e6-96231b3b80d8
Split implementation from ScopDetectionDiagnostic.h

We don't want the Statistic variables in every module that
includes the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209571 91177308-0d34-0410-b5e6-96231b3b80d8
Store all RejectReasons that occurred in a log.

This stores all RejectReasons created for one region
in a RejectLog inside the DetectionContext. For now
this only keeps track of the last error.

A separate patch will enable the tracking of all errors.
This patch itself does no harm (yet).

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209572 91177308-0d34-0410-b5e6-96231b3b80d8
Substitue LastError & InvalidRegions with RejectLogs

Use the new ScopDetectionDiagnostics to implement
the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209573 91177308-0d34-0410-b5e6-96231b3b80d8
ScopDetection: Support keep-going

Support a 'keep-going' mode for the ScopDetection. In this mode, we just keep
on detecting, even if we encounter an error.

This is useful for diagnosing SCoP candidates. Sometimes you want all the
errors. Invalid SCoPs will still be refused in the end, we just refuse to
abort on the first error.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209574 91177308-0d34-0410-b5e6-96231b3b80d8
Expose diagnostic info to users

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209575 91177308-0d34-0410-b5e6-96231b3b80d8
ScopDetectionDiagnostic: Update Makefile

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209584 91177308-0d34-0410-b5e6-96231b3b80d8
pass element size to delinearization

Instead of relying on the delinearization to infer the size of an element,
compute the element size from the base address type. This is a much more precise
way of computing the element size than before, as we would have mixed together
the size of an element with the strides of the innermost dimension.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209695 91177308-0d34-0410-b5e6-96231b3b80d8
delinearize does not return a remainder

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209696 91177308-0d34-0410-b5e6-96231b3b80d8
Fix formatting

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209710 91177308-0d34-0410-b5e6-96231b3b80d8
Reorder cmake include folders (polly source first)


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209750 91177308-0d34-0410-b5e6-96231b3b80d8
Added option for n-dimensional rectangular tiling

+ CL-option --polly-tile-sizes=<int,...,int>
  The i'th value is used as a tile size for dimension i, if
  there is no i'th value, the value of --polly-default-tile-size is
  used

+ CL-option --polly-default-tile-size=int
  Used if no tile size is given for a dimension i

+ 3 Simple testcases


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@209753 91177308-0d34-0410-b5e6-96231b3b80d8
Remove superfluous semicolon confusing clang-format.


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210016 91177308-0d34-0410-b5e6-96231b3b80d8
record delinearization result and reuse it in polyhedral translation

Without this patch, the testcase would fail on the delinearization of the second
array:

; void foo(long n, long m, long o, double A[n][m][o]) {
;   for (long i = 0; i < n; i++)
;     for (long j = 0; j < m; j++)
;       for (long k = 0; k < o; k++) {
;         A[i+3][j-4][k+7] = 1.0;
;         A[i][0][k] = 2.0;
;       }
; }

; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[3 + i0, -4 + i1, 7 + i2] };
; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, 0, i2] };

Here is the output of FileCheck on the testcase without this patch:

; CHECK: [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[i0, 0, i2] };
         ^
<stdin>:26:2: note: possible intended match here
 [n, m, o] -> { Stmt_for_body6[i0, i1, i2] -> MemRef_A[o0] };
 ^

It is possible to find a good delinearization for A[i][0][k] only in the context
of the delinearization of both array accesses.

There are two ways to delinearize together all array subscripts touching the
same base address: either duplicate the code from scop detection to first gather
all array references and then run the delinearization; or as implemented in this
patch, use the same delinearization info that we computed during scop detection.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210117 91177308-0d34-0410-b5e6-96231b3b80d8
Fix formatting

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210124 91177308-0d34-0410-b5e6-96231b3b80d8
Use range-based for loops

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210170 91177308-0d34-0410-b5e6-96231b3b80d8
www: Polly can be built without any GPLed software

Thanks to Sebastian Pop and David Peixotto.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210176 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust multidim test cases to not access out-of-bound memory

We do this currently only for test cases where we have integer offsets that
clearly access array dimensions out-of-bound.

-;   for (long i = 0; i < n; i++)
-;     for (long j = 0; j < m; j++)
-;       for (long k = 0; k < o; k++)
+;   for (long i = 0; i < n - 3; i++)
+;     for (long j = 4; j < m; j++)
+;       for (long k = 0; k < o - 7; k++)
 ;         A[i+3][j-4][k+7] = 1.0;

This will be helpful if we later want to simplify the access functions under the
assumption that they do not access memory out of bounds.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210179 91177308-0d34-0410-b5e6-96231b3b80d8
Adjust another test case to not access out of bounds

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210208 91177308-0d34-0410-b5e6-96231b3b80d8
Test delinearization of 2D diagonal matrix

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@210538 91177308-0d34-0410-b5e6-96231b3b80d8