Commit Graph

757 Commits

Author SHA1 Message Date
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 5a2925c6a1 cmake: Fix building of Polly on Apple system
The Apple linker fails by default, if some function calls can not be resolved at
link time. However, all functions that are part of LLVM itself will not be
linked into Polly, but will be provided by the compiler that Polly is loaded
into.  Hence, during linking we need to ignore failures due to unresolved
function calls.

llvm-svn: 161234
2012-08-03 07:12:07 +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 9e97ae143f Update llvm.codegen() patch for CodeGen.cpp changes in r159694.
Contributed by:  Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 161160
2012-08-02 08:16:40 +00:00
Tobias Grosser 8ea010b6b1 Add missing dependency to cmake system
llvm-svn: 161158
2012-08-02 07:47:37 +00:00
Tobias Grosser c11349c55a Add support for libpluto as the scheduling optimizer.
llvm-svn: 161157
2012-08-02 07:47:26 +00:00
Hongbin Zheng 7aee737062 IndependentBLocks: Do not visit the same instruction twice when moving the
operand tree.

This patch fix Bug 13491, and the original "FIXME" in IndependentBlocks.cpp.

Patched by Kevin Fan<kevin.fan@gmail.com>.

llvm-svn: 161105
2012-08-01 08:46:11 +00:00
Tobias Grosser 19bde907b5 Create a new directory before running the polly script
Otherwise the script spams the home directory and, in case there are folders
of previous attempts lying around, it may fail in some unexpected way.

llvm-svn: 160677
2012-07-24 16:58:57 +00:00
Tobias Grosser 25184fe925 Allow cast instructions within scops
Cast instruction do not have side effects and can consequently be part of a
scop. We special cased them earlier, as they may be problematic within array
subscripts or loop bounds. However, the scalar evolution validator already
checks for them such that there is no need to also check the instructions within
the basic blocks.  Checking them is actually overly conservative as the precence
of casts may invalidate a scop, even though scalar evolution is not influenced
by it.

llvm-svn: 160261
2012-07-16 10:57:32 +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
Tobias Grosser 903c242662 Update libGPURuntime to be dual licensed under MIT and UIUC license.
Contributed by: Yabin Hu  <yabin.hwu@gmail.com>

llvm-svn: 159815
2012-07-06 10:40:15 +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
Hongbin Zheng 5205e0c40e Refactor: Use generic internal function template in GICHelper.cpp to avoid duplication.
llvm-svn: 159734
2012-07-05 08:42:39 +00:00
Tobias Grosser 5c0f6f3350 Replace CUDA data types with Polly's GPGPU data types.
Contributed by:  Yabin Hu  <yabin.hwu@gmail.com>

llvm-svn: 159725
2012-07-04 21:45:03 +00:00
Tobias Grosser 822b254507 codegen.intrinsic: Update testcase to work with NVPTX backend
llvm-svn: 159650
2012-07-03 08:18:34 +00:00
Tobias Grosser b266c98ccc Update to Polly for LLVM r159614 which changes Passes.cpp.
Contributed by: Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 159649
2012-07-03 08:18:31 +00:00
Tobias Grosser 1b593a114e Update to Polly for LLVM r159383 which changes SelectionDAGBuilder.cpp.
Contributed by: Yabin Hu <yabin.hwu@gmail.com>

llvm-svn: 159507
2012-07-01 13:47:50 +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 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
Tobias Grosser d654c250c4 Fix typo
Suggested by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 154415
2012-04-10 18:12:19 +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
Hongbin Zheng ed986ab6a4 Rewritten expandRegion to clarify the intention and improve
performance, patched by Johannes Doerfert <johannes@jdoerfert.de>.

llvm-svn: 154260
2012-04-07 15:14:28 +00:00
Hongbin Zheng 3a2d6035d2 ScopDetection: Add some comments to function "expandRegion".
llvm-svn: 154259
2012-04-07 12:29:27 +00:00
Hongbin Zheng 94868e6cc6 Speed up SCoP detection time by checking the exit of the region first,
patched by Johannes Doerfert <johannes@jdoerfert.de>.

llvm-svn: 154258
2012-04-07 12:29:17 +00:00
Tobias Grosser 84ecc47e1c CodeGen: Allow Polly to do 'grouped unrolling', but no vector generation.
Grouped unrolling means that we unroll a loop such that the different instances
of a certain statement are scheduled right after each other, but we do
not generate any vector code. The idea here is that we can schedule the
bb vectorizer right afterwards and use it heuristics to decide when
vectorization should be performed.

llvm-svn: 154251
2012-04-07 06:16:08 +00:00
Hongbin Zheng 2b4aeca74e Fix a bug introduced by r153739: We are not able to provide the correct
dependent list for target polly-test, hence making "all" from the top
  of llvm build directory will cause the target "polly-test" being built
  before its dependencing target built.

