Commit Graph

104 Commits

Author SHA1 Message Date
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 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 6217e18a7d Add preliminary implementation for GPGPU code generation.
Translate the selected parallel loop body into a ptx string and run it with the
cuda driver API. We limit this preliminary implementation to target the
following special test cases:

  - Support only 2-dimensional parallel loops with or without only one innermost
    non-parallel loop.
  - Support write memory access to only one array in a SCoP.

The patch was committed with smaller changes to the build system:

There is now a flag to enable gpu code generation explictly. This was required
as we need the llvm.codegen() patch applied on the llvm sources, to compile this
feature correctly. Also, enabling gpu code generation does not require cuda.
This requirement was removed to allow 'make polly-test' runs, even without an
installed cuda runtime.

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

llvm-svn: 161239
2012-08-03 12:50:07 +00:00
Tobias Grosser 08ffdba6bd Remove 'using namespace llvm' from header file
This fixes a conflict between polly::createIndVarSimplifyPass() and
llvm::createIndVarSimplifyPass(), which causes problems on windows.

Reported by:  Michael Kruse  <MichaelKruse@meinersbur.de

llvm-svn: 161235
2012-08-03 08:11:24 +00:00
Tobias Grosser b19de925e9 Remove leftover definitions
Contributed by: Michael Kruse  <MichaelKruse@meinersbur.de>

llvm-svn: 161174
2012-08-02 13:34:58 +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 6cc23b07e6 Revert "Add preliminary implementation for GPGPU code generation."
I did not take into account, that this patch fails to compile without the
llvm.codegen patch applied. This breaks buildbots.

I revert this until we found a solution to commit this without buildbots
complaining.

This reverts commit cb43ab80e94434e780a66be3b9a6ad466822fe33.

llvm-svn: 160165
2012-07-13 07:44:56 +00:00
Tobias Grosser b299d28181 Add preliminary implementation for GPGPU code generation.
Translate the selected parallel loop body into a ptx string and run it
with cuda driver API. We limit this preliminary implementation to
target the following special test cases:
  - Support only 2-dimensional parallel loops with or without only one
    innermost non-parallel loop.
  - Support write memory access to only one array in a SCoP.

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

llvm-svn: 160164
2012-07-13 07:21:00 +00:00
Hongbin Zheng cea35f60d5 Add an Instruction member to MemoryAccess Class.
Patched by TangKK <dengjunqi06323011@hotmail.com>.

llvm-svn: 159808
2012-07-06 06:47:03 +00:00
Hongbin Zheng 454e8f9ee8 Add stringFromIslObj support for various isl_objs.
Patched by JunQi<dengjunqi06323011@hotmail.com>.

llvm-svn: 159735
2012-07-05 08:55:31 +00:00
Chandler Carruth c55b598dc2 Speculative update to Polly for LLVM r159421 which moved IRBuilder.h.
llvm-svn: 159423
2012-06-29 12:39:49 +00:00
Tobias Grosser b5f971f744 Add TempScop::isWrite() function.
llvm-svn: 158987
2012-06-22 10:59:36 +00:00
Tobias Grosser 88aeaf6ac4 Detect the cuda library available.
We will use the cuda library for the upcoming automatic GPGPU code generation.

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

llvm-svn: 158064
2012-06-06 12:16:10 +00:00
Tobias Grosser 3a275d20dd Move executeScopConditionally() into its own file
We will reuse this function for the isl code generator.

llvm-svn: 157605
2012-05-29 09:11:54 +00:00
Tobias Grosser 0a91f3220b Move CLooG.h into include/polly/CodeGen/
llvm-svn: 157604
2012-05-29 09:11:46 +00:00
Tobias Grosser 18daacad61 ScopInfo: Add parameter bounds to context
Derive the maximal and minimal values of a parameter from the type it has. Add
this information to the scop context. This information is needed, to derive
optimal types during code generation.

llvm-svn: 157245
2012-05-22 10:47:27 +00:00
Tobias Grosser e192b23f5e Move isParallelFor into CodeGeneration
This removes another include of CLooG header files.

llvm-svn: 157242
2012-05-22 08:46:07 +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
Sebastian Pop 082cea8616 add a check for ISL codegen at configure time
llvm-svn: 156305
2012-05-07 16:20:07 +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
Tobias Grosser ca9a2913b7 Remove unused function
Suggested by: Sebastian Pop

llvm-svn: 155863
2012-04-30 23:49:05 +00:00
Tobias Grosser e71c6ab54c SCEV based code generation
This is an incomplete implementation of the SCEV based code generation.
When finished it will remove the need for -indvars -enable-iv-rewrite.

For the moment it is still disabled. Even though it passes 'make polly-test',
there are still loose ends especially in respect of OpenMP code generation.

llvm-svn: 155717
2012-04-27 16:36:14 +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
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
Hongbin Zheng 3b11a16a44 Refactor: Move the declaration of the BlockGenerator/VectorBlockGenerator
to standalone header and source files.

llvm-svn: 155546
2012-04-25 13:16:49 +00:00
Hongbin Zheng 39645abf4c ScopStmt: Provide a function to allow users look up the corresponding
memory access of a particular instruction, the function will return
  null if no such memory access.

llvm-svn: 155544
2012-04-25 09:34:33 +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
Hongbin Zheng 4ac4e15582 Refactor: Pass the argument 'IRBuilder' and 'AfterBlock' of function 'createLoop' by
reference, so that we do not need to type an extra '&' operator when calling the function.

llvm-svn: 155349
2012-04-23 13:03:56 +00:00
Hongbin Zheng 6f7aa074ad 1. Add a header guard for LoopGenerators.h to prevent multiple inclusion.
2. Include the helper function and the helper class in the LoopGenerator.h into the polly namespace.

llvm-svn: 155348
2012-04-23 13:03:43 +00:00
Tobias Grosser f74a4cd3dd CodeGen: Extract the LLVM-IR generaction of scalar and OpenMP loops.
We create a new file LoopGenerators that provides utility classes for the
generation of OpenMP parallel and scalar loops. This means we move a lot
of the OpenMP generation out of the Polly specific code generator.

llvm-svn: 153325
2012-03-23 10:35:18 +00:00
Tobias Grosser d1f12db70e IndVarSimplify: Proberly initialize the pass.
llvm-svn: 153316
2012-03-23 08:02:05 +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 62afff33c8 Dependences: Simplify isParallelDimension
llvm-svn: 152238
2012-03-07 17:42:49 +00:00
Tobias Grosser 04734a4843 Dependences: Restructure and Document code
llvm-svn: 152237
2012-03-07 17:42:45 +00:00
Tobias Grosser 9691d23d37 Dependences: Prettify the header slightly
llvm-svn: 152236
2012-03-07 17:42:39 +00:00
Tobias Grosser 1d8c0d799c Dependences: Remove unused no_source information
llvm-svn: 152235
2012-03-07 17:42:36 +00:00
Tobias Grosser 5c0e7190ff Dependences: Simplify the check if a new scattering is valid.
We now just check if the new scattering would create non-positive dependences.
This is a lot faster than recalculating dependences (which is especially slow
on tiled code).

llvm-svn: 152230
2012-03-07 16:10:40 +00:00
Tobias Grosser 5f9a762056 ScopInfo: Add Scop::getDomains()
llvm-svn: 150482
2012-02-14 14:02:40 +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 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 28dd48613e ScopInfo: Add isStrideX to unify stride checking
llvm-svn: 148810
2012-01-24 16:42:16 +00:00
Tobias Grosser 78d8a3d505 ScopInfo: Simplify some code
llvm-svn: 148326
2012-01-17 20:34:23 +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 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 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