Commit Graph

757 Commits

Author SHA1 Message Date
Tobias Grosser 7670bb5c31 Cloog: Add virtual destructor to silence gcc warning
This silences the following warning:

  'polly::ClastVisitor' has virtual functions but non-virtual destructor
  [-Wnon-virtual-dtor]

llvm-svn: 177798
2013-03-23 01:10:53 +00:00
Tobias Grosser 4d96c8d714 clang-format: Many more files
After this commit, polly is clang-format clean. This can be tested with
'ninja polly-check-format'. Updates to clang-format may change this, but the
differences will hopefully be both small and general improvements to the
formatting.

We currently have some not very nice formatting for a couple of items, DEBUG()
stmts for example. I believe the benefit of being clang-format clean outweights
the not perfect layout of this code.

llvm-svn: 177796
2013-03-23 01:05:07 +00:00
Tobias Grosser 0db04b4778 cmake: Do not clang-format check the externally imported json library
llvm-svn: 177795
2013-03-23 01:04:48 +00:00
Tobias Grosser 45af235e09 RegisterPasses: clang-format
llvm-svn: 177787
2013-03-23 00:32:21 +00:00
Tobias Grosser f008da125c Instvarsimplify: clang-format
Even though we will soon get rid of this pass, we reformat it on the way to
make polly clang-format clean.

llvm-svn: 177786
2013-03-23 00:32:18 +00:00
Tobias Grosser 9abbfc0b69 IndependentBlocks: clang-format and remove includes
llvm-svn: 177785
2013-03-23 00:32:15 +00:00
Tobias Grosser c30d9cc678 DeadCodeElimination: clang-format and comment
llvm-svn: 177782
2013-03-23 00:16:05 +00:00
Tobias Grosser 33bc2e93be CodePreparation: Comment and format the file properly
llvm-svn: 177781
2013-03-23 00:13:39 +00:00
Tobias Grosser 369430ffca codegen: properly instantiate SCEVs to the place where they are used
Given the following code

    for (i = 0; i < 10; i++) {
      ;
    }

S:  A[i] = 0

When code generating S using scev based code generation, we need to retrieve
the scev of 'i' at the location of 'S'. If we do not do this the scev that
we obtain will be expressed as {0,+,1}_for and will reference loop iterators
that do not surround 'S' and that we consequently do not know how to code
generate. What we really want is the scev to be instantiated to the value of 'i'
after the loop. This value is {10} and it can be code generated without
troubles.

llvm-svn: 177777
2013-03-22 23:42:53 +00:00
Sebastian Pop 27c10c6b1f ScopInfo: do not call getCanonicalInductionVariable for SCEVCodegen
llvm-svn: 177771
2013-03-22 22:07:43 +00:00
Tobias Grosser 8ff029ccf1 Add failing test case
llvm-svn: 177645
2013-03-21 16:14:55 +00:00
Tobias Grosser 4e318abece Do not canonicalize indvars with scev based codegen
Scev code generation can now handle scops with non canonical induction
variables. Hence there is no need to introduce canonical ones any more.

llvm-svn: 177644
2013-03-21 16:14:53 +00:00
Tobias Grosser 826b2af112 Remove last uses of canoncial induction variable when scev code generating
We now detect scops without a canonical induction variable and can generate a
polyhedral representation for them. There was no modification necessary to
code generate these scops.

llvm-svn: 177643
2013-03-21 16:14:50 +00:00
Tobias Grosser 1f0d82c7d7 TempScop: Make assert more descriptive
llvm-svn: 177642
2013-03-21 16:14:45 +00:00
Tobias Grosser 5bfa4f8eb8 CodePrepare: Do not require canonical induction variables for scev based mode
llvm-svn: 177593
2013-03-20 22:41:53 +00:00
Tobias Grosser db8b8a5b8e ScopDetect: Test case to verify that base pointers are scop invariant
llvm-svn: 177582
2013-03-20 21:40:11 +00:00
Tobias Grosser e4584f6abf ScopDetect: Add test cases for non-simple regions
llvm-svn: 177567
2013-03-20 20:02:35 +00:00
Tobias Grosser ecfe21b792 Remove dependence on canonical induction variable
When using the scev based code generation, we now do not rely on the presence
of a canonical induction variable any more. This commit prepares the path to
(conditionally) disable the induction variable canonicalization pass.