Patched by Sebastian Pop<spop@codeaurora.org>

llvm-svn: 154162
2012-04-06 03:56:27 +00:00
Tobias Grosser 8239a4cadf CodeGen: Remove unused declaration
llvm-svn: 153954
2012-04-03 12:37:14 +00:00
Tobias Grosser 0905a23806 CodeGen: Recreate old ivs with the original type
To avoid overflows we still use a larger type (i64) while calculating the value
of the old ivs.  However, we truncate the result to the type of the old iv when
providing it to the new code.

A corresponding test case is added to the polly test suite. Also, a failing test
case is fixed.

This fixes PR12311.

Contributed by: Tsingray Liu  <tsingrayliu@gmail.com>

llvm-svn: 153952
2012-04-03 12:24:32 +00:00
Hongbin Zheng 9270a8875a www: Fix typo, replace "LD_LBIRARY_PATH" by "LD_LIBRARY_PATH" in get_started.
llvm-svn: 153948
2012-04-03 09:15:52 +00:00
Hongbin Zheng da4138d105 www: Append path instead overwrite path when exporting the path of pocc.
llvm-svn: 153936
2012-04-03 06:29:27 +00:00
Hongbin Zheng eedc49c3d4 www: Fix typo in the setting LD_LBIRARY_PATH command, as pointed out by
Dmitry N. Mikushin.

llvm-svn: 153934
2012-04-03 04:39:47 +00:00
Tobias Grosser f00bd96cde CodeGen: Some style improvements
llvm-svn: 153871
2012-04-02 12:26:13 +00:00
Tobias Grosser d6d7d7e128 CodeGen: Remove unused variable
llvm-svn: 153840
2012-04-01 16:55:30 +00:00
Tobias Grosser de49ef76f6 Remove unneeded alias analysis
llvm-svn: 153839
2012-04-01 16:49:48 +00:00
Tobias Grosser 89339067b0 CodeGen: Allow function parameters to be rewritten in getNewValue()
When deriving new values for the statements of a SCoP, we assumed that parameter
values are constant within the SCoP and consquently do not need to be rewritten.
For OpenMP code generation this assumption is wrong, as such values are not
available in the OpenMP subfunction and consequently also may need to be
rewritten.

Committed with some changes.

Contributed-By: Johannes Doerfert  <s9jodoer@stud.uni-saarland.de>
llvm-svn: 153838
2012-04-01 16:49:45 +00:00
Hongbin Zheng b5bf8cfa17 Make the "all" target depend on polly-test, so that users can run regression
tests by simply typing "make -C tools/polly/test", like llvm's regression
  tests.

llvm-svn: 153739
2012-03-30 09:27:16 +00:00
Hongbin Zheng 2700adebfa Autoconf build: Try to update LLVMPolly.so before running regression tests
llvm-svn: 153738
2012-03-30 09:27:07 +00:00
Hongbin Zheng 609089f254 Move the CodeGeneration.cpp to the CodeGen folder and update the build system.
Patched by Tsingray.

llvm-svn: 153736
2012-03-30 08:46:18 +00:00
Hongbin Zheng 3ab0434bb7 Get started guide: Suggest users to append the parent directory of cloog
libraries to LD_LIBRARY_PATH.

llvm-svn: 153734
2012-03-30 08:18:19 +00:00
Tobias Grosser f49d11dfac www: Add more missing features to the TODO list
llvm-svn: 153664
2012-03-29 17:53:54 +00:00
Tobias Grosser f67a77b9b9 www: Update TODO list
- Link to several new bug reports that describe problems in more detail
- Add some more items
- Remove owners for inactive projects. This just blocks other people
- Rename 'middle part' to 'optimizer'

llvm-svn: 153647
2012-03-29 13:10:34 +00:00
Tobias Grosser 217616df99 www: Link to console view with only polly buildbots
llvm-svn: 153646
2012-03-29 13:10:30 +00:00
Tobias Grosser 900893d2d8 CodeGeneration: Proberly build the dominator tree
llvm-svn: 153645
2012-03-29 13:10:26 +00:00
Hongbin Zheng e53bdfe633 Use python script to silence the expected testcase fails on 32bit platform.
llvm-svn: 153644
2012-03-29 13:10:10 +00:00
Hongbin Zheng 689e84fcec Regession testing: Substitut POLLY_LIB_DIR, which is introduced by commit
r152924, by $(LibDir). Because we assume polly built by autoconf is always
  in llvm tree.

llvm-svn: 153642
2012-03-29 12:36:52 +00:00
Hongbin Zheng b7c07f3c2e Out of tree build support: Set TARGET_TRIPLE from the result of "llvm-config --host-target"
instead of loading the "LLVMConfig.cmake" which is only installed when
  llvm configured by cmake.

