Commit Graph

61 Commits

Author SHA1 Message Date
Tobias Grosser 58032cb029 Integrate latest clang-format changes
llvm-svn: 184655
2013-06-23 01:29:29 +00:00
Tobias Grosser edab1359a0 Use isl_val instead of isl_int in the core of Polly
isl recently introduced isl_val as an abstract interface to represent arbitrary
precision numbers. This interface superseeds the old isl_int interface. In
contrast to the old interface which implemented arbitrary precision arithmetic
using macros that forward to the gmp library, the new library hides the math
library implementation in isl. This allows us to switch the math library used by
isl without affecting users such as Polly.

llvm-svn: 184529
2013-06-21 06:41:31 +00:00
Tobias Grosser 83628182f7 Sort includes
llvm-svn: 181297
2013-05-07 08:11:54 +00:00
Tobias Grosser 637bd63123 Move polly options into separate option category
Use the new cl::OptionCategory support to move the Polly options into a separate
option category. The aim is to hide most options and show by default only the
options a user needs to influence '-O3 -polly'. The available options probably
need some care, but here is the current status:

Polly Options:
Configure the polly loop optimizer

  -enable-polly-openmp              - Generate OpenMP parallel code
  -polly                            - Enable the polly optimizer (only at -O3)
  -polly-no-tiling                  - Disable tiling in the scheduler
  -polly-only-func=<function-name>  - Only run on a single function
  -polly-report                     - Print information about the activities
                                      of Polly
  -polly-vectorizer                 - Select the vectorization strategy
    =none                           -   No Vectorization
    =polly                          -   Polly internal vectorizer
    =unroll-only                    -   Only grouped unroll the vectorize
                                        candidate loops
    =bb                             -   The Basic Block vectorizer driven by
                                        Polly

llvm-svn: 181295
2013-05-07 07:31:10 +00:00
Tobias Grosser e602a07662 Reformat with clang-format
clang-format become way more stable. This time we mainly reformat function
signatures.

llvm-svn: 181294
2013-05-07 07:30:56 +00:00
Tobias Grosser 249c4b1ad5 ScheduleOptimizer: Use isl_map_from_union_map to extract map.
llvm-svn: 179268
2013-04-11 05:55:13 +00:00
Tobias Grosser f242b806ac ScheduleOpt: Do not crash on statements with empty iteration domains
Statements with an empty iteration domain may not have a schedule assigned by
the isl schedule optimizer. As Polly expects each statement to have a schedule,
we keep the old schedule for such statements.

This fixes http://llvm.org/PR15645`

Reported-by: Johannes Doerfert  <johannesdoerfert@gmx.de>
llvm-svn: 179233
2013-04-10 22:48:08 +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 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 29666113fd ScheduleOptimizer: Simplify some code
We now use isl_map_equate, which makes the code a lot simpler.

llvm-svn: 157246
2012-05-22 10:47:31 +00:00
Hongbin Zheng 6879421727 Allow polly ask bb-vectorizer to vectorize the loop body.
llvm-svn: 156254
2012-05-06 10:22:19 +00:00
Tobias Grosser 460e9a463d ScheduleOptimizer: Move functions into class
llvm-svn: 155548
2012-04-25 13:22:43 +00:00
Hongbin Zheng 8a8466106c Refactor: Move the code generation related header files to include/polly/CodeGen.
llvm-svn: 155547
2012-04-25 13:18:28 +00:00
Tobias Grosser 216ea58b21 ScheduleOpt: Fix crash with -enable-polly-vector
llvm-svn: 154808
2012-04-16 11:06:06 +00:00
Tobias Grosser f9fbbdfd74 Fix typos.
Pointed out by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 154337
2012-04-09 19:46:05 +00:00
Tobias Grosser 2f809feec5 ScheduleOptimizer: Remove forgotten debug output
llvm-svn: 152936
2012-03-16 18:45:10 +00:00
Tobias Grosser 8a5070213a ScheduleOptimizer: Do not get dependences, if we do not calculate a schedule
This solves the 'isl_ctx freed, but some objects still reference it' problem
reported in PR12276.