llvm-svn: 177548
2013-03-20 18:03:18 +00:00
Andy Gibbs 36e6ca0143 Remove unnecessary explicit typing in std::make_pair
llvm-svn: 177528
2013-03-20 15:42:59 +00:00
Tobias Grosser b921e6377b Add option -polly-code-generator=none
This allows us to test Polly and the Polly optimizer without actually doing
code generation at the end. By enabling this option, we can also measure the
compile time overhead due to code generation and the cost of LLVM optimizing the
newly generated code.t

llvm-svn: 177516
2013-03-20 13:03:26 +00:00
Tobias Grosser 0fbbbf6aa7 Silence 'variable unused' warning in release mode
llvm-svn: 177515
2013-03-20 13:03:25 +00:00
Tobias Grosser 84b81dee55 ScopDetect: Remove some redundant semicolons
llvm-svn: 177444
2013-03-19 21:44:07 +00:00
Tobias Grosser d2fbbf0f74 IndependentBlocks: Add a couple of test cases.
llvm-svn: 177438
2013-03-19 21:11:25 +00:00
Tobias Grosser d4ff632fa9 ScopDetection: Add a couple of test cases
llvm-svn: 177433
2013-03-19 20:15:19 +00:00
Sebastian Pop 97cb813c29 Correct function to decide if a SCEV can be ignored
When doing SCEV based code generation, we ignore instructions calculating values
that are fully defined by a SCEV expression. The values that are calculated by
this instructions are recalculated on demand.

This commit improves the check to verify if certain instructions can be ignored
and recalculated on demand.

llvm-svn: 177313
2013-03-18 20:21:13 +00:00
Tobias Grosser 0db0878ead ScopHelper: clang-format
llvm-svn: 177309
2013-03-18 19:19:57 +00:00
Tobias Grosser 0d1cf2b875 ScopHelper: Remove some dead code
llvm-svn: 177307
2013-03-18 19:17:07 +00:00
Sebastian Pop e039bb1fdb use the canonical IV only when it exists
llvm-svn: 177306
2013-03-18 19:09:49 +00:00
Tobias Grosser 7f54714dcc tests: Properly check if asserts are available
In my previous commits I failed to realise that my new requires lines fully
disabled these tests. We now properly check if we are in an asserts build and
only disable the tests if assertions are not available.

Reported-by: Sean Silva <silvas@purdue.edu>
llvm-svn: 176900
2013-03-12 21:27:39 +00:00
Tobias Grosser ee9423920e Missed on test case in the last commit
llvm-svn: 176864
2013-03-12 13:39:40 +00:00
Tobias Grosser c9a72919a5 Move tests that depend on -stats under 'requires asserts'
This fixes issues caused by the following commit:

  r176733 | jvoung | 2013-03-08 17:56:31 -0500
  Disable statistics on Release builds and move tests that depend on -stats.

Reported by: Jack Howarth <howarth@bromo.med.uc.edu>

llvm-svn: 176856
2013-03-12 08:45:15 +00:00
Tobias Grosser b2863ca2dc Print function names under --polly-report
llvm-svn: 176446
2013-03-04 19:49:51 +00:00
Bill Wendling 83e9312ece Use attributes references on call/invoke instructions.
llvm-svn: 175881
2013-02-22 09:29:15 +00:00
Tobias Grosser de49b8fa3b Support: clang-format
llvm-svn: 175874
2013-02-22 08:21:52 +00:00
Tobias Grosser 7242ad9226 CodeGen: clang-format
llvm-svn: 175872
2013-02-22 08:07:06 +00:00
Sebastian Pop 47d4ee3ed4 capitalize SCEV to match the current naming convention
llvm-svn: 175306
2013-02-15 21:26:53 +00:00
Sebastian Pop d768601be1 check that clang-format exists
llvm-svn: 175305
2013-02-15 21:26:50 +00:00
Sebastian Pop f30d3b2d89 don't store a pointer to the loop in IVS
llvm-svn: 175304
2013-02-15 21:26:48 +00:00
Sebastian Pop 860e021fe6 add NestLoops to remove some uses of IVS
llvm-svn: 175303
2013-02-15 21:26:44 +00:00
Sebastian Pop 637b23dc63 use apply and ScevParameterRewriter::rewrite instead of SCEVRewriter
llvm-svn: 175296
2013-02-15 20:56:01 +00:00
Sebastian Pop 9d10fffa33 add LoopToScev maps
llvm-svn: 175295
2013-02-15 20:55:59 +00:00
Tobias Grosser 482706f31f Do not run formatting checks by default
llvm-svn: 175178
2013-02-14 16:42:50 +00:00
Tobias Grosser d535f55146 Formatting fixes
llvm-svn: 175177
2013-02-14 16:42:45 +00:00
Tobias Grosser 02d9a6a100 clang-format: Really check all files
llvm-svn: 175174
2013-02-14 16:25:44 +00:00
Tobias Grosser f471c3e63a Report formatting problems as with 'diff -u'
llvm-svn: 175171
2013-02-14 16:20:55 +00:00
Tobias Grosser c38af88764 cmake: add command polly-check-format
This command runs clang-format on all files and reports formatting problems