llvm-svn: 153503
2012-03-27 07:56:07 +00:00
Hongbin Zheng 0578aaf77c Don't fail the lli testcases on 32bit platform.
llvm-svn: 153440
2012-03-26 15:16:48 +00:00
Hongbin Zheng b85c0b3e0c Out-of-tree build: Load the configuration of the installed llvm.
llvm-svn: 153439
2012-03-26 15:16:29 +00:00
Tobias Grosser 5e8ffa83c0 CodeGen: Remove the need for setIVS
llvm-svn: 153331
2012-03-23 12:20:36 +00:00
Tobias Grosser ebf3008ec6 CodeGen: Simplify Variable Names
llvm-svn: 153330
2012-03-23 12:20:32 +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 46fc9ca53f CodeGen: Change some variables to uppercase
No functional changes intended.

llvm-svn: 153321
2012-03-23 08:24:10 +00:00
Tobias Grosser cf88d84d79 test: Remove memaccess prefix
The prefix is not needed, as all test cases are already in a separate folder.

llvm-svn: 153320
2012-03-23 08:24:04 +00:00
Tobias Grosser d6adda3071 CodeGen: Full support for isl_pw expressions in modified access functions.
This also adds support for modifiable write accesses (until now only read
accesses where supported). We currently do not derive an exact type for the
expression, but assume that i64 is good enough. This will be improved in future
patches.

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

llvm-svn: 153319
2012-03-23 08:21:22 +00:00
Tobias Grosser 3e72197efc IndVarSimplify: Disable simplifyIVUsers
This functionality is not available in LLVM trunk and breaks the compilation of
Polly. This patch fixes the compilation, but may not be enough to recover all
functionality.

llvm-svn: 153318
2012-03-23 08:02:19 +00:00
Tobias Grosser d87492bb8c IndVarSimplify: Adapt to changes in LLVM trunk
Contributed-By: Andrew Trick <atrick@apple.com>
llvm-svn: 153317
2012-03-23 08:02:15 +00:00
Tobias Grosser d1f12db70e IndVarSimplify: Proberly initialize the pass.
llvm-svn: 153316
2012-03-23 08:02:05 +00:00
Tobias Grosser 2f809feec5 ScheduleOptimizer: Remove forgotten debug output
llvm-svn: 152936
2012-03-16 18:45:10 +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 3ec2abc5fb Don't allow pointer types in affine expressions
We currently do not support pointer types in affine expressions. Hence, we
disallow in the SCoP detection. Later we may decide to add support for them.

This fixes PR12277

Reported-By: Sebastian Pop  <sebpop@gmail.com>
llvm-svn: 152928
2012-03-16 16:36:47 +00:00
Hongbin Zheng c507b1e262 Off-tree build support: Also check the existence of the "not" utility.
llvm-svn: 152925
2012-03-16 14:34:27 +00:00
Hongbin Zheng c7584ff270 Off-tree build support: Set the path of Polly's library correctly.
llvm-svn: 152924
2012-03-16 14:34:20 +00:00
Hongbin Zheng 33254d1edf Revert "Minor change: Use config.polly_obj_root to locate Polly's library,"
This reverts commit 7dd9b6327b54b08ece32a4607d5ac093b518b79a.

llvm-svn: 152923
2012-03-16 13:49:55 +00:00
Hongbin Zheng 632f5f4934 Off-tree build support: Warn the user if FileCheck cannot be found.
llvm-svn: 152921
2012-03-16 13:24:42 +00:00
Hongbin Zheng 95c84eab5c Minor change: Use config.polly_obj_root to locate Polly's library,
so lit find Polly's library in off-tree build.

llvm-svn: 152920
2012-03-16 13:24:34 +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 371badaa47 SCEVValidator: Ensure that parameters are recorded correctly
This also fixes UMax where we did not correctly keep track of the parameters.
Fixes PR12275.

Reported-By: Sebastian Pop  <sebpop@gmail.com>
llvm-svn: 152913
2012-03-16 10:16:28 +00:00
Tobias Grosser 540757b09c ScevValidator: Add printer for ValidatorResult
llvm-svn: 152912
2012-03-16 10:12:37 +00:00
Hongbin Zheng c0f53b1c00 Polly-test: Add a cmake option "POLLY_TEST_DISABLE_BAR". We can enable
this option in the configure step of Polly's builder to get more readable
 output from the stdio log.

