Commit Graph

186 Commits

Author SHA1 Message Date
Tobias Grosser 9bc5eb08c2 CodeGen: Separate declaration and definition of ClastStmtCodeGen
llvm-svn: 148814
2012-01-24 16:42:32 +00:00
Tobias Grosser bb137e3f03 CodeGen: Separate declaration and definition of ClastExpCodeGen
llvm-svn: 148813
2012-01-24 16:42:28 +00:00
Tobias Grosser e5b4232572 CodeGen: Use getNullValue to simplify some code
llvm-svn: 148812
2012-01-24 16:42:25 +00:00
Tobias Grosser 70e8cdbbd1 CodeGen: Separate declaration and definitions of BlockGenerator
llvm-svn: 148811
2012-01-24 16:42:21 +00:00
Tobias Grosser 28dd48613e ScopInfo: Add isStrideX to unify stride checking
llvm-svn: 148810
2012-01-24 16:42:16 +00:00
Tobias Grosser 5013c699e4 Dependences: Simplify code
llvm-svn: 148620
2012-01-21 02:38:27 +00:00
Tobias Grosser 030b0d77ed ScopInfo: Further style improvements
llvm-svn: 148328
2012-01-17 20:39:11 +00:00
Tobias Grosser dea982300e ScopInfo: Simplify some code II
llvm-svn: 148327
2012-01-17 20:34:27 +00:00
Tobias Grosser 78d8a3d505 ScopInfo: Simplify some code
llvm-svn: 148326
2012-01-17 20:34:23 +00:00
Raghesh Aloor ea6c99c1d9 Memaccess: Removing some unwanted code
llvm-svn: 148100
2012-01-13 06:02:13 +00:00
Raghesh Aloor a71989c94e Memaccess: Using isl_map_dim_max
Use isl_map_dim_max to extract the details of the changed
access relation. Only constant access functions are supported
now.

llvm-svn: 147305
2011-12-28 02:48:26 +00:00
Tobias Grosser a187964bac Support non-affine access functions in Polly.
In case we can not analyze an access function, we do not discard the SCoP, but
assume conservatively that all memory accesses that can be derived from our base
pointer may be accessed.

Patch provided by: Marcello Maggioni <hayarms@gmail.com>

llvm-svn: 146972
2011-12-20 10:43:14 +00:00
Tobias Grosser f5c8ae5f4b Adapt to move of isSafeToSpeculativelyExecute into another header.
llvm-svn: 146727
2011-12-16 08:27:42 +00:00
Tobias Grosser e1bc007afa Allow to run the Polly preopt passes with -O0
To extract a preoptimized LLVM-IR file from a C-file run:

clang -Xclang -load -Xclang LLVMPolly.so -O0 -mllvm -polly file.c -S -emit-llvm

On the generated file you can directly run passes such as:
'opt -view-scops file.s'

llvm-svn: 146560
2011-12-14 12:21:31 +00:00
Tobias Grosser f4bea399a9 Scheduler: Try to maximize the band depth
Previously the scheduler was splitting bands at the level at which it detected
that the splitting of the band is necessary. This may introduce an additional
level of bands, that can be avoided by backtracking and splitting on a higher
level. Additional splits reduce the number of loops that can be tiled, such that
avoiding splits and maximizing the band depth seems preferable.

As a first data point we looked at 2mm and 3mm from the polybench test suite.
For both maximizing the tilable bands results in a significant (5-10x)
performance improvement.

This patch enables the isl scheduler option to maximize the band depth.

llvm-svn: 146557
2011-12-14 08:58:43 +00:00
Tobias Grosser 768140c6e1 Scheduler: Set maximal constant term
If larger coefficients appear as part of the input dependences, the schedule
calculation can take a very long time. We observed that the main overhead in
this calculation is due to optimizing the constant coefficients. They are
misused to increase locality by merging several unrelated dimensions into a
single dimension. This unwanted optimization increases the complexity of the
generated code and furthermore slows it down.

We use a new isl scheduler option to bound the values in the constant dimension
by a user defined value (20 in our case). If the right value is choosen, costly
overoptimization is prevented.

