Commit Graph

118 Commits

Author SHA1 Message Date
Tobias Grosser 18b1abb137 Add missing __isl_give
Contributed by: Sameer Abu Asal <sameer.abuasal@gmail.com>

llvm-svn: 172771
2013-01-18 00:09:42 +00:00
Chandler Carruth 535d52c7ca Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

llvm-svn: 171370
2013-01-02 11:47:44 +00:00
Sebastian Pop 04c4ce32ae isl: vector code generation based on ISL ast
Original patch by Tobias Grosser, slightly modified by Sebastian Pop.

llvm-svn: 170420
2012-12-18 07:46:13 +00:00
Sebastian Pop a00a029115 change interface for isStride
isStride now takes a partial schedule as input.

Patch from Tobias Grosser <tobias@grosser.es>.

llvm-svn: 170419
2012-12-18 07:46:06 +00:00
Sebastian Pop 98b3544705 remove dependence on CLOOG_FOUND for PollyVectorizerChoice
When polly was configured with cmake without cloog, compilation stopped with:

../tools/polly/lib/CodeGen/BlockGenerators.cpp:662: error: 'PollyVectorizerChoice' was not declared in this scope
../tools/polly/lib/CodeGen/BlockGenerators.cpp:662: error: 'VECTORIZER_FIRST_NEED_GROUPED_UNROLL' was not declared in this scope

llvm-svn: 168623
2012-11-26 22:16:17 +00:00
Sebastian Pop 05c1f00cae remove dead code
llvm-svn: 168621
2012-11-26 22:07:30 +00:00
Tobias Grosser c1b6cec0e7 Make polly -Wdocumentation clean
llvm-svn: 168311
2012-11-19 12:26:25 +00:00
Tobias Grosser 531891e980 ScopDetection: Print line numbers of detected scops
If the flags '-polly-report -g' are given, we print file name and line numbers
for the beginning and end of all detected scops.

  linear-algebra/kernels/gemm/gemm.c:23: Scop start
  linear-algebra/kernels/gemm/gemm.c:42: Scop end
  linear-algebra/kernels/gemm/gemm.c:77: Scop start
  linear-algebra/kernels/gemm/gemm.c:82: Scop end

llvm-svn: 167235
2012-11-01 16:45:20 +00:00
Tobias Grosser 177982c478 CodeGen: Add scop-parameters to the OpenMP context
In addition to the arrays and clast variables a SCoP statement may also refer to
values defined before the SCoP or to function arguments. Detect these values and
add them to the set of values passed to the function generated for OpenMP
parallel execution of a clast.

Committed with additional test cases and some refactoring.

Contributed by:  Armin Groesslinger  <armin.groesslinger@uni-passau.de>

llvm-svn: 167214
2012-11-01 05:34:48 +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 c967d8e6e9 isl-codegen: Support '<' and '>'
Previously isl always generated '<=' or '>='. However, in many cases '<' or '>'
leads to simpler code. This commit updates isl and adds the relevant code
generation support to Polly.

llvm-svn: 166020
2012-10-16 07:29:13 +00:00
Micah Villmow 7a3d8209c3 Move TargetData to DataLayout to fix build breakage caused by LLVM r16540
llvm-svn: 165408
2012-10-08 17:26:19 +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 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