llvm-svn: 152910
2012-03-16 09:04:09 +00:00
Hongbin Zheng 73e53f510a More AddUsersIfInteresting related fix.
llvm-svn: 152909
2012-03-16 08:31:24 +00:00
Hongbin Zheng 741f8d666f IndVarSimplify: Adpat to IVUsers::AddUsersIfInteresting change.
llvm-svn: 152908
2012-03-16 08:26:12 +00:00
Tobias Grosser 0e979d1628 www: Fix german special characters
llvm-svn: 152800
2012-03-15 13:55:38 +00:00
Tobias Grosser 126af46c4c www: Add another GPGPU publication
llvm-svn: 152799
2012-03-15 13:54:12 +00:00
Raghesh Aloor f41d001384 Memaccess: Updating Documentation
Adding documentation for changes in coefficients of induction
variables.

llvm-svn: 152795
2012-03-15 11:40:05 +00:00
Tobias Grosser 00d898d6b0 CodeGen: Call isl_set_copy() within the loop
llvm-svn: 152793
2012-03-15 09:34:58 +00:00
Tobias Grosser 2da263e3b6 CodeGen: Start variables with uppercase letters
llvm-svn: 152792
2012-03-15 09:34:55 +00:00
Tobias Grosser d596b37eb0 CodeGen: Get analyses from the Pass instance
llvm-svn: 152791
2012-03-15 09:34:52 +00:00
Tobias Grosser e9ffea2ccf CodeGen: Introduce helper function to get pointer to int
llvm-svn: 152790
2012-03-15 09:34:48 +00:00
Raghesh Aloor b20b49e3f0 Memaccess: Removing unwanted code
When the code is moved to IslGenerator class there is no use for
IslPwAffUserInfo.

llvm-svn: 152612
2012-03-13 05:51:44 +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 45ed487a9c Dependences: Fix typo
llvm-svn: 152318
2012-03-08 15:21:42 +00:00
Tobias Grosser 9ffa550dd9 www: Really fix it
llvm-svn: 152311
2012-03-08 12:02:59 +00:00
Tobias Grosser 9206404faf www: Fix link to image
llvm-svn: 152310
2012-03-08 12:02:10 +00:00
Tobias Grosser f67424ef96 www: Move the Polly architecture to the documentation
llvm-svn: 152309
2012-03-08 11:59:43 +00:00
Tobias Grosser 3495b42f9d www: Point to the memaccess documentation
llvm-svn: 152308
2012-03-08 11:55:27 +00:00
Tobias Grosser 7a82da99b1 www: Simplify bugs text
llvm-svn: 152307
2012-03-08 11:45:49 +00:00
Tobias Grosser e586f0ec5c www: Merge Examples with Documentation section
llvm-svn: 152306
2012-03-08 11:37:39 +00:00
Tobias Grosser f9250a1cb0 www: Update todo page
llvm-svn: 152305
2012-03-08 11:31:54 +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 29d7255baf www: Fix some command lines in the examples
llvm-svn: 152229
2012-03-07 14:30:54 +00:00
Tobias Grosser 3c2efba7ff CodeGen: Fix typo 'form' -> 'from'
Suggested by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 152109
2012-03-06 07:38:57 +00:00
Tobias Grosser 55d5208eae CodeGen: Document and beautify the parts of the BlockGenerators
llvm-svn: 151917
2012-03-02 15:20:39 +00:00
Tobias Grosser df3823750e CodeGen: Pass the scalar maps properly
llvm-svn: 151916
2012-03-02 15:20:35 +00:00
Tobias Grosser 8367e0c3d2 CodeGen: Prettify
llvm-svn: 151915
2012-03-02 15:20:31 +00:00
Tobias Grosser 260e86d3f0 CodeGen: Style
llvm-svn: 151914
2012-03-02 15:20:28 +00:00
Tobias Grosser 08a8238b7a CodeGen: Move domain into the VectorBlockGenerator
llvm-svn: 151913
2012-03-02 15:20:24 +00:00
Tobias Grosser f6beec674e CodeGen: Simplify the generation of a splat
llvm-svn: 151912
2012-03-02 15:20:21 +00:00
Tobias Grosser 415245def5 CodeGen: Prettify function
llvm-svn: 151911
2012-03-02 15:20:17 +00:00
Tobias Grosser 80998e7618 CodeGen: Create separate VectorBlockGenerator
llvm-svn: 151907
2012-03-02 11:27:28 +00:00
Tobias Grosser 642c41116d CodeGen: Extract code generation for isl types into its own class
llvm-svn: 151906
2012-03-02 11:27:25 +00:00
Tobias Grosser 44d169552b CodeGen: Remove unneeded member variable
llvm-svn: 151905
2012-03-02 11:27:21 +00:00
Tobias Grosser 32152cbd1c CodeGen: Extract code into the new function copyVectorInstruction
llvm-svn: 151904
2012-03-02 11:27:18 +00:00
Tobias Grosser fc1153fb09 CodeGen: Sink loop to iterate vector lanes down into copyInstruction
llvm-svn: 151903
2012-03-02 11:27:15 +00:00
Tobias Grosser 8b4bf8b2fa CodeGenerator: Rename functions to show they produce vector code
llvm-svn: 151902
2012-03-02 11:27:11 +00:00
Tobias Grosser b35d9c1dfc Fix typo
llvm-svn: 151901
2012-03-02 11:27:08 +00:00
Tobias Grosser 8927a44f90 CodeGen: No need to forward the vector dimension
llvm-svn: 151900
2012-03-02 11:27:05 +00:00
Tobias Grosser f81a691ef7 CodeGen: Store the vector width in the block generator
This allows us to remove a lot of redundant parameters.

