Commit Graph

336 Commits

Author SHA1 Message Date
Tobias Grosser a4ea90b88c Typo: Maxize -> Mazimize
Found by Sebastian Pop.

llvm-svn: 149287
2012-01-30 22:43:56 +00:00
Tobias Grosser 50ff31dabe Scheduling: Set fusion strategy to minimal
This has shown better results for 2mm, 3mm and a couple of other benchmarks.

After this we show consistenly better results as PoCC with maxfuse. We need
to see if PoCC can also give better results with another fusion strategy.

llvm-svn: 149267
2012-01-30 19:38:58 +00:00
Tobias Grosser 95e860c19c Scheduling: Add option to disable schedule_maximise_band_depth
maximise_band_depth does not seem to have any effect for now, but it may help to
increase the amount of tileable loops. We expose the flag to be able to analyze
its effects when looking into individual benchmarks.

llvm-svn: 149266
2012-01-30 19:38:54 +00:00
Tobias Grosser b3ad85b03c Scheduler: Allow to select the fusion strategy
llvm-svn: 149265
2012-01-30 19:38:50 +00:00
Tobias Grosser 42152ff3c7 Scheduling: Use original schedule if we cannot find a new one
After this we can now compile all polybench 2.0 kernels without any compiler
crash.

llvm-svn: 149264
2012-01-30 19:38:47 +00:00
Tobias Grosser a26db47083 Scheduler: Simplify dependences by default (only isl)
This speeds up the scheduler by orders of magnitude and in addition yields often
to a better schedule.

With this we can compile all polybench kernels with less than 5x compile time
overhead. In general the overhead is even less than 2-3x.  This is still with
running a lot of redundant passes and no compile time tuning at all. There are
several obvious areas where we can improve here further.

There are also two test cases where we cannot find a schedule any more (cholesky
and another). I will look into them later on.

With this we have a very solid base line from which we can start to optimize
further.

llvm-svn: 149263
2012-01-30 19:38:43 +00:00
Tobias Grosser 061e20d2f8 Use isl version: 3c66541593a6bf3b5a3d35d31567abe6c9e5a04b
This allows us to set the fusion strategy and to gist-simplify union_maps.

llvm-svn: 149262
2012-01-30 19:38:40 +00:00
Tobias Grosser bc3bc42491 Dependences: Coalesce the dependences before returning them.
llvm-svn: 149261
2012-01-30 19:38:36 +00:00
Tobias Grosser a132155bd8 RegisterPass: Expose functions to register Polly passes
llvm-svn: 149240
2012-01-30 09:07:50 +00:00
Tobias Grosser a1f093465b Disable some clang warnings in imported JSON code.
llvm-svn: 149239
2012-01-30 09:07:45 +00:00
Tobias Grosser fc98d453df Remove unneeded default case
This silences a clang warning.

llvm-svn: 149073
2012-01-26 19:53:01 +00:00
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
Tobias Grosser 5a4c2e55dc www: Move automatic polly installation to a more prominent place
llvm-svn: 148307
2012-01-17 14:44:35 +00:00
Tobias Grosser af9977dc10 www: Fix clang path in polly.sh script
llvm-svn: 148306
2012-01-17 14:37:45 +00:00
Tobias Grosser 396fa1e505 Fix clang svn address
llvm-svn: 148248
2012-01-16 18:50:43 +00:00
Tobias Grosser 254328509f Describe how to optionally build the matching clang version.
llvm-svn: 148238
2012-01-16 15:19:19 +00:00
Raghesh Aloor ea6c99c1d9 Memaccess: Removing some unwanted code
llvm-svn: 148100
2012-01-13 06:02:13 +00:00
Sebastian Pop 3f2f65f1f8 add polly.sh script
llvm-svn: 147543
2012-01-04 20:11:18 +00:00
Tobias Grosser 0e2c1bff8f www: Papers about iterative compilation and non static control
llvm-svn: 147444
2012-01-03 10:10:05 +00:00
Tobias Grosser aec0a97a41 Add Udays PhD thesis
llvm-svn: 147443
2012-01-03 10:00:55 +00:00
Tobias Grosser c1610132ef Update publications
- Add the LLVM Developer Meeting 2012 talk
- Add papers used within Polly and papers interesting to read in general

llvm-svn: 147442
2012-01-03 09:50:29 +00:00
NAKAMURA Takumi e9d3d21988 Happy new year 2012!
llvm-svn: 147395
2012-01-01 08:16:56 +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 5c28af1c23 www: Enable mp4 version of the developer meeting talk
llvm-svn: 146559
2011-12-14 12:21:27 +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
Tobias Grosser cae6b39cff Update isl
This updates bringes new options for the isl scheduler.