This solution works, but requires a specific (here almost randomly choosen)
value by which the constants are bound. For the moment, this is our best
solution, but we hope to to find a more generic one later on.

After these patch the extremly long compile time for simple kernels like 2mm or
3mm is reduced to a reasonable amount of time (Not more than a couple of seconds
even in debug mode).

llvm-svn: 146556
2011-12-14 08:58:39 +00:00
Benjamin Kramer 66af99eb34 Update after LLVM API change.
llvm-svn: 146279
2011-12-09 21:34:43 +00:00
Raghesh Aloor 46eceba361 Memacess: Some style changes
llvm-svn: 146255
2011-12-09 14:27:17 +00:00
Tobias Grosser b6033396fd ScheduleOptimizer: Do not tile bands with just one dimension
llvm-svn: 146149
2011-12-08 13:02:58 +00:00
Tobias Grosser 595ec0d0e3 ClooG: Make sure ambigous schedules do not introduce complicated code
Cloog continued to split the domains even after the scattering. This lead to
complicated code.

llvm-svn: 146033
2011-12-07 11:03:48 +00:00
Tobias Grosser 2493e92530 ScheduleOptimizer: Rewrite getPrevectorMap to use isl_pw_aff
This increases the readablity. This also adds some comments that explain
what this function does.

llvm-svn: 146028
2011-12-07 07:42:57 +00:00
Tobias Grosser 4a8e356f36 Make isl abort when an error is encountered
llvm-svn: 146027
2011-12-07 07:42:51 +00:00
Tobias Grosser 545bc31324 CodeGen: Style improvements.
llvm-svn: 145932
2011-12-06 10:48:27 +00:00
Tobias Grosser cdea7df0fe Cloog: Include header file for pipe/open/close
We forgot to include the unistd.h header file that defines the
functions mentioned above. This was not a problem with gnu C++ library,
however it did not work for libc++.

llvm-svn: 145790
2011-12-04 10:44:14 +00:00
Tobias Grosser 9fe98cc3eb autoconf: Change order of linking files
This fixes (or hides) the problem of symbols not being available in the
autoconf build.

llvm-svn: 145074
2011-11-22 19:40:31 +00:00
Tobias Grosser 34525d37b1 OpenScop: Remove use of getNameStr()
llvm-svn: 145073
2011-11-22 19:40:28 +00:00
Tobias Grosser 23156484f3 cmake: Create libPollyExchange as in the autoconf build
llvm-svn: 145072
2011-11-22 19:40:24 +00:00
Tobias Grosser 4dca439cfc Register Passes: Use -polly-optimizer=(isl|pocc) to switch optimizers
This replaces the old option -polly-use-pocc. Also call the passes uniformly
-polly-opt-pocc and -polly-opt-isl.

llvm-svn: 145071
2011-11-22 19:40:19 +00:00
Tobias Grosser 52277852a4 RegisterPass: Disable Polly by default
We disable Polly by default and add a new option '-polly' that enables Polly.
This allows us to create an the alias

$ alias clang clang -Xclang -load -Xclang LLVMPolly.so

which loads Polly always into clang. It can now be enabled by running:

$ clang -O3 -mllvm -polly file.c

To enable it by default an alias pollycc can be create

$ alias pollycc clang -O3 -mllvm -polly

llvm-svn: 144917
2011-11-17 19:10:48 +00:00
Tobias Grosser 29ee0b14d5 Do not use getNameStr() anymore.
Instead we switch to the recommended getName(). This fixes compilation with
recent versions of LLVM.

llvm-svn: 144909
2011-11-17 14:52:36 +00:00
Tobias Grosser 135c9c6534 autoconf: Specify that pollyanalysis depends on pollysupport
llvm-svn: 144908
2011-11-17 12:56:23 +00:00
Tobias Grosser edb8a2807a SCEVValidator: Fix coding standards in ValidatorResult
llvm-svn: 144907
2011-11-17 12:56:21 +00:00
Tobias Grosser fa043f00cd SCEVValidator: Make ValidatorResult a class and enforce the use of wproper accessors
llvm-svn: 144906
2011-11-17 12:56:19 +00:00
Tobias Grosser b1f07c5c0b SCEVValidator: Document SCEVType and ValidatorResult
Suggested by Sebastian Pop.