llvm-svn: 151899
2012-03-02 11:27:02 +00:00
Tobias Grosser 32386750a6 CodeGen: Remove dead code
llvm-svn: 151898
2012-03-02 11:26:59 +00:00
Tobias Grosser 8412cda5ad Codegen: Add Pass as a member variable of BlockGenerator
llvm-svn: 151897
2012-03-02 11:26:55 +00:00
Tobias Grosser 14bcbd5380 CodeGen: Simplify and Prettify code
llvm-svn: 151896
2012-03-02 11:26:52 +00:00
Tobias Grosser c941ede854 CodeGen: Hide the private implementation of the block generator
llvm-svn: 151895
2012-03-02 11:26:49 +00:00
Tobias Grosser 262df3b9e7 CodeGen: Start with uppercase letter
llvm-svn: 151894
2012-03-02 11:26:46 +00:00
Tobias Grosser ce3f537ae2 CodeGen: Only check once if a loop is parallel
Suggested by: Sebastian Pop  <sebpop@gmail.com>

llvm-svn: 151893
2012-03-02 11:26:42 +00:00
Tobias Grosser 2e04dad751 www: Fix typo founded -> funded
Found-By: Christian Lengauer
llvm-svn: 151810
2012-03-01 15:02:21 +00:00
Tobias Grosser e550fa2f95 www: Fix french special characters
llvm-svn: 150959
2012-02-20 14:03:56 +00:00
Tobias Grosser be3df7b3ee Add information, that Polly became a real LLVM project
llvm-svn: 150955
2012-02-20 08:41:55 +00:00
Tobias Grosser 7cde0845b5 www: Update links polly.grosser.es -> polly.llvm.org
llvm-svn: 150954
2012-02-20 08:41: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 6b675e3108 Update isl
This version of isl, contains some recently committed scheduler patches.

llvm-svn: 150952
2012-02-20 08:41:44 +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 9a44b97913 Revert "CodeGeneration: Implement ceild/floord exactly as CLooG does"
I think I did not get the implementation right. As the current implementation
works well, we will just stick with it for now.

llvm-svn: 150691
2012-02-16 14:13:19 +00:00
Tobias Grosser 26fb5efc6d www: Add 'pet' paper to the publications
llvm-svn: 150676
2012-02-16 09:59:34 +00:00
Tobias Grosser 62a3c96e5d CodeGen: Code following a clast_guard comes after the merge block
llvm-svn: 150675
2012-02-16 09:56:21 +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 e04f318772 CodeGeneration: Implement ceild/floord exactly as CLooG does
llvm-svn: 150673
2012-02-16 09:56:14 +00:00
Tobias Grosser 906eafe32c CodeGen: Simplify code slightly
llvm-svn: 150672
2012-02-16 09:56:10 +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 f12cea4257 CodeGen: Update the BasicBlock pointer correctly when creating 'polly.split...'
Problem reported by: Ryan Taylor <ryta1203@gmail.com>

llvm-svn: 150577
2012-02-15 09:58:53 +00:00
Tobias Grosser cb47dfeb96 CodeGen: Retain the old BB names within the original SCoP
llvm-svn: 150576
2012-02-15 09:58:50 +00:00
Tobias Grosser b61e6318ac CodeGen: Name stmt bbs 'polly.stmt.' + OriginalName
llvm-svn: 150575
2012-02-15 09:58:46 +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 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 0ac9214c2f Recommit "CodeGen: Maintain a valid CFG during code generation"
When I first tried to commit this patch, the builder pointed after generation
of a loop still into the loop body. This means that code that was supposed to
be generated after the loop was generated right into the loop body. We fixed
this by pointing the builder to the BB after the loop, as soon as code
generation of the loop body itself is finished.

llvm-svn: 150480
2012-02-14 14:02:27 +00:00
Tobias Grosser 1773fb1c00 Revert "CodeGen: Maintain a valid CFG during code generation"
This commit contained some bugs. Revert it until I get around to fix them.