llvm-svn: 175170
2013-02-14 16:19:16 +00:00
Tobias Grosser e2417fc2a4 clang-format a file
llvm-svn: 175012
2013-02-12 22:05:48 +00:00
Tobias Grosser d1d40a9e0a Use documented isl function
llvm-svn: 175011
2013-02-12 22:05:43 +00:00
Tobias Grosser c92c8f06ec [isl-codegen]: Fix off by one in getNumberOfIterations
We need to remove one dimension. Any is correct as long as it exists. We have
choosen for whatever reason the dimension #dims - 2. This is incorrect if
there is just one dimension. For CLooG this case did never happen. For isl
however, the case can happen and causes undefined behavior including crashes.
We choose now always the last dimension #dims - 1. We could have choosen
dimension '0' but the last dimension is what we remove conceptionally in the
algorithm, so it seems better to actually program it that way.

While at it remove another piece of undefined behavior.

llvm-svn: 174894
2013-02-11 17:52:36 +00:00
Tobias Grosser 7b3ac71920 [cmake] Make CLooG optional
CLooG is already optional in the autoconf build.

llvm-svn: 174872
2013-02-11 10:36:19 +00:00
Tobias Grosser c14582f276 CodeGen: clang-format goodness
The changed files are not yet clang-format clean, but we are getting close.

llvm-svn: 174403
2013-02-05 18:01:29 +00:00
Tobias Grosser 1f11b44939 TempScopInfo: clang-format
llvm-svn: 174368
2013-02-05 12:27:23 +00:00
Tobias Grosser 14f4c3e9fa Dependences: clang-format
Everything except INITIALIZE_PASS_* macros

llvm-svn: 174367
2013-02-05 12:27:22 +00:00
Tobias Grosser abfbe637bc ScopInfo: clang-format file
clang-format was able to format the entire file except the final
INITIALIZE_PASS_* macros.

llvm-svn: 174366
2013-02-05 12:09:06 +00:00
Tobias Grosser 0d1eee3298 ScopDetect: clang-format pointer types in templates
llvm-svn: 174365
2013-02-05 11:56:05 +00:00
Tobias Grosser af3c00b87b ScopDetection: clang-format some more code
llvm-svn: 174362
2013-02-05 09:40:22 +00:00
Tobias Grosser 428b3e48e2 ScopDetection: Improve printing of alias sets
We now show the all members of the alias set that may couse possible aliasing.
In case a alias set member is not a named instruction (unnamed instructions or
constant expressions), we show the expression itself.

This improves our error message

from:

  Possible aliasing for value: .reg2mem

to:

  Possible aliasing: ".reg2mem",
                     "[0 x double]* inttoptr (i64 47255179264 to [0 x double]*)

llvm-svn: 174329
2013-02-04 15:46:25 +00:00
Tobias Grosser 71036882d2 cmake: Install all polly include files
Contributed-by: Richard Membarth <richard.membarth@informatik.uni-erlangen.de>
llvm-svn: 172903
2013-01-19 14:17:52 +00:00
Tobias Grosser f75ba19697 www: Add kernelgen publications
Contributed by: Dmitry Mikushin <dmitry@kernelgen.org>

llvm-svn: 172772
2013-01-18 00:26:39 +00:00
Tobias Grosser 18b1abb137 Add missing __isl_give
Contributed by: Sameer Abu Asal <sameer.abuasal@gmail.com>

llvm-svn: 172771
2013-01-18 00:09:42 +00:00
Tobias Grosser 74394f0dcf clang-format goodness
llvm-svn: 172486
2013-01-14 22:40:23 +00:00
Tobias Grosser b1304ba9b2 Dead code elimination: Make variable names uppercase
llvm-svn: 171844
2013-01-08 08:53:58 +00:00
Tobias Grosser 184e2fcd9c clang-format the dead code elimination pass
llvm-svn: 171843
2013-01-08 08:27:46 +00:00
Chandler Carruth 535d52c7ca Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