llvm-svn: 146555
2011-12-14 08:58:36 +00:00
Tobias Grosser 0d90112195 www: Add forgotten files
llvm-svn: 146487
2011-12-13 15:09:09 +00:00
Tobias Grosser 54da06ca28 www: Add LLVM Developer Meeting Video (webm only)
llvm-svn: 146486
2011-12-13 15:07:00 +00:00
Tobias Grosser 40c163a051 www: Improve styling of news section
llvm-svn: 146485
2011-12-13 14:53:25 +00:00
Tobias Grosser fa05128785 www: Rephrase the introduction to Polly
llvm-svn: 146484
2011-12-13 14:53:20 +00:00
Tobias Grosser 9bf3b30c98 Upgrade to CLooG 0.17.0
llvm-svn: 146373
2011-12-12 14:52:31 +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 3f8073aaef Update isl.
llvm-svn: 145933
2011-12-06 10:48:32 +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 39913e3648 test: Switch to new atomic instructions
This fixes the test with recent versions of LLVM that do not support
the old atomic instructions any more.

llvm-svn: 145402
2011-11-29 14:51:05 +00:00
Tobias Grosser a66b37d7ae Add utils/jscop2cloog.py
This tool takes a jscop file and translates it into a cloog input file.

llvm-svn: 145401
2011-11-29 14:50:52 +00:00
Tobias Grosser 1e06003227 test: Add more dependences to cmake build
llvm-svn: 145400
2011-11-29 14:50:47 +00:00
Tobias Grosser f281702686 test: Do not hardcode '.so' as library suffix
Contributed by: Marcello Maggioni <hayarms@gmail.com>

llvm-svn: 145076
2011-11-22 19:40:38 +00:00
Tobias Grosser fe8572bc11 www: Document how to run 'make polly-test' for autoconf build
llvm-svn: 145075
2011-11-22 19:40:34 +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 57398edf18 www: Remove link to LLVM for upper left corner. This confused a lot of people
llvm-svn: 144289
2011-11-10 14:01:53 +00:00
Tobias Grosser 7bf34585cb www: Add some news about Polly
llvm-svn: 144288
2011-11-10 14:00:04 +00:00
Tobias Grosser 5d73f4a39f www: Highlight command line flags
llvm-svn: 144287
2011-11-10 14:00:00 +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
Tobias Grosser 4eb7381607 ScopDetect: Clean the last failure message properly
llvm-svn: 144283
2011-11-10 12:45:15 +00:00
Tobias Grosser a66fa6cf02 ScopDetection: Improve formatting of error message and simplify some code
llvm-svn: 144282
2011-11-10 12:45:11 +00:00
Tobias Grosser bef690f57f Add a workaround to fix SCoPs rejected because of 'region not simple'
llvm-svn: 144281
2011-11-10 12:45:07 +00:00
Tobias Grosser e5e171eadd Reuse the old BaseAddress checking in SCEVValidator to make sure that no base
address is part of the access function. Also remove unused special cases that
were necessery when the base address was still contained in the access function

llvm-svn: 144280
2011-11-10 12:45:03 +00:00
Tobias Grosser 9759f85060 Use getBasePtr in TempScop/ScopInfo
llvm-svn: 144279
2011-11-10 12:44:55 +00:00
Tobias Grosser b8710b5952 ScopDetect: Use getPointerBase to get the base pointer
Previously we allowed in access functions only a single SCEVUnknown, which later
became the base address. We now use getPointerBase() to derive the base address
and all remaining unknowns are handled as parameters. This allows us to handle
cases like A[b+c];

llvm-svn: 144278
2011-11-10 12:44:50 +00:00
Tobias Grosser 19632d7814 Remove unused function declaration
llvm-svn: 144233
2011-11-09 22:35:19 +00:00
Tobias Grosser f50fc50c80 Remove unused parameters from TempScop
llvm-svn: 144232
2011-11-09 22:35:15 +00:00
Tobias Grosser e4e2f7b16e TempScop: Rename SCEVAffFunc to IRAccess
The SCEVAffFunc is now only used to express memory accesses. Give it a proper
name and rework the class such that this is obvious.

llvm-svn: 144231
2011-11-09 22:35:09 +00:00
Tobias Grosser 499f0a48d8 Further remove now invalid SCEVAffFunc features.
This also removes the construction of MayAliasSets that became invalid when
removing the use of SCEVAffFunc.

llvm-svn: 144230
2011-11-09 22:35:05 +00:00
Tobias Grosser 6e9f25a5d5 Remove AffineSCEVIterator
We do not use it anymore. It was replaced by SCEVVisitors like the
SCEVValidator.

llvm-svn: 144229
2011-11-09 22:35:00 +00:00
Tobias Grosser f317e3ac83 Do not check memory accesses additionally with isValidAffineFunction
This check was necessary because of the use AffineSCEVIterator in TempScopInfo.
As we removed this use recently it is not necessary any more.

llvm-svn: 144228
2011-11-09 22:34:53 +00:00
Tobias Grosser 866b8ae928 Remove more unused stuff from SCEVAffFunc
llvm-svn: 144227
2011-11-09 22:34:48 +00:00
Tobias Grosser a601fbd682 Remove SCEVAffFunc from polly::Comparison
llvm-svn: 144226
2011-11-09 22:34:44 +00:00