Add test/lit.site.cfg to .gitignore

This allows to link Polly's lit.site.cfg from the build into the src directory,
without having it removed by every 'git clean':

  ln -s build/tools/polly/test/lit.site.cfg to src/tools/polly/test

Having this file in our src directory allows us to run llvm-lit on specific
test cases in the Polly test directory just by running 'llvm-lit test/case.ll'.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217336 91177308-0d34-0410-b5e6-96231b3b80d8
Added arcanist (arc) unit test support

  Thanks to Clemens (hammacher@cs.uni-saarland.de) extension of the
  arcanist unit test engine, we can run the llvm-lit tests automatically.

  Similar to the linters, aracanist will run all tests for each uploaded
  commit and asks the commiter for a statements in case unit tests fail.

  To use this feature the unit test engine needs to find the polly build
  directory. Currently we support the following setups:

    $POLLY_BUILD_DIR (environment variable)
    <root>/build
    <root>.build
    <root>-build
    <root:s/src/build>
    <cwd>


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217396 91177308-0d34-0410-b5e6-96231b3b80d8
[Fix] OpenMP parallel loop detection for the isl backend

  There was a bug in the IslAst which caused that no more outermost
  parallel loops were detected/checked after a parallel outermost loop
  of depth 1.

  + Test case attached


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217452 91177308-0d34-0410-b5e6-96231b3b80d8
Add -e to test generation script

The -e flag exits the script with a non-zero code if any subcommand
fails. This flag allows us to notice as early as possible if the
test was not properly regenerated using a command like:

$ create_ll.sh t.c && opt < t.ll -polly ...

The above pattern is useful when iteratively developing a test case
to guard against un-noticed syntax errors.

Differential Revision: http://reviews.llvm.org/D5276


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217463 91177308-0d34-0410-b5e6-96231b3b80d8
No need to check for non-existing std::map elements

It seems we added guards to check for non-existing std::map elements to make
sure they are default constructed before first accessed. Besides, the code
being wrong because of checking Context.NonAffineAccesses[BasePointer].size()
instead of Context.cound(BasePointer), such a check is also not necessary
as std::map takes care of this already.

From the std::map documentation:

"If k does not match the key of any element in the container, the function
inserts a new element with that key and returns a reference to its mapped value.
Notice that this always increases the container size by one, even if no mapped
value is assigned to the element (the element is constructed using its default
constructor)."

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217506 91177308-0d34-0410-b5e6-96231b3b80d8
Use "const auto &" in range based for loops

This previous code added in r216842 most likely created unnecessary copies.

Reported-by: Duncan P. N. Exon Smith  <dexonsmith@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217507 91177308-0d34-0410-b5e6-96231b3b80d8
[Refactor] Cleanup isl code generation

Summary:
  + Refactor the runtime check (RTC) build function
  + Added helper function to create an PollyIRBuilder
  + Change the simplify region function to create not
    only unique entry and exit edges but also enfore that
    the entry edge is unconditional
  + Cleaned the IslCodeGeneration runOnScop function:
      - less post-creation changes of the created IR
  + Adjusted and added test cases

Reviewers: grosser, sebpop, simbuerg, dpeixott

Subscribers: llvm-commits, #polly

Differential Revision: http://reviews.llvm.org/D5076



git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217508 91177308-0d34-0410-b5e6-96231b3b80d8
Allow to generate a loop without the GuardBB

  This allows us to omit the GuardBB in front of created loops
  if we can show the loop trip count is at least one. It also
  simplifies the dominance relation inside the new created region.
  A GuardBB (even with a constant branch condition) might trigger
  false dominance errors during function verification.

Differential Revision: http://reviews.llvm.org/D5297



git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217525 91177308-0d34-0410-b5e6-96231b3b80d8
Remove executable bit on all header files

Some header files had been marked executable by accident.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217587 91177308-0d34-0410-b5e6-96231b3b80d8
Remove executable bit on test files

Some test files had been marked executable by accident.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217663 91177308-0d34-0410-b5e6-96231b3b80d8
Improve test coverage for non-affine access functions

We now verify that such functions are correctly detected even in combination
with delinearization. This change is added to ensure we have good test coverage
for the subsequent delinearization fix.

We also remove unnecessary instructions from the test case.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217664 91177308-0d34-0410-b5e6-96231b3b80d8
[Polly] Move MAY/MUST write property to IRAccess

  Differential Revision: http://reviews.llvm.org/D5223



git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217665 91177308-0d34-0410-b5e6-96231b3b80d8
Check that the elements of an array have the same size

At the moment we assume that only elements of identical size are stored/loaded
to a certain base pointer. This patch adds logic to the scop detection to verify
this.

Differential Revision: http://reviews.llvm.org/D5329

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217727 91177308-0d34-0410-b5e6-96231b3b80d8
Delinearize _all_ accesses to a multi-dimensional array

Even though we previously correctly detected the multi-dimensional access
pattern for accesses with a certain base address, we only delinearized
non-affine accesses to this address. Affine accesses have not been touched and
remained as single dimensional accesses. The result was an inconsistent
description of accesses to the same array, with some being one dimensional and
some being multi-dimensional.

This patch ensures that all accesses are delinearized with the same
dimensionality as soon as a single one of them has been detected as non-affine.

While writing this patch, it became evident that the options
-polly-allow-nonaffine and -polly-detect-keep-going have not been properly
supported in case delinearization has been turned on. This patch adds relevant
test coverage and addresses these issues as well. We also added some more
documentation to the functions that are modified in this patch.

This fixes llvm.org/PR20123

Differential Revision: http://reviews.llvm.org/D5329

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217728 91177308-0d34-0410-b5e6-96231b3b80d8
Compute and print the minimal loop carried dependency distance

  During the IslAst parallelism check also compute the minimal dependency
  distance and store it in the IstAst for node.

Reviewer: sebpop

Differential Revision: http://reviews.llvm.org/D4987


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217729 91177308-0d34-0410-b5e6-96231b3b80d8
[Fix] Rewire the Region after a unconditional entry edge is created

  We use SplitEdge to split a conditional entry edge of the SCoP region.
  However, SplitEdge can cause two different situations (depending on
  whether or not the edge is critical). This patch tests
  which one is present and deals with the former unhandled one.

  It also refactors and unifies the case we have to change the basic
  blocks of the SCoP to new ones (see replaceScopAndRegionEntry).


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@217802 91177308-0d34-0410-b5e6-96231b3b80d8
Updated to isl 2c19ecd444095d6f560349018f68993bc0e03691

  Changed test cases and fixed warnings.


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@218043 91177308-0d34-0410-b5e6-96231b3b80d8
Allow the IslExprBuilder to compare pointers


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@218044 91177308-0d34-0410-b5e6-96231b3b80d8
Allow the IslExprBuilder to build address of expressions


git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@218045 91177308-0d34-0410-b5e6-96231b3b80d8
[RTC] Runtime Alias Checks for the ISL backend

  This change will build all alias groups (minimal/maximal accesses
  to possible aliasing base pointers) we have to check before
  we can assume an alias free environment. It will also use these
  to create Runtime Alias Checks (RTC) in the ISL code generation
  backend, thus allow us to optimize SCoPs despite possibly aliasing
  pointers when this backend is used.

  This feature will be enabled for the isl code generator, e.g.,
  --polly-code-generator=isl, but disabled for:
    - The cloog code generator (still the default).
    - The case delinearization is enabled.
    - The case non-affine accesses are allowed.


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