llvm-svn: 171370
2013-01-02 11:47:44 +00:00
NAKAMURA Takumi 43632a26a5 Update the copyright coredits -- Happy new year 2013!
llvm-svn: 171342
2013-01-01 10:00:19 +00:00
Tobias Grosser ae2d83ec41 Formatting: Break lines after binary operators such as '&&'
assert(Condition
       && "Text");

->

assert(Condition &&
       "Text);

This aligns Polly with the style used in LLVM.

llvm-svn: 171242
2012-12-29 23:57:18 +00:00
Tobias Grosser 1bb59b0dcf Fix obvious formatting problems.
We fix the following formatting problems found by clang-format:

  - 80 cols violations
  - Obvious problems with missing or too many spaces
  - multiple new lines in a row

clang-format suggests many more changes, most of them falling in the following
two categories:

  1) clang-format does not at all format a piece of code nicely

  2) The style that clang-format suggests does not match the style used in
     Polly/LLVM

I consider differences caused by reason 1) bugs, which should be fixed by
improving clang-format. Differences due to 2) need to be investigated closer
to understand the cause of the difference and the solution that should be taken.

llvm-svn: 171241
2012-12-29 23:47:38 +00:00
Tobias Grosser 16242dab74 www: Add news to Polly website
llvm-svn: 171231
2012-12-29 17:40:09 +00:00
Tobias Grosser 317b5ef24d www: Add new Polly publication
Polly - Performing polyhedral optimizations on a low-level intermediate
representation

Tobias Grosser, Armin Groesslinger, Christian Lengauer Parallel
Processing Letters 2012 22:04

llvm-svn: 171228
2012-12-29 16:47:41 +00:00
Tobias Grosser 7a2f39534f 'chmod -x' on files that do not need the executable bits
llvm-svn: 171224
2012-12-29 15:09:03 +00:00
Sebastian Pop ab9ea13f64 avoid initializing twice
llvm-svn: 170854
2012-12-21 07:27:17 +00:00
Sebastian Pop eb283143e2 do not access Info when it is NULL
llvm-svn: 170853
2012-12-21 07:27:13 +00:00
Sebastian Pop 2aa5c24a3a return -1 when polly::getNumberOfIterations returns -1
llvm-svn: 170422
2012-12-18 08:56:51 +00:00
Sebastian Pop 04c4ce32ae isl: vector code generation based on ISL ast
Original patch by Tobias Grosser, slightly modified by Sebastian Pop.

llvm-svn: 170420
2012-12-18 07:46:13 +00:00
Sebastian Pop a00a029115 change interface for isStride
isStride now takes a partial schedule as input.

Patch from Tobias Grosser <tobias@grosser.es>.

llvm-svn: 170419
2012-12-18 07:46:06 +00:00
Sebastian Pop e252c85545 isl: detect vector parallelism
llvm-svn: 170138
2012-12-13 16:52:41 +00:00
Tobias Grosser e36abf6d5d isl: Detect openmp parallelism
Based on code written by Riyadh Baghdadi.

llvm-svn: 170102
2012-12-13 06:24:06 +00:00
Andy Gibbs 9936b214c0 Integrate polly test-suite into an llvm "make check-all" if built as part of the whole using cmake.
llvm-svn: 169487
2012-12-06 07:59:18 +00:00
Tobias Grosser 7e07b14d0b User isl sha commit id instead of the git tag
Apperently the git tag causes trouble in some scripts.

llvm-svn: 169313
2012-12-04 21:54:37 +00:00
Sebastian Pop a267d9b829 adapt cloog codegen testcases to isl
llvm-svn: 169161
2012-12-03 21:34:09 +00:00
Sebastian Pop 47987128b6 use -polly-ast instead of -polly-cloog
llvm-svn: 169160
2012-12-03 21:33:55 +00:00
Sebastian Pop b08a52898a execute cloog specific testcases only with CLOOG_FOUND
llvm-svn: 169159
2012-12-03 21:33:40 +00:00
Tobias Grosser e50df53625 Update CLooG
This cloog versions passes all tests with isl 0.11.

llvm-svn: 169150
2012-12-03 20:47:57 +00:00
Tobias Grosser c1e1b26f0a Use isl 0.11
We now switch to the newly released isl 0.11. This adds a couple of bug fixes
on top of the recent update.

llvm-svn: 169127
2012-12-03 14:44:14 +00:00
Tobias Grosser b2e572c6df Update the recommended isl version
Recent changes in isl:

- Allow analysis of loops during code generation

