Replace %defaultOpts with explicit pass names

This replaces the use of %defaultOpts = '-basicaa -polly-prepare' with the
minimal set of passes necessary for a test to succeed. Of the test cases that
previously used %defaultOpts 76 test cases require none of these passes, 42
need -basicaa and only 2 need -polly-prepare. Our change makes this requirement
explicit.

In Polly many test cases have been using a macro '%defaultOpts' which run a
couple of preparing passes before the actual Polly test case. This macro was
introduced very early in the development of Polly and originally contained a
large set of canonicalization passes.  However, as the need for additional
canonicalization passes makes test cases harder to understand and also more
fragile in terms of changes in such passes, we aim since a longer time to only
include the minimal set of passes necessary. This patch removes the last
leftovers from of %defaultOpts and brings our tests cases more in line to what
is usus in LLVM itself.

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@216815 91177308-0d34-0410-b5e6-96231b3b80d8
Always pipe in test files

In Polly we used to have a mix of test cases, some that used 'opt %s' and others
that used 'opt < %s'. We now change all to use 'opt < %s'. Piping in test files
is preferable as it does prevent temporary files to be written to disk. This
brings us in line with what is usus in LLVM.

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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@216842 91177308-0d34-0410-b5e6-96231b3b80d8
Introduce a typedef for the IDToValue type

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

git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@216844 91177308-0d34-0410-b5e6-96231b3b80d8
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
Update format and fix wrong file name
Add GPGPU codegen related files from ppcg into polly

Not made any changes at the moment.
Remove and comment unused header includes

- pet.h has been included in ppcg.h thus no need to include it once
  again.
- Change header include from <pet.h> to "pet.h"
Remove useless ppcg functions to make compiling success
Rename *.c to *.cpp

So that we can use polly's data structure in ppcg. In the next step,
pet_stmt will be replaced with polly::ScopStmt. Other than renaming all
c files into cpp files, there are two main kinds of changes in the code:
 - We rename all the varialbes named 'private', because 'private' is
   used as keyword in C++.
 - We enforce pointer type casts for 'void *' to avoid build errors that
   exist in C++ but not in C.
Update makefile to include GPGPU codegen files into build

All the added GPGPU codegen files compiled successfully.
Do not check format of the GPGPU codegen sources.
Remove use of isl_printer parameter in "generate" function

The original generate function is divided into 2 parts:
 - the new generate function: store the generated ast_node host tree
   in gen and return void.

Two functions call or use "generate" as callback are commented out.
 - generate_wrap
 - generate_gpu

Add new declaration of generate_gpu to gpu.h.