llvm-svn: 144905
2011-11-17 12:56:17 +00:00
Tobias Grosser bcc0a0d560 SCEVValidator: Restructure the logic of visitAddRecExpr
Suggested by Sebastian Pop.

llvm-svn: 144904
2011-11-17 12:56:14 +00:00
Tobias Grosser 2a7cd94215 SCEVValidator: Fix typo
llvm-svn: 144903
2011-11-17 12:56:12 +00:00
Tobias Grosser 7ffe4e8b0b Fix placement of the '*' that marks a pointer
Suggested by Sebastian Pop.

llvm-svn: 144902
2011-11-17 12:56:10 +00:00
Tobias Grosser 92a00f818a RegisterPasses: Avoid double negation
Fix suggested by Sebastian Pop.

llvm-svn: 144901
2011-11-17 12:56:06 +00:00
Tobias Grosser 6287201d6e ScheduleOptimizer: Start with an empty union_map and add elements
llvm-svn: 144900
2011-11-17 12:56:04 +00:00
Tobias Grosser 1ae9a60426 ScheduleOptimizer: Some style changes
- Use uppercase letters according to the LLVM coding style
- Rename functions to not include 'tiledSchedule', but just Schedule. This
  is more correct as tiling might be disabled.

llvm-svn: 144899
2011-11-17 12:56:03 +00:00
Tobias Grosser 79b30201d6 ScheduleOptimizer: Use early exit
Style fix, noted by Sebastian Pop.

llvm-svn: 144898
2011-11-17 12:56:00 +00:00
Tobias Grosser eb21b70d93 ScopLib: Fix export/import after parameters are now tagged with isl_ids.
llvm-svn: 144643
2011-11-15 11:39:02 +00:00
Tobias Grosser 626227462d JSONImporter: Fix parameter ids when importing new access functions
The new isl_id support for parmeters created problems when importing new
access functions. Even though the parameters had the same names,
they were mapped to different ids and where therefore incompatible.
We copy the ids now from the old parameter dimensions. This fixes the
problem.

llvm-svn: 144642
2011-11-15 11:38:59 +00:00
Tobias Grosser 8f99c167cd ScopInfo: Use names of simple parameters to name the isl parameter dimensions.
Parameters can be complex SCEV expressions, but they can also be single scalar
values. If a parameters is such a simple scalar value and the value is named,
use this name to name the isl parameter dimensions.

llvm-svn: 144641
2011-11-15 11:38:55 +00:00
Tobias Grosser 1fb76bd6f7 Cloog: Copy parameter names from isl data structures
llvm-svn: 144640
2011-11-15 11:38:47 +00:00
Tobias Grosser ff9b54d5a9 JScop: Allow to update the context
llvm-svn: 144639
2011-11-15 11:38:44 +00:00
Tobias Grosser ecf6cd06f0 Make JScop export/reimport accessible from clang
llvm-svn: 144638
2011-11-15 11:38:36 +00:00
Tobias Grosser fff5adca2e ScopDetection: Do not verify Aliasing
This does not work reliable and is probably not needed. I accidentally changed
this in this recent commit:

commit a0bcd63c6ffa81616cf8c6663a87588803f7d91c
Author: grosser <grosser@91177308-0d34-0410-b5e6-96231b3b80d8>
Date:   Thu Nov 10 12:47:21 2011 +0000

    ScopDetect: Use INVALID macro to fail in case of aliasing

    This simplifies the code and also makes the error message available to the
    graphviz scop viewer.

    git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@144284

llvm-svn: 144286
2011-11-10 13:21:43 +00:00
Tobias Grosser 60cd932536 ScopDetection: Add flag to ignore possible aliasing
llvm-svn: 144285
2011-11-10 12:47:26 +00:00
Tobias Grosser 6f24d9d9ee ScopDetect: Use INVALID macro to fail in case of aliasing
This simplifies the code and also makes the error message available to
the graphviz scop viewer.

llvm-svn: 144284
2011-11-10 12:47:21 +00:00