This simplifies the detection of parallel loops.

- Simplify the way costumized ast printers are defined

This enables us to highlight parallel / vector loops in our debug output.

- Compile time improvements for codegen contexts that include parameters

- Various bug fixes

This update also gets us in sync for the isl 0.11 release.

llvm-svn: 169100
2012-12-01 21:51:10 +00:00
Tobias Grosser 46c6abb306 Remove unneeded preservation and restore of ValueMap and ClastVars in GPGPU code
generation.

We don't use the exact same way to build loop body for GPGPU codegen as openmp
codegen and other transformations do currently, in which cases 'createLoop'
function is called recursively. GPGPU codegen may fail due to improper restore
of ValueMap and ClastVars .

Contributed by:  Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 168966
2012-11-30 01:05:05 +00:00
Tobias Grosser 6f3d0633a4 Add an additional input argument according to chanages of function polly::createLoop.
Contributed-by:  Yabin Hu <yabin.hwu@gmail.com>
llvm-svn: 168964
2012-11-30 00:39:49 +00:00
Tobias Grosser 5087d0adcb Update to Polly for LLVM r165262 which changes TargetData to Datalayout.
Contributed by: Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 168903
2012-11-29 17:34:50 +00:00
Patrik Hägglund b476cdfde5 Fix tests with broken datalayout strings.
Buildbot failure at r168785.

llvm-svn: 168791
2012-11-28 13:30:31 +00:00
Tobias Grosser 70325bb308 cmake: Fix installation of include files
Install the configured Config/config.h file, rather than the
Config/config.h.cmake and Config/Config.h.in source files.

Contributed-by: Richard Membarth <richard.membarth@informatik.uni-erlangen.de>
llvm-svn: 168780
2012-11-28 10:12:21 +00:00
Sebastian Pop ee4baf3eec do not execute the OpenMP tests when cloog is not found
llvm-svn: 168724
2012-11-27 21:15:15 +00:00
Sebastian Pop facd36e5c7 make IslAstInfo::printScop compatible with CloogInfo::printScop
llvm-svn: 168714
2012-11-27 18:50:41 +00:00
Sebastian Pop f2379e0848 do not require cloog from configure
llvm-svn: 168628
2012-11-26 23:03:41 +00:00
Sebastian Pop 7cf3104b7c fix typo
Caught while compiling polly without cloog:

../tools/polly/lib/RegisterPasses.cpp:77: error: use of enum 'CodegenChoice' without previous declaration

llvm-svn: 168624
2012-11-26 22:16:19 +00:00
Sebastian Pop 98b3544705 remove dependence on CLOOG_FOUND for PollyVectorizerChoice
When polly was configured with cmake without cloog, compilation stopped with:

../tools/polly/lib/CodeGen/BlockGenerators.cpp:662: error: 'PollyVectorizerChoice' was not declared in this scope
../tools/polly/lib/CodeGen/BlockGenerators.cpp:662: error: 'VECTORIZER_FIRST_NEED_GROUPED_UNROLL' was not declared in this scope

llvm-svn: 168623
2012-11-26 22:16:17 +00:00
Sebastian Pop 05c1f00cae remove dead code
llvm-svn: 168621
2012-11-26 22:07:30 +00:00
Sebastian Pop b35ae612ea remove unused flag
llvm-svn: 168620
2012-11-26 22:07:27 +00:00
Tobias Grosser c1b6cec0e7 Make polly -Wdocumentation clean
llvm-svn: 168311
2012-11-19 12:26:25 +00:00
Sebastian Pop bea5a36b01 utils: use rmdir instead of rm to remove empty dirs
as suggested by Sven Verdoolaege <skimo-polly@kotnet.org>

llvm-svn: 168279
2012-11-18 04:34:31 +00:00
Sebastian Pop 328bd58b55 utils: remove the isl directory after cloning cloog
This fixes my previous commit, thanks to "Dmitry N. Mikushin"
<maemarcus@gmail.com>

llvm-svn: 168252
2012-11-17 04:57:41 +00:00
Sebastian Pop 0dace3939d utils: remove existing cloog and isl dirs before git cloning
Patch adapted from "Dmitry N. Mikushin" <maemarcus@gmail.com>.

llvm-svn: 168250
2012-11-17 03:43:48 +00:00
Sebastian Pop 654b7754bc autoconf: isl depends on gmp include files
When libgmp header files are not installed in the default /usr/include location,
configure used to fail to find the gmp headers when testing for isl/ast.h.  This
patch adds the gmp include path to the compiler flags before testing for ISL.