llvm-svn: 150431
2012-02-13 23:31:43 +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 04eadc476e tests: Replace . by %s
llvm-svn: 150377
2012-02-13 12:29:43 +00:00
Tobias Grosser 5c853bab78 CodeGen: Remove unused variable.
llvm-svn: 150376
2012-02-13 12:29:34 +00:00
Tobias Grosser 0b6c613a10 CodeGen: Maintain a valid CFG during code generation
Before this change we built the CFG such that it was only valid after code was
fully generated. During code generation itself, it was often incomplete. After
this change always maintain a valid CFG. This will later allow us to use the
SCEVExpander during code generation. This is the first step to get rid of the
independent blocks pass.

llvm-svn: 150339
2012-02-12 12:09:53 +00:00
Tobias Grosser 194beea739 CodeGen: Remove unused instruction
llvm-svn: 150338
2012-02-12 12:09:49 +00:00
Tobias Grosser 8518bbe39f CodeGen: Always name merge block
llvm-svn: 150337
2012-02-12 12:09:46 +00:00
Tobias Grosser bd608a8949 CodeGen: Start variable names with uppercase letter.
llvm-svn: 150336
2012-02-12 12:09:41 +00:00
Tobias Grosser 0dbbdd7637 Codegen: Give split and merge basic blocks better names
llvm-svn: 150335
2012-02-12 12:09:37 +00:00
Tobias Grosser d855cc5720 CodeGen: Further improve style
llvm-svn: 150334
2012-02-12 12:09:32 +00:00
Tobias Grosser b1c9599faa CodeGen: Move generation of OpenMP out of the way
We also fix some style issues. This change contains no functional change.

llvm-svn: 150333
2012-02-12 12:09:27 +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 c327932cf5 ScopInfo: Simplify some isl code
llvm-svn: 149503
2012-02-01 14:23:36 +00:00
Tobias Grosser 5772e65be0 CodeGeneration: Rephrase comment slightly
llvm-svn: 149502
2012-02-01 14:23:33 +00:00
Tobias Grosser bda1f8f808 CodeGeneration: Order includes alphabetically
llvm-svn: 149501
2012-02-01 14:23:29 +00:00
Tobias Grosser ab1f7c4ee3 www: More typos
Pointed out by Chad Rosier

llvm-svn: 149456
2012-02-01 00:08:10 +00:00
Tobias Grosser f316b38e20 www: Add missing -mllvm to documentation
Found by Ryan Taylor

llvm-svn: 149415
2012-01-31 20:24:21 +00:00
Tobias Grosser 1f1daa9ac7 www: Spelling fixes
Reported by Sebastian Pop

llvm-svn: 149410
2012-01-31 19:54:50 +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 8ad6bc339a Schedule: Sort includes and remove useless ones
llvm-svn: 149383
2012-01-31 13:26:29 +00:00
Tobias Grosser ccda0d5060 www: Add news about the improved isl scheduling support
llvm-svn: 149374
2012-01-31 09:13:12 +00:00
Tobias Grosser 62f55bc3b0 www: Remove PoCC from the prerequisites
llvm-svn: 149373
2012-01-31 08:50:23 +00:00
Tobias Grosser 3d8bec8db9 polly.sh: Do not automatically install scoplib either.
It is only needed for PoCC. We may update our openscop support which is
expected to be wider used. If this is the case we could automatically build
openscop.

llvm-svn: 149372
2012-01-31 08:50:19 +00:00
Tobias Grosser 86b6b62c2c www: Move PoCC to the end of the installation section
llvm-svn: 149371
2012-01-31 08:50:16 +00:00
Tobias Grosser 5d38c64b79 polly.sh: Do not build PoCC automatically
As we now have a scheduler that works, I do not believe a lot of people need
PoCC right ahead. People who want to do an in depth investigation of the
different schedulers can install it as well manually.

llvm-svn: 149370
2012-01-31 08:50:12 +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 061e20d2f8 Use isl version: 3c66541593a6bf3b5a3d35d31567abe6c9e5a04b
This allows us to set the fusion strategy and to gist-simplify union_maps.

llvm-svn: 149262
2012-01-30 19:38:40 +00:00
Tobias Grosser bc3bc42491 Dependences: Coalesce the dependences before returning them.
llvm-svn: 149261
2012-01-30 19:38:36 +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 a1f093465b Disable some clang warnings in imported JSON code.
llvm-svn: 149239
2012-01-30 09:07:45 +00:00
Tobias Grosser fc98d453df Remove unneeded default case
This silences a clang warning.