llvm-svn: 152917
2012-03-16 11:51:41 +00:00
Tobias Grosser 3cbe5cfff3 Remove FinalRead
The FinalRead statement represented a virtual read that is executed after the
SCoP. It was used when we verified the correctness of a schedule by checking if
it yields the same FLOW dependences as the original code. This is only works, if
we have a final read that reads all memory at the end of the SCoP.
We now switched to just checking if a schedule does not introduce negative
dependences and also consider WAW WAR dependences. This restricts the schedules
a little bit more, but we do not have any optimizer that would calculate a more
complex schedule. Hence, for now final reads are obsolete.

llvm-svn: 152319
2012-03-08 15:21:51 +00:00
Tobias Grosser 92f5480f04 ScheduleOpt: Add option to bound scheduling coefficients of dimensions.
llvm-svn: 150953
2012-02-20 08:41:47 +00:00
Tobias Grosser 4d63b9d0f9 ScheduleOptimizer: Dump the calculated schedule in debug mode
llvm-svn: 150951
2012-02-20 08:41:21 +00:00
Tobias Grosser 992e60ca57 ScheduleOpt: Add option to bound constant term coefficients
llvm-svn: 150950
2012-02-20 08:41:15 +00:00
Tobias Grosser 1e03ad7213 ScheduleOpt: Only get RAW dependences if we asked for raw
llvm-svn: 150574
2012-02-15 09:58:42 +00:00
Tobias Grosser 1deda29598 ScheduleOpt: Allow to configure for which dependences to optimize
We can either optimize for RAW dependences or for all dependences.
For the moment, I do not see a big difference here.

llvm-svn: 150484
2012-02-14 14:02:48 +00:00
Tobias Grosser 00383a75b8 CodeGen: Get dependences for validity and proximity separately
This change itself should not change functionality, but it will make it easier
to support use different dependence kinds in for validity and proximity
constraints.

llvm-svn: 150483
2012-02-14 14:02:44 +00:00
Tobias Grosser 5f9a762056 ScopInfo: Add Scop::getDomains()
llvm-svn: 150482
2012-02-14 14:02:40 +00:00
Tobias Grosser 98610eed34 ScheduleOptimizer: Change vars to start with uppercase letter
llvm-svn: 150430
2012-02-13 23:31:39 +00:00
Tobias Grosser 8ad6bc339a Schedule: Sort includes and remove useless ones
llvm-svn: 149383
2012-01-31 13:26:29 +00:00
Tobias Grosser 9f75aba51f Remove leftover constant
llvm-svn: 149290
2012-01-30 22:46:22 +00:00
Tobias Grosser 18aa54cbae Scheduling: Limiting the constant term is not necessary any more
Due to our gist simplifications, limiting the constant term does not seem to
be necessary any more.

Pointed out by Sven Verdoolaege

llvm-svn: 149288
2012-01-30 22:44:05 +00:00
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 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 b6033396fd ScheduleOptimizer: Do not tile bands with just one dimension
llvm-svn: 146149
2011-12-08 13:02:58 +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 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 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 967239c029 Only have a single option to disable tiling for both isl and Pocc optimzer
This also documents the new option on the website.

llvm-svn: 142775
2011-10-23 20:59:44 +00:00
Tobias Grosser 67707b7131 Enable prevectorization with -enable-polly-vector.
This removes the separate prevector options for the Pluto and isl scheduler.

llvm-svn: 142774
2011-10-23 20:59:40 +00:00
Tobias Grosser 22636bf498 Rename -enable-schedule-prevector to -polly-prevector
llvm-svn: 142771
2011-10-23 20:59:29 +00:00
Tobias Grosser 353a2684bc ScheduleOptimizer: Allow to disable tiling
llvm-svn: 142770
2011-10-23 20:59:26 +00:00
Tobias Grosser 73600b8edd Initialize the passes early and properly.
llvm-svn: 141455
2011-10-08 00:30:40 +00:00
Tobias Grosser cf3942dfa6 ScopInfo: Only give away a copy of the schedule.
llvm-svn: 141256
2011-10-06 00:04:05 +00:00
Tobias Grosser f53388034d Adapt to introduction of isl_space
Polly should now be compiled with CLooG 0c252c88946b27b7b61a1a8d8fd7f94d2461dbfd
and isl 56b7d238929980e62218525b4b3be121af386edf. The most convenient way to
update is utils/checkout_cloog.sh.

llvm-svn: 141251
2011-10-06 00:03:35 +00:00