llvm-svn: 168090
2012-11-15 21:20:22 +00:00
Tobias Grosser 3344f733fd test: LLVM supports now vectors of arbitrary pointers
This allows Polly to vectorize more code. Fix the relevant test cases.

llvm-svn: 167923
2012-11-14 08:25:52 +00:00
Tobias Grosser 38ea9cd721 Tests: Pipe test files into 'opt'
Use 'opt < %s' instead of just 'opt %s' to ensure that no temporary files are
created.

llvm-svn: 167372
2012-11-04 16:56:20 +00:00
Tobias Grosser dcebf1e9da Tests: remove ModuleID lines
llvm-svn: 167284
2012-11-02 06:09:20 +00:00
Tobias Grosser 41b20a62c9 Tests: move content of .c files in .ll
llvm-svn: 167283
2012-11-02 06:08:39 +00:00
Tobias Grosser 3eb851f370 Remove runtime tests from polly test suite
Similar to LLVM we now follow the policy of only having LLVM-IR level tests in
the Polly test suite. Testing for miscompilation of larger programs should be
done with the llvm test suite.

llvm-svn: 167255
2012-11-01 21:44:59 +00:00
Tobias Grosser 81a1c75035 Dependences: Add support to calculate memory based dependences
Instead of calculating exact value (flow) dependences, it is also possible to
calculate memory based dependences. Sometimes memory based dependences are a lot
easier to calculate. To evaluate the benefits, we add an option to calculate
memory based dependences (use -polly-value-dependences=false).

llvm-svn: 167251
2012-11-01 21:28:32 +00:00
Tobias Grosser 531891e980 ScopDetection: Print line numbers of detected scops
If the flags '-polly-report -g' are given, we print file name and line numbers
for the beginning and end of all detected scops.

  linear-algebra/kernels/gemm/gemm.c:23: Scop start
  linear-algebra/kernels/gemm/gemm.c:42: Scop end
  linear-algebra/kernels/gemm/gemm.c:77: Scop start
  linear-algebra/kernels/gemm/gemm.c:82: Scop end

llvm-svn: 167235
2012-11-01 16:45:20 +00:00
Tobias Grosser 5d01691d76 Revert multiple adress space changes in Polly
llvm-svn: 167234
2012-11-01 16:45:18 +00:00
Tobias Grosser ebe8c8cea2 Codegen: Selectively copy in array addresses for OpenMP code
The detection of values that need to be copied in to the generated OpenMP
subfunction also detects the array base addresses needed in the SCoP. Hence, it
is not necessary to unconditionally copy all the base addresses to the generated
function.

Test cases are modified to reflect this change. Arrays which are global
variables do not occur in the struct passed to the subfunction anymore. A test
case for base address copy-in is added in copy_in_array.{c,ll}.

Committed with slight modifications

Contributed by:  Armin Groesslinger <armin.groesslinger@uni-passau.de>

llvm-svn: 167215
2012-11-01 05:34:55 +00:00
Tobias Grosser 177982c478 CodeGen: Add scop-parameters to the OpenMP context
In addition to the arrays and clast variables a SCoP statement may also refer to
values defined before the SCoP or to function arguments. Detect these values and
add them to the set of values passed to the function generated for OpenMP
parallel execution of a clast.

Committed with additional test cases and some refactoring.

Contributed by:  Armin Groesslinger  <armin.groesslinger@uni-passau.de>

llvm-svn: 167214
2012-11-01 05:34:48 +00:00
Tobias Grosser a17f666f99 Codegen: Copy and restore the ValueMap and ClastVars explicitly
When generating OpenMP or GPGPU code the original ValueMap and ClastVars must be
kept. We already recovered the original ClastVars by reverting the changes, but
we did not keep the content of the ValueMap. This patch keeps now an explicit
copy of both maps and restores them after generating OpenMP or GPGPU code.

This is an adapted version of a patch contributed by:
Armin Groesslinger  <armin.groesslinger@uni-passau.de>

llvm-svn: 167213
2012-11-01 05:34:35 +00:00
Chandler Carruth f6562ed2d3 Another speculative commit to try to fix Polly's build. This is more delta than
I like to make w/o being able to build, but I don't have the dependencies to
build and test polly. I'll revert if the build bots don't like it.