llvm-svn: 149073
2012-01-26 19:53:01 +00:00
Tobias Grosser 9bc5eb08c2 CodeGen: Separate declaration and definition of ClastStmtCodeGen
llvm-svn: 148814
2012-01-24 16:42:32 +00:00
Tobias Grosser bb137e3f03 CodeGen: Separate declaration and definition of ClastExpCodeGen
llvm-svn: 148813
2012-01-24 16:42:28 +00:00
Tobias Grosser e5b4232572 CodeGen: Use getNullValue to simplify some code
llvm-svn: 148812
2012-01-24 16:42:25 +00:00
Tobias Grosser 70e8cdbbd1 CodeGen: Separate declaration and definitions of BlockGenerator
llvm-svn: 148811
2012-01-24 16:42:21 +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 5013c699e4 Dependences: Simplify code
llvm-svn: 148620
2012-01-21 02:38:27 +00:00
Tobias Grosser 030b0d77ed ScopInfo: Further style improvements
llvm-svn: 148328
2012-01-17 20:39:11 +00:00
Tobias Grosser dea982300e ScopInfo: Simplify some code II
llvm-svn: 148327
2012-01-17 20:34:27 +00:00
Tobias Grosser 78d8a3d505 ScopInfo: Simplify some code
llvm-svn: 148326
2012-01-17 20:34:23 +00:00
Tobias Grosser 5a4c2e55dc www: Move automatic polly installation to a more prominent place
llvm-svn: 148307
2012-01-17 14:44:35 +00:00
Tobias Grosser af9977dc10 www: Fix clang path in polly.sh script
llvm-svn: 148306
2012-01-17 14:37:45 +00:00
Tobias Grosser 396fa1e505 Fix clang svn address
llvm-svn: 148248
2012-01-16 18:50:43 +00:00
Tobias Grosser 254328509f Describe how to optionally build the matching clang version.
llvm-svn: 148238
2012-01-16 15:19:19 +00:00
Raghesh Aloor ea6c99c1d9 Memaccess: Removing some unwanted code
llvm-svn: 148100
2012-01-13 06:02:13 +00:00
Sebastian Pop 3f2f65f1f8 add polly.sh script
llvm-svn: 147543
2012-01-04 20:11:18 +00:00
Tobias Grosser 0e2c1bff8f www: Papers about iterative compilation and non static control
llvm-svn: 147444
2012-01-03 10:10:05 +00:00
Tobias Grosser aec0a97a41 Add Udays PhD thesis
llvm-svn: 147443
2012-01-03 10:00:55 +00:00
Tobias Grosser c1610132ef Update publications
- Add the LLVM Developer Meeting 2012 talk
- Add papers used within Polly and papers interesting to read in general

llvm-svn: 147442
2012-01-03 09:50:29 +00:00
NAKAMURA Takumi e9d3d21988 Happy new year 2012!
llvm-svn: 147395
2012-01-01 08:16:56 +00:00
Raghesh Aloor a71989c94e Memaccess: Using isl_map_dim_max
Use isl_map_dim_max to extract the details of the changed
access relation. Only constant access functions are supported
now.

llvm-svn: 147305
2011-12-28 02:48:26 +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 f5c8ae5f4b Adapt to move of isSafeToSpeculativelyExecute into another header.
llvm-svn: 146727
2011-12-16 08:27:42 +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 5c28af1c23 www: Enable mp4 version of the developer meeting talk
llvm-svn: 146559
2011-12-14 12:21:27 +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 cae6b39cff Update isl
This updates bringes new options for the isl scheduler.

llvm-svn: 146555
2011-12-14 08:58:36 +00:00
Tobias Grosser 0d90112195 www: Add forgotten files
llvm-svn: 146487
2011-12-13 15:09:09 +00:00
Tobias Grosser 54da06ca28 www: Add LLVM Developer Meeting Video (webm only)
llvm-svn: 146486
2011-12-13 15:07:00 +00:00
Tobias Grosser 40c163a051 www: Improve styling of news section
llvm-svn: 146485
2011-12-13 14:53:25 +00:00
Tobias Grosser fa05128785 www: Rephrase the introduction to Polly
llvm-svn: 146484
2011-12-13 14:53:20 +00:00
Tobias Grosser 9bf3b30c98 Upgrade to CLooG 0.17.0
llvm-svn: 146373
2011-12-12 14:52:31 +00:00
Benjamin Kramer 66af99eb34 Update after LLVM API change.
llvm-svn: 146279
2011-12-09 21:34:43 +00:00
Raghesh Aloor 46eceba361 Memacess: Some style changes
llvm-svn: 146255
2011-12-09 14:27:17 +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 595ec0d0e3 ClooG: Make sure ambigous schedules do not introduce complicated code
Cloog continued to split the domains even after the scattering. This lead to
complicated code.

