Commit Graph

485 Commits

Author SHA1 Message Date
Tobias Grosser 96682025c7 Add some tests for the independent blocks pass.
llvm-svn: 158306
2012-06-11 10:25:12 +00:00
Tobias Grosser fb4842ff95 Add the runtime library for GPGPU code generation.
Contributed by: Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 158304
2012-06-11 09:25:01 +00:00
Tobias Grosser 3cc99748b6 Fix some coding convention problems.
llvm-svn: 158081
2012-06-06 16:33:15 +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 baa1ac260b CLooG: Do not take into account the context
CLooG and the CLooG based code generation does not yet correctly derive the
types of the expressions, but just uses i64 for everything. This is incorrect,
but works normally pretty well. However, the recent change of adding parameter
bounds to the context made CLooG generate expressions that contain a lot of very
large integers that possibly don't fit into an i64. This broke the code
generation for several benchmarks.

To get the CLooG based code generation working again, we just don't take into
account any constraints in the context. This brings us back to the theoretical
incorrect, but in practice generally correct code.

The next step will be the isl based code generation. Here we will derive
automatically correct types.

llvm-svn: 158015
2012-06-05 19:31:08 +00:00
Tobias Grosser 1cf47f1160 www: Add GPGPU Code Generation Documentation.
llvm-svn: 157690
2012-05-30 13:54:02 +00:00
Tobias Grosser 8d7c4dbf8c Add llvm.codegen intrinsic patch file to polly/utils.
The "llvm.codegen" intrinsic patch is a patch to LLVM, which is used
to generate code for embedded LLVM-IR strings. In Polly, we use it
to generate ptx assembly text for GPGPU code generation.

llvm-svn: 157689
2012-05-30 13:53:57 +00:00
Tobias Grosser 084d8f7d4c ScopInfo: Store ScopStmt pointer in the domain
Store a pointer to each ScopStmt in the isl_id associated with the space of its
domain. This will later allow us to recover the statement during code
generation with isl.

llvm-svn: 157607
2012-05-29 09:29:44 +00:00
Tobias Grosser 400a4ac658 Mark the increments of the generated induction variables 'NSW'
In general, all code that we produce is NSW.

llvm-svn: 157606
2012-05-29 09:11:59 +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 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
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 3b2cf96bae Replace some asserts with llvm_unreachable
llvm-svn: 157244
2012-05-22 10:47:21 +00:00
Tobias Grosser 42b69e5745 ScopInfo: SCEVUnknowns are always parameters
There is no need for special code to handle SCEVUnknowns. SCEVUnkowns are always
parameters and will be handled by the generic parameter handling code in
visit().

llvm-svn: 157243
2012-05-22 10:47:17 +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 e1f6554ed8 add some more missing ifdef CLOOG_FOUND
llvm-svn: 156306
2012-05-07 16:35:11 +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 da4bf55066 WWW: Adapt the vectorize option change.
llvm-svn: 156256
2012-05-06 10:22:57 +00:00
Hongbin Zheng 6417255283 Regression tests: Adapt the vectorize option change.
llvm-svn: 156255
2012-05-06 10:22:43 +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 775d8e65e8 fix typo
llvm-svn: 156210
2012-05-04 21:36:08 +00:00
Chandler Carruth 30dfdfca3b Try to fix the Polly build while I'm trying to get it to build at all locally.
llvm-svn: 156207
2012-05-04 21:24:27 +00:00
Chandler Carruth d6447953f2 Update Polly to match the LLVM interface change in r156196.
llvm-svn: 156203
2012-05-04 20:57:29 +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
Sebastian Pop de613265c5 move Cloog.cpp to CodeGen
llvm-svn: 156184
2012-05-04 18:15:57 +00:00
Tobias Grosser 14afc07577 Fix typo.
Reported by: Andreas Simbuerger

llvm-svn: 156171
2012-05-04 12:11:01 +00:00
Tobias Grosser 913fa54836 ScopDection: Improve status message for non-affine memory accesses.
llvm-svn: 156170
2012-05-04 11:26:52 +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
Tobias Grosser f91c441e72 Further simplify parallelism test
llvm-svn: 155634
2012-04-26 13:43:03 +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
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
Hongbin Zheng 86a37745eb Minor change: Replace convertInt in ScopInfo.cpp by utostr_32, which is
defined in StringExtras.h.

llvm-svn: 155539
2012-04-25 08:01:38 +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 7c3061acdd Make vector tests less sensible to codegen changes
llvm-svn: 155438
2012-04-24 11:08:07 +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 902c9b243d Dependences: Rework parallelism check
After working and explaining this function to someone, I realized it could be
simplified and better documented.

llvm-svn: 155135
2012-04-19 16:38:16 +00:00
Tobias Grosser 105c984b51 www: Update matmul example slightly.
llvm-svn: 154952
2012-04-17 21:38:20 +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 4cb5461dae CodeGen: Generate scalar code if vector instructions cannot be generated
This fixes two crashes that appeared in case of:
  - A load of a non vectorizable type (e.g. float**)
  - An instruction that is not vectorizable (e.g. call)

llvm-svn: 154586
2012-04-12 10:46:55 +00:00
Hongbin Zheng e2107f0999 Revert "Make the "all" target depend on polly-test, so that users can run regression"
This reverts commit 97bd8d50881000c11b65b0e033996ec5f57bcd15.

llvm-svn: 154487
2012-04-11 07:43:24 +00:00
Hongbin Zheng 91bfd78fb2 Revert "Fix a bug introduced by r153739: We are not able to provide the correct"
This reverts commit 2c6bdbf972ac966498489d30a33bfd252df9107d.

llvm-svn: 154486
2012-04-11 07:43:13 +00:00