llvm-svn: 166670
2012-10-25 08:43:18 +00:00
Chandler Carruth acdc5e812d Another fix for a build-bot reported API mismatch.
llvm-svn: 166668
2012-10-25 07:42:03 +00:00
Chandler Carruth 2435330ead Try to revive the Polly builders after this LLVM API change.
llvm-svn: 166666
2012-10-25 07:25:56 +00:00
Tobias Grosser 0c55514a43 autoconf/cmake: Always require isl code generation.
This change ensures that isl is only detected if it includes code generation
support. This allows us to remove a lot of conditional compilation and also
avoids missing test cases in case the feature is not available.

llvm-svn: 166403
2012-10-21 21:48:21 +00:00
Tobias Grosser 6c8e696618 cmake: Use suffix for shared modules instead of the one for shared libraries
On Linux there is no difference between shared modules and shared libaries, both
are '.so' files. However, on darwin only shared modules are '.so' files. Shared
libraries have the '.dynlib' suffix.

Fix test cases on darwin by expecting a shared module suffix for Polly instead
of a shared library suffix.

This fixes PR14135

Reported by:  Jack Howarth  <howarth@bromo.med.uc.edu>

llvm-svn: 166402
2012-10-21 21:08:29 +00:00
Tobias Grosser 56ac181189 RegisterPasses: Remove unreachable default case in switch
llvm-svn: 166397
2012-10-21 18:31:27 +00:00
Tobias Grosser ce32148bf4 www: Correct command line that loads polly into dragonegg
Reported by:  Jack Howarth  <howarth@bromo.med.uc.edu>

llvm-svn: 166396
2012-10-21 17:33:00 +00:00
Tobias Grosser bc822eb25f Introduce a separate file for CMake macros
Contributed by:  Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>

llvm-svn: 166394
2012-10-21 15:51:49 +00:00
Tobias Grosser 28781423b2 isl scheduler: Do not fail when returning an empty band list
The bug was within isl. To fix it, we simply update the isl version that
is used by Polly. We still have some changes within Polly to be able to
write a proper test case.

Reported-by: Sameer Sahasrabuddhe <Sameer.Sahasrabuddhe@amd.com>
llvm-svn: 166021
2012-10-16 07:29:19 +00:00
Tobias Grosser c967d8e6e9 isl-codegen: Support '<' and '>'
Previously isl always generated '<=' or '>='. However, in many cases '<' or '>'
leads to simpler code. This commit updates isl and adds the relevant code
generation support to Polly.

llvm-svn: 166020
2012-10-16 07:29:13 +00:00
Tobias Grosser ff639688e3 www: Clarify that GMP is LGPL licensed
llvm-svn: 165789
2012-10-12 07:44:38 +00:00
Sameer Sahasrabuddhe 1646a6ec44 Trivial change to the README, mainly to test commit access.
llvm-svn: 165481
2012-10-09 04:59:42 +00:00
Micah Villmow 7a3d8209c3 Move TargetData to DataLayout to fix build breakage caused by LLVM r16540
llvm-svn: 165408
2012-10-08 17:26:19 +00:00
Tobias Grosser 660b58ddab Rename TargetData -> DataLayout
Contributed by: Sameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>

llvm-svn: 165387
2012-10-08 08:56:52 +00:00
Tobias Grosser 6a2617b874 ScopLib: Support negated access functions.
Scoplib only supports access functions, but not the more generic
access relations. This commit now also supports access functions
that where not directly expresses as A[sub] with sub = i + 5b,
but with A[sub] with -sub = -i + (-5b).

Test case to come.

Contributed by: Dustin Feld <d3.feld@gmail.com>

llvm-svn: 165379
2012-10-07 17:43:23 +00:00
Tobias Grosser f6e6980280 Update the 'News' section on the Polly page
llvm-svn: 165378
2012-10-07 17:43:18 +00:00
Tobias Grosser 8a5bc6edca Add a new isl based code generation
This pass implements a new code generator that uses the code generation
algorithm included in isl.

For the moment the new code generation is limited to sequential code.

llvm-svn: 165037
2012-10-02 19:50:43 +00:00
Tobias Grosser 0934e70e6e Add an ast pretty printer pass based on the isl code generator
llvm-svn: 165036
2012-10-02 19:50:38 +00:00
Tobias Grosser 50fce4f8de Update isl to get the new code generation
llvm-svn: 165035
2012-10-02 19:50:30 +00:00
Tobias Grosser c845fef391 Detect the isl code generation feature correctly
llvm-svn: 165034
2012-10-02 19:50:22 +00:00
Tobias Grosser 29ebecb11a Bailout if libpluto finds no schedule
Older versions of libpluto crashed, if no schedule was found. Recent
versions return NULL. We detect this and keep the original schedule.

