Commit Graph

47 Commits

Author SHA1 Message Date
Tobias Grosser c7d3fc5547 ScopDetect: Only track detection failures if actually needed.
String operations resulted by raw_string_ostream in the INVALID macro can lead
to significant compile-time overhead when compiling large size source code.
This is because raw_string_ostream relies on TypeFinder class, whose
compile-time cost increases as the size of the module increases. This patch
targets to ensure that it only track detection failures if actually needed.
In this way, we can avoid expensive string operations in normal execution.

With this patch file, the relative compile-time cost of Polly-detect pass does
not increase even when compiling very large size source code.

Contributed-by:   Star Tan <tanmx_star@yeah.net>
llvm-svn: 187102
2013-07-25 03:02:29 +00:00
Tobias Grosser 54cb789d39 RegisterPass: Unhide -polly-show and -polly-show-only
llvm-svn: 186806
2013-07-22 04:11:00 +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 b5f92892d1 Remove unneeded RegionSimplify pass.
We now support regions with multiple entries and multiple exits natively.
Regions are not needed to be simplified to single entry and single exit.

We need to XFAIL two test cases as this change increases the scop coverage
and uncoveres two failures in the independent blocks pass. The first failure
will be fixed in a subsequent commit, the second one is in the non-default
-polly-codegen-scev mode and still needs to be fixed.

Contributed-by: Star Tan <tanmx_star@yeah.net>
llvm-svn: 179673
2013-04-17 07:20:30 +00:00
Sebastian Pop cefec6d7e4 SCEVCodegen should not run createIndVarSimplifyPass
llvm-svn: 179018
2013-04-08 13:05:37 +00:00
Tobias Grosser c2bdf1973b RegisterPasses: Improve comments
llvm-svn: 177831
2013-03-23 21:35:52 +00:00
Tobias Grosser 45af235e09 RegisterPasses: clang-format
llvm-svn: 177787
2013-03-23 00:32:21 +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 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
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
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 56ac181189 RegisterPasses: Remove unreachable default case in switch
llvm-svn: 166397
2012-10-21 18:31:27 +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 c11349c55a Add support for libpluto as the scheduling optimizer.
llvm-svn: 161157
2012-08-02 07:47:26 +00:00
Tobias Grosser 0a91f3220b Move CLooG.h into include/polly/CodeGen/
llvm-svn: 157604
2012-05-29 09:11:46 +00:00
Sebastian Pop 8b7f01c6a1 make registerPollyPreoptPasses static
llvm-svn: 156326
2012-05-07 21:27:11 +00:00
Sebastian Pop 5cc8caf88d make registerPollyPasses static, remove param
llvm-svn: 156325
2012-05-07 21:27:09 +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
Sebastian Pop c200977905 compile cloog code only when CLOOG_FOUND is set
llvm-svn: 156199
2012-05-04 20:30:03 +00:00
Hongbin Zheng 746eefeddd 1. Add a header guard for RegisterPasses.h to prevent multiple inclusion.
2. Include the helper function and the helper class in the RegisterPasses.h into the polly namespace.

llvm-svn: 155636
2012-04-26 13:55:33 +00:00
Tobias Grosser fe0675927d Simplify import/export command line flags.
Instead of -polly-run-import-jscop and -polly-run-export-jscop, we just use
-polly-import and -polly-export.

llvm-svn: 155446
2012-04-24 16:12:34 +00:00
Tobias Grosser 58eee8f106 Unify the optimizer selection.
We now support -polly-optimizer=isl, -polly-optimizer=pocc and
-polly-optimizer=none. The option -polly-no-optimizer is gone.

llvm-svn: 155445
2012-04-24 16:12:30 +00:00
Tobias Grosser d1f12db70e IndVarSimplify: Proberly initialize the pass.
llvm-svn: 153316
2012-03-23 08:02:05 +00:00
Tobias Grosser 0acfcdbe7b Do not fail if a command line argument is given more than once
For boolean flags in Polly there is no problem if they are given more than once.
Hence, we can allow it to not fail for build systems that (acciently) add flags
several times.

This fixes: PR12278

Reported by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 152933
2012-03-16 17:17:16 +00:00
Tobias Grosser eeafc867ed RegisterPasses: Allow to print the CFG right after polly
llvm-svn: 150674
2012-02-16 09:56:17 +00:00
Tobias Grosser 099cb16700 RegisterPasses: Add -polly-run-export-cloog option
llvm-svn: 150671
2012-02-16 09:56:07 +00:00
Tobias Grosser cef36d5b99 Copy IndVarSimplify pass from LLVM to Polly
This allows us to enable -enable-iv-rewrite by default and releases LLVM from
the burdon to keep that feature. This is an intermediate step. We plan to soon
remove the need for rewritten induction variables entirely.

llvm-svn: 150481
2012-02-14 14:02:33 +00:00
Tobias Grosser a2a9b9a3e8 RegisterPasses: Make sure to always execute the SCoPInfo pass
llvm-svn: 149871
2012-02-06 14:53:51 +00:00
Tobias Grosser 1d348673e0 Add a sceleton for a polyhedral dead code elimination.
Such a dead code elimination can remove redundant stores to arrays. It can also
eliminate calculations where the results are stored to memory but where they are
overwritten before ever being read. It may also fix bugs like:
http://llvm.org/bugs/show_bug.cgi?id=5117

This commit just adds a sceleton without any functionality.

If anybody is interested to learn about polyhedral optimizations this would be
a good task. Well definined, self contained and pretty simple. Ping me if you
want to start and you need some pointers to get going.

llvm-svn: 149386
2012-01-31 14:00:27 +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 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 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 92a00f818a RegisterPasses: Avoid double negation
Fix suggested by Sebastian Pop.

llvm-svn: 144901
2011-11-17 12:56:06 +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 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 d5e80c5f9c Add an option to run the PoCC optimizer
llvm-svn: 142773
2011-10-23 20:59:35 +00:00
Tobias Grosser 12dcc646d5 Allow to disable the schedule optimizer
The option -polly-no-optimizer disables the scheduling optimizer.

llvm-svn: 142772
2011-10-23 20:59:32 +00:00
Tobias Grosser 76a42df06e Rename -enable-polly-viewer to -polly-run-viewer
Similar changes for polly-only-viewer, polly-printer and polly-only-printer.

llvm-svn: 142766
2011-10-23 20:59:14 +00:00
Tobias Grosser f50dbc44ba RegisterPasses: Allow to disable code generation.
llvm-svn: 142765
2011-10-23 20:59:11 +00:00
Tobias Grosser a3263c85e2 Add flags to run the Polly Printers/Viewers
llvm-svn: 141456
2011-10-08 00:30:44 +00:00
Tobias Grosser 73600b8edd Initialize the passes early and properly.
llvm-svn: 141455
2011-10-08 00:30:40 +00:00
Tobias Grosser 3df9c76d5c RegisterPasses: Rework comments slightly
llvm-svn: 138428
2011-08-24 07:33:05 +00:00
Tobias Grosser 792509b0db Register Polly passes automatically
Polly adds, after it is loaded into opt or clang, its passes to the default set
of -O3 passes. This means optimizing a program with clang and Polly becomes as
simple as executing.

clang -Xclang -load -Xclang lib/LLVMPolly.so -O3 program.c

The same should work for dragonegg powered gfortran, g++, ... or any other tool
that uses the PassManagerBuilder.

Warning: Even though using Polly became with this commit extremly easy, Polly
         is still Pre-Alpha Quality. This means in most cases it will rather
         destroy the world than doing anything positive. ;-)
llvm-svn: 138402
2011-08-23 22:35:38 +00:00