summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Put the parallel context alloca into the function entry block.Johannes Doerfert2014-10-031-2/+15
| | | | | | | | We use lifetime markers to limit the actual life range (similar to clang). Differential Revision: http://reviews.llvm.org/D5582 llvm-svn: 219005
* Add option to limit the maximal number of parallel threads.Johannes Doerfert2014-10-031-1/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D5581 llvm-svn: 219004
* [Refactor] Generalize parallel code generationJohannes Doerfert2014-10-032-128/+106
| | | | | | | | | | | | | + Generalized function names and comments + Removed OpenMP (omp) from the names and comments + Use common names (non OpenMP specific) for runtime library call creation methodes + Commented the parallel code generator and all its member functions + Refactored some values and methodes Differential Revision: http://reviews.llvm.org/D4990 llvm-svn: 219003
* Align copied load/store instructions as the original.Johannes Doerfert2014-10-021-3/+5
| | | | | | | | | | This also forbids the json importer to access other memory locations than the original instruction as we to reuse the alignment of the original load/store. Differential Revision: http://reviews.llvm.org/D5560 llvm-svn: 218883
* [Refactor] Rename LoopAnnotator to ScopAnnotatorJohannes Doerfert2014-10-023-11/+11
| | | | | | | | | The LoopAnnotator doesn't annotate only loops any more, thus it is called ScopAnnotator from now on. This also removes unnecessary polly:: namespace tags. llvm-svn: 218878
* Allow to annotate alias scopes in the new SCoP.Johannes Doerfert2014-10-022-13/+84
| | | | | | | | | The command line flag -polly-annotate-alias-scopes controls whether or not Polly annotates alias scopes in the new SCoP (default ON). This can improve later optimizations as the new SCoP is basically an alias free environment for them. llvm-svn: 218877
* Annotate LLVM-IR for all parallel loopsJohannes Doerfert2014-10-013-35/+57
| | | | | | | | | | | | | | This change allows to annotate all parallel loops with loop id metadata. Furthermore, it will annotate memory instructions with llvm.mem.parallel_loop_access metadata for all surrounding parallel loops. This is especially usefull if an external paralleliser is used. This also removes the PollyLoopInfo class and comments the LoopAnnotator. A test case for multiple parallel loops is attached. llvm-svn: 218793
* Build domtree of new loops correctlyTobias Grosser2014-09-281-1/+1
| | | | | | This fixes a bug introduced in r217525. llvm-svn: 218581
* [Fix] Allow pointer types as access elements and compare them correctlyJohannes Doerfert2014-09-191-10/+19
| | | | | | | | | | | This fixes two problems which are usualy caused together: 1) The elements of an isl AST access expression could be pointers not only integers, floats and vectores thereof. 2) The runtime alias checks need to compare pointers but if they are of a different type we need to cast them into a "max" type similar to the non pointer case. llvm-svn: 218113
* [RTC] Runtime Alias Checks for the ISL backendJohannes Doerfert2014-09-183-3/+35
| | | | | | | | | | | | | | | | | This change will build all alias groups (minimal/maximal accesses to possible aliasing base pointers) we have to check before we can assume an alias free environment. It will also use these to create Runtime Alias Checks (RTC) in the ISL code generation backend, thus allow us to optimize SCoPs despite possibly aliasing pointers when this backend is used. This feature will be enabled for the isl code generator, e.g., --polly-code-generator=isl, but disabled for: - The cloog code generator (still the default). - The case delinearization is enabled. - The case non-affine accesses are allowed. llvm-svn: 218046
* Allow the IslExprBuilder to build address of expressionsJohannes Doerfert2014-09-182-2/+28
| | | | llvm-svn: 218045
* Allow the IslExprBuilder to compare pointersJohannes Doerfert2014-09-181-24/+27
| | | | llvm-svn: 218044
* Updated to isl 2c19ecd444095d6f560349018f68993bc0e03691Johannes Doerfert2014-09-181-0/+1
| | | | | | Changed test cases and fixed warnings. llvm-svn: 218043
* Compute and print the minimal loop carried dependency distanceJohannes Doerfert2014-09-131-2/+21
| | | | | | | | | | | During the IslAst parallelism check also compute the minimal dependency distance and store it in the IstAst for node. Reviewer: sebpop Differential Revision: http://reviews.llvm.org/D4987 llvm-svn: 217729
* Allow to generate a loop without the GuardBBJohannes Doerfert2014-09-102-41/+52
| | | | | | | | | | | | This allows us to omit the GuardBB in front of created loops if we can show the loop trip count is at least one. It also simplifies the dominance relation inside the new created region. A GuardBB (even with a constant branch condition) might trigger false dominance errors during function verification. Differential Revision: http://reviews.llvm.org/D5297 llvm-svn: 217525
* [Refactor] Cleanup isl code generationJohannes Doerfert2014-09-103-34/+44
| | | | | | | | | | | | | | | | | | | | Summary: + Refactor the runtime check (RTC) build function + Added helper function to create an PollyIRBuilder + Change the simplify region function to create not only unique entry and exit edges but also enfore that the entry edge is unconditional + Cleaned the IslCodeGeneration runOnScop function: - less post-creation changes of the created IR + Adjusted and added test cases Reviewers: grosser, sebpop, simbuerg, dpeixott Subscribers: llvm-commits, #polly Differential Revision: http://reviews.llvm.org/D5076 llvm-svn: 217508
* Use "const auto &" in range based for loopsTobias Grosser2014-09-101-5/+5
| | | | | | | This previous code added in r216842 most likely created unnecessary copies. Reported-by: Duncan P. N. Exon Smith <dexonsmith@apple.com> llvm-svn: 217507
* [Fix] OpenMP parallel loop detection for the isl backendJohannes Doerfert2014-09-091-1/+2
| | | | | | | | | | There was a bug in the IslAst which caused that no more outermost parallel loops were detected/checked after a parallel outermost loop of depth 1. + Test case attached llvm-svn: 217452
* Fix formattingTobias Grosser2014-08-311-1/+1
| | | | llvm-svn: 216844
* Introduce a typedef for the IDToValue typeTobias Grosser2014-08-311-3/+1
| | | | llvm-svn: 216843
* Use range based for loopsTobias Grosser2014-08-311-32/+19
| | | | llvm-svn: 216842
* Revert "[Refactor] Cleanup runtime code generation"Tobias Grosser2014-08-163-51/+34
| | | | | | | | | | | | | | | | This reverts commit 215466 (and 215528, a trivial formatting fix). The intention of these commits is a good one, but unfortunately they broke our LNT buildbot: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-codegen-isl Several of the cleanup changes that have been combined in this 'fixup' are trivial and could probably be committed as obvious changes without risking to break the build. The remaining changes are little and it should be easy to figure out what went wrong. llvm-svn: 215817
* Fix formattingTobias Grosser2014-08-131-2/+1
| | | | llvm-svn: 215528
* [Refactor] Cleanup runtime code generationJohannes Doerfert2014-08-123-33/+51
| | | | | | | + Use regexp in two test case. + Refactor the runtime condition build function llvm-svn: 215466
* [Fix] Broken build after r215121Johannes Doerfert2014-08-081-6/+14
| | | | llvm-svn: 215183
* Make used analysis passes explicitJohannes Doerfert2014-08-073-25/+29
| | | | | | | | Use the explicit analysis if possible, only for splitBlock we will continue to use the Pass * argument. This change allows us to remove the getAnalysis calls from the code generation. llvm-svn: 215121
* Fix the modifiable access creationJohannes Doerfert2014-08-034-153/+81
| | | | | | | | | | | | + Remove the class IslGenerator which duplicates the functionality of IslExprBuilder. + Use the IslExprBuilder to create code for memory access relations. + Also handle array types during access creation. + Enable scev codegen for one of the transformed memory access tests, thus access creation without canonical induction variables available. + Update one test case to the new output. llvm-svn: 214659
* Allow the IslExprBuilder to generate access operationsJohannes Doerfert2014-08-031-1/+34
| | | | llvm-svn: 214658
* Annotate the IslAst with broken reductionsJohannes Doerfert2014-08-011-18/+61
| | | | | | | | | | | | + Split all reduction dependences and map them to the causing memory accesses. + Print the types & base addresses of broken reductions for each "reduction parallel" marked loop (OpenMP style). + 3 test cases to show how reductions are now represented in the isl ast. The mapping "(ast) loops -> broken reductions" is also needed to find the memory accesses we need to privatize in a loop. llvm-svn: 214489
* Change the semantics of is*ParallelJohannes Doerfert2014-08-012-12/+12
| | | | | | | | | The functions isParallel, isInnermostParallel and IsOutermostParallel in IslAstInfo will now return true even in the presence of broken reductions. To compensate for this change the negated result of isReductionParallel can be used. llvm-svn: 214488
* [Refactor] Remove unecessary check and functionJohannes Doerfert2014-07-311-38/+36
| | | | | | | | + Perform the parallelism check on the innermost loop only once. + Inline the markOpenmpParallel function. + Rename all IslAstUserPayload * into Payload to make it consistent. llvm-svn: 214448
* [Refactor] Use nicer print callback function in IslAstJohannes Doerfert2014-07-311-47/+38
| | | | llvm-svn: 214447
* [Refactor] Expose the IslExprBuilder (missing files)Johannes Doerfert2014-07-291-0/+395
| | | | llvm-svn: 214220
* [Refactor] Expose the IslExprBuilderJohannes Doerfert2014-07-291-485/+1
| | | | | | | This allows us to use to IslExprBuilder not only from within IslCodegeneration. llvm-svn: 214215
* Assume no annotations when visiting new domain (IslAst)Johannes Doerfert2014-07-291-15/+5
| | | | | | | | Whe we build the IslAst we visit for nodes (in pre and post order) as well as user/domain nodes. As these two sets are non overlapping we do not need to check if we annotated a node earlier when we visit it. llvm-svn: 214170
* [Refactor] Use non-const MemoryAccess base addressesJohannes Doerfert2014-07-292-2/+2
| | | | llvm-svn: 214168
* Replace the dependences parallelism check by the IslAst oneJohannes Doerfert2014-07-282-54/+28
| | | | llvm-svn: 214061
* [Refactor] Expose the runtime debug builderJohannes Doerfert2014-07-242-83/+74
| | | | llvm-svn: 213908
* [Refactor] Remove containsLoop to find innermost loopsJohannes Doerfert2014-07-241-45/+15
| | | | | | | | | Use the fact that if we visit a for node first in pre and next in post order we know we did not visit any children, thus we found an innermost loop. + Test case for an innermost loop with a conditional inside llvm-svn: 213870
* [Fix] Typo during refactoringJohannes Doerfert2014-07-231-2/+2
| | | | llvm-svn: 213795
* [Refactor] IslAst and payload structJohannes Doerfert2014-07-232-76/+51
| | | | | | | | | | | + Renamed context into build when it's the isl_ast_build + Use the IslAstInfo functions to extract the schedule of a node + Use the IslAstInfo functions to extract the build/context of a node + Move the payload struct into the IslAstInfo class + Use a constructor and destructor (also new and delete) to allocate/initialize the payload struct llvm-svn: 213792
* [Refactor] Unify IslAst print methodsJohannes Doerfert2014-07-231-50/+40
| | | | | | + Add const annotations to some member functions llvm-svn: 213779
* Update for RegionInfo changes.Matt Arsenault2014-07-193-7/+8
| | | | | | | Mostly related to missing includes and renaming of the pass to RegionInfoPass. llvm-svn: 213457
* [Refactor] Move code out of the IslAst headerJohannes Doerfert2014-07-172-15/+51
| | | | | | | | | | | | Offer the static functions to extract information out of an IslAst for node as members of IslAstInfo not as top level entities. + Refactor common code + Add isParallel and isReductionParallel + Rename IslAstUser to IslAstUserPayload to make it clear this is just a (or the) payload struct. llvm-svn: 213272
* [Refactor] Use attributes to mark function as invalid for pollyJohannes Doerfert2014-07-151-1/+1
| | | | | | | + Test case annotated with the new attribute + Modified test case to check if subfunctions are annotated llvm-svn: 213093
* [Format] Clang format IslAst.cppJohannes Doerfert2014-07-151-2/+1
| | | | llvm-svn: 213026
* Annotate reduction parallel loops in the IslAst textual outputJohannes Doerfert2014-07-151-12/+40
| | | | | | | | | | + Introduced dependency type TYPE_TC_RED to represent the transitive closure (& the reverse) of reduction dependences. These are used when we check for reduction parallel loops. + Test cases including loop reversals and modulo schedules which compute reductions in a alternated order. llvm-svn: 213019
* clang-format polly to avoid buildbot noiseTobias Grosser2014-07-092-15/+17
| | | | llvm-svn: 212609
* Derive run-time conditions for delinearizationTobias Grosser2014-07-022-2/+4
| | | | | | | | | | | | | | | | | | | | | | | As our delinearization works optimistically, we need in some cases run-time checks that verify our optimistic assumptions. A simple example is the following code: void foo(long n, long m, long o, double A[n][m][o]) { for (long i = 0; i < 100; i++) for (long j = 0; j < 150; j++) for (long k = 0; k < 200; k++) A[i][j][k] = 1.0; } After clang linearized the access to A and we delinearized it again to A[i][j][k] we need to ensure that we do not access the delinearized array out of bounds (this information is not available in LLVM-IR). Hence, we need to verify the following constraints at run-time: CHECK: Assumed Context: CHECK: [o, m] -> { : m >= 150 and o >= 200 } llvm-svn: 212198
* Use arguments of user statements to perform induction variable substitutionTobias Grosser2014-07-022-55/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To translate the old induction variables as they exist before Polly to new new induction variables introduced during AST code generation we need to generate code that computes the new values from the old ones. We can do this by just looking at the arguments isl generates in each scheduled statement. Example: // Old for i S(i) // New for c0 for c1 S(c0 + c1) To get the value of i, we need to compute 'c0 + c1'. This expression is readily available in the user statements generated by isl and just needs to be translated to LLVM-IR. This replaces an old confusing construct that constructed during ast generation an isl multi affine expression that described this relation and which was then again ast generated for each statement and argument when translating the isl ast to LLVM-IR. This approach was difficult to understand and the additional ast generation calls where entirely redundant as isl provides the relevant expressions as arguments of the generated user statements. llvm-svn: 212186
OpenPOWER on IntegriCloud