llvm-svn: 146033
2011-12-07 11:03:48 +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 4a8e356f36 Make isl abort when an error is encountered
llvm-svn: 146027
2011-12-07 07:42:51 +00:00
Tobias Grosser 3f8073aaef Update isl.
llvm-svn: 145933
2011-12-06 10:48:32 +00:00
Tobias Grosser 545bc31324 CodeGen: Style improvements.
llvm-svn: 145932
2011-12-06 10:48:27 +00:00
Tobias Grosser cdea7df0fe Cloog: Include header file for pipe/open/close
We forgot to include the unistd.h header file that defines the
functions mentioned above. This was not a problem with gnu C++ library,
however it did not work for libc++.

llvm-svn: 145790
2011-12-04 10:44:14 +00:00
Tobias Grosser 39913e3648 test: Switch to new atomic instructions
This fixes the test with recent versions of LLVM that do not support
the old atomic instructions any more.

llvm-svn: 145402
2011-11-29 14:51:05 +00:00
Tobias Grosser a66b37d7ae Add utils/jscop2cloog.py
This tool takes a jscop file and translates it into a cloog input file.

llvm-svn: 145401
2011-11-29 14:50:52 +00:00
Tobias Grosser 1e06003227 test: Add more dependences to cmake build
llvm-svn: 145400
2011-11-29 14:50:47 +00:00
Tobias Grosser f281702686 test: Do not hardcode '.so' as library suffix
Contributed by: Marcello Maggioni <hayarms@gmail.com>

llvm-svn: 145076
2011-11-22 19:40:38 +00:00
Tobias Grosser fe8572bc11 www: Document how to run 'make polly-test' for autoconf build
llvm-svn: 145075
2011-11-22 19:40:34 +00:00
Tobias Grosser 9fe98cc3eb autoconf: Change order of linking files
This fixes (or hides) the problem of symbols not being available in the
autoconf build.

llvm-svn: 145074
2011-11-22 19:40:31 +00:00
Tobias Grosser 34525d37b1 OpenScop: Remove use of getNameStr()
llvm-svn: 145073
2011-11-22 19:40:28 +00:00
Tobias Grosser 23156484f3 cmake: Create libPollyExchange as in the autoconf build
llvm-svn: 145072
2011-11-22 19:40:24 +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 29ee0b14d5 Do not use getNameStr() anymore.
Instead we switch to the recommended getName(). This fixes compilation with
recent versions of LLVM.

llvm-svn: 144909
2011-11-17 14:52:36 +00:00
Tobias Grosser 135c9c6534 autoconf: Specify that pollyanalysis depends on pollysupport
llvm-svn: 144908
2011-11-17 12:56:23 +00:00
Tobias Grosser edb8a2807a SCEVValidator: Fix coding standards in ValidatorResult
llvm-svn: 144907
2011-11-17 12:56:21 +00:00
Tobias Grosser fa043f00cd SCEVValidator: Make ValidatorResult a class and enforce the use of wproper accessors
llvm-svn: 144906
2011-11-17 12:56:19 +00:00
Tobias Grosser b1f07c5c0b SCEVValidator: Document SCEVType and ValidatorResult
Suggested by Sebastian Pop.

llvm-svn: 144905
2011-11-17 12:56:17 +00:00
Tobias Grosser bcc0a0d560 SCEVValidator: Restructure the logic of visitAddRecExpr
Suggested by Sebastian Pop.

llvm-svn: 144904
2011-11-17 12:56:14 +00:00
Tobias Grosser 2a7cd94215 SCEVValidator: Fix typo
llvm-svn: 144903
2011-11-17 12:56:12 +00:00
Tobias Grosser 7ffe4e8b0b Fix placement of the '*' that marks a pointer
Suggested by Sebastian Pop.

llvm-svn: 144902
2011-11-17 12:56:10 +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 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 eb21b70d93 ScopLib: Fix export/import after parameters are now tagged with isl_ids.
llvm-svn: 144643
2011-11-15 11:39:02 +00:00
Tobias Grosser 626227462d JSONImporter: Fix parameter ids when importing new access functions
The new isl_id support for parmeters created problems when importing new
access functions. Even though the parameters had the same names,
they were mapped to different ids and where therefore incompatible.
We copy the ids now from the old parameter dimensions. This fixes the
problem.

llvm-svn: 144642
2011-11-15 11:38:59 +00:00
Tobias Grosser 8f99c167cd ScopInfo: Use names of simple parameters to name the isl parameter dimensions.
Parameters can be complex SCEV expressions, but they can also be single scalar
values. If a parameters is such a simple scalar value and the value is named,
use this name to name the isl parameter dimensions.

llvm-svn: 144641
2011-11-15 11:38:55 +00:00
Tobias Grosser 1fb76bd6f7 Cloog: Copy parameter names from isl data structures
llvm-svn: 144640
2011-11-15 11:38:47 +00:00
Tobias Grosser ff9b54d5a9 JScop: Allow to update the context
llvm-svn: 144639
2011-11-15 11:38:44 +00:00