llvm-svn: 164376
2012-09-21 16:24:13 +00:00
Tobias Grosser 6a2da6b9c8 Add test cases for multi-dimensional variable lengths arrays
At the moment we can handle such arrays only by conservatively assuming that
each access to such an array may touch any element in the array. It would be
great if we could improve Polly/LLVM at some point, such that we can
recover the multi-dimensionality of the accesses.

llvm-svn: 163619
2012-09-11 14:03:19 +00:00
Tobias Grosser ed29566c4e ScopInfo: Align parameters when using -polly-allow-nonaffine
This ensures that the isl sets/maps we operate on have the same parameter
dimensions. Operations on objects with different parameter dimensions are not
allow and trigger assertions.

llvm-svn: 163618
2012-09-11 13:50:21 +00:00
Tobias Grosser eeb776a41f SCEVValidator: Add debug output that gives the reason for invalid expressions
llvm-svn: 163472
2012-09-08 14:00:37 +00:00
Tobias Grosser 6eaafb7288 Remove dead code
This code has been replaced by the SCEVValidator a while ago.

llvm-svn: 163471
2012-09-08 14:00:32 +00:00
Tobias Grosser 0b5a1959f4 ScopGraphPrinter: Escape error message
Otherwise a '"' in the error message, yields an invalid .dot file.

llvm-svn: 163466
2012-09-08 08:31:55 +00:00
Tobias Grosser ad41c4ce20 Add dependency to intrinsics_gen
The IndVarSimplify pass in Polly uses the intrinsics header. We need to ensure
that the header is generated, before we use it. This patch fixes the problem
for the cmake build (it did not show up in the autoconf one).

Contributed by:   Sameer Sahasrabuddhe  <sameer.sahasrabuddhe@amd.com>

llvm-svn: 163130
2012-09-04 08:19:12 +00:00
Tobias Grosser 657dad67d6 Update isl to a newer version
This fixes some undefined behavior in isl.

Reported by:  Sameer Sahasrabuddhe  <sameer.sahasrabuddhe@amd.com>

llvm-svn: 163108
2012-09-03 07:42:40 +00:00
Tobias Grosser cd95b77330 Pocc: Fix some bugs in the PoCC optimizer pass
This includes:
  - The isl_id of the domain of the scattering must be copied from the original
    domain
  - Remove outdated references to a 'FinalRead' statement
  - Print of the Pocc output, if -debug is provided.
  - Add line breaks to some error messages.

Reported and Debugged by:  Dustin Feld  <d3.feld@gmail.com>

llvm-svn: 162901
2012-08-30 11:49:38 +00:00
Tobias Grosser 4a7527e0eb Pluto: Print pluto input in debugging mode
llvm-svn: 162900
2012-08-30 11:49:31 +00:00
Tobias Grosser 882a283946 Dependences: Print dependences in -analyze output
The dependency printing was accidentally removed in during a previous
restructuring.

llvm-svn: 162662
2012-08-27 08:44:15 +00:00
Tobias Grosser 6f9465591e PoCC: Simplify condition
llvm-svn: 162555
2012-08-24 13:56:56 +00:00
Tobias Grosser 4a67e01216 Sort includes
llvm-svn: 162554
2012-08-24 13:54:40 +00:00
Tobias Grosser c8fc2d7045 PoCC: Adapt to earlier vectorizer changes
llvm-svn: 162553
2012-08-24 13:54:36 +00:00
Tobias Grosser 1df5289782 autoconf: Only define GPGPU_CODEGEN, if that feature is requested
Before we defined GPGPU_CODEGEN to '0', which does not disable the relevant code
as we just check if that value is defined at all. We now follow the cmake
approach and only define GPGPU_CODEGEN, if the feature should be enabled.

Reported by: Sebastian Pop <spop@codeaurora.org>

llvm-svn: 162275
2012-08-21 12:29:10 +00:00
Tobias Grosser 7a19b31a23 Remove executable bits from html files
llvm-svn: 161930
2012-08-15 05:50:24 +00:00
Tobias Grosser 1049611070 www documentation for using Polly with dragonegg.
Added a file that explains how to load Polly in dragonegg.
Also fixed a typo in the document for clang.

Committed with a typo fix and a change to make this website available from
the documentation section.

Contributed by: Sameer Sahasrabuddhe  <Sameer.Sahasrabuddhe@amd.com>

llvm-svn: 161928
2012-08-15 05:02:25 +00:00