summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/IslCodeGeneration.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [Refactor] Expose the runtime debug builderJohannes Doerfert2014-07-241-83/+0
| | | | llvm-svn: 213908
* [Fix] Typo during refactoringJohannes Doerfert2014-07-231-2/+2
| | | | llvm-svn: 213795
* [Refactor] IslAst and payload structJohannes Doerfert2014-07-231-22/+2
| | | | | | | | | | | + 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
* Update for RegionInfo changes.Matt Arsenault2014-07-191-3/+4
| | | | | | | 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-171-4/+6
| | | | | | | | | | | | 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
* Derive run-time conditions for delinearizationTobias Grosser2014-07-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-021-49/+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
* Use range-based for loopsTobias Grosser2014-06-041-3/+2
| | | | llvm-svn: 210170
* Fix formattingTobias Grosser2014-04-221-2/+2
| | | | llvm-svn: 206903
* IslCodeGeneration: Document the IslExprBuilderTobias Grosser2014-04-221-3/+86
| | | | llvm-svn: 206898
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-221-1/+2
| | | | | | | | | | definition below all of the header #include lines, Polly edition. If you want to know more details about this, you can see the recent commits to Debug.h in LLVM. This is just the Polly segment of a cleanup I'm doing globally for this macro. llvm-svn: 206852
* Emit llvm.loop metadata for parallel loopsTobias Grosser2014-03-041-5/+16
| | | | | | | For now we only mark innermost loops for the loop vectorizer. We could later also mark not-innermost loops to enable the introduction of openmp parallelism. llvm-svn: 202854
* Introduce PollyIRBuilderTobias Grosser2014-03-041-8/+8
| | | | | | | | PollyIRBuilder is currently just a typedef to IRBuilder<>. Consequently, this change should not affect behavior. In subsequent patches we will extend its functionality to emit loop.parallel metadata. llvm-svn: 202853
* Update to isl 1b3ba3b72c0482fd36bf0b4a1186a259f7bafeedTobias Grosser2014-01-261-0/+2
| | | | | | | | | | | | | | | This includes the following very useful isl commit: commit d962967ab42323ea5ca0398956fbff6a98c782fa Author: Sven Verdoolaege <skimo@kotnet.org> Date: Wed Dec 18 12:05:32 2013 +0100 allow the user to impose a bound on the number of low-level operations This should allow the user to deterministically limit the effort spent on a computation. llvm-svn: 200155
* Adapt to DomTree changes in r199104Tobias Grosser2014-01-131-4/+4
| | | | llvm-svn: 199157
* IslCodegen: Support for run-time conditionsTobias Grosser2013-11-171-0/+12
| | | | llvm-svn: 194948
* IslCodegen: Do not build upper bound in vector forTobias Grosser2013-11-021-6/+0
| | | | | | | | | | | For for-nodes that are translated to a set of vector lanes, we already know the overall number of iterations. Calculating the upper bound is consequently not necessary. This change removes the code for upper bound calculation, which was probably copy/pasted from the code generation for the normal for-loop. This issue was found by Sylvestre's scan-build server. llvm-svn: 193925
* Integrate latest clang-format changesTobias Grosser2013-06-231-1/+1
| | | | llvm-svn: 184655
* Use isl_val instead of isl_int in the core of PollyTobias Grosser2013-06-211-5/+3
| | | | | | | | | | | isl recently introduced isl_val as an abstract interface to represent arbitrary precision numbers. This interface superseeds the old isl_int interface. In contrast to the old interface which implemented arbitrary precision arithmetic using macros that forward to the gmp library, the new library hides the math library implementation in isl. This allows us to switch the math library used by isl without affecting users such as Polly. llvm-svn: 184529
* Update LoopInfo correctlyTobias Grosser2013-05-161-1/+7
| | | | | | | | | | When the Polly code generation was written we did not correctly update the LoopInfo data, but still claimed that the loop information is correct. This does not only lead to missed optimizations, but it can also cause miscompilations in case passes such as LoopSimplify are run after Polly. Reported-by: Sergei Larin <slarin@codeaurora.org> llvm-svn: 181987
* LoopGenerators: Construct loops such that they are already loop rotatedTobias Grosser2013-05-161-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | BeforeBB | v GuardBB / \ __ PreHeaderBB \ / \ / | latch HeaderBB | \ / \ / < \ / \ / ExitBB This does not only remove the need for an explicit loop rotate pass, but it also gives us the possibility to skip the construction of the guard condition in case the loop is known to be executed at least once. We do not yet exploit this, but by implementing this analysis in the isl code generator we should be able to remove more guards than the generic loop rotate pass can. Another point is that loop rotation can introduce additional PHI nodes, which may hide that a loop can be executed in parallel. This change avoids this complication and will make it easier to move the openmp code generation into a separate pass. llvm-svn: 181986
* Sort includesTobias Grosser2013-05-071-8/+6
| | | | llvm-svn: 181297
* Reformat with clang-formatTobias Grosser2013-05-071-21/+27
| | | | | | | clang-format become way more stable. This time we mainly reformat function signatures. llvm-svn: 181294
* Support SCoPs with multiple entry edges.Tobias Grosser2013-04-161-9/+3
| | | | | | | | | | | | | | | | | | | | | Regions that have multiple entry edges are very common. A simple if condition yields e.g. such a region: if / \ then else \ / for_region This for_region contains two entry edges 'then' -> 'for_region' and 'else' -> 'for_region'. Previously we scheduled the RegionSimplify pass to translate such regions into simple regions. With this patch, we now support them natively when the region is in -loop-simplify form, which means the entry block should not be a loop header. Contributed by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179586
* Update formatting to latest version of clang-formatTobias Grosser2013-04-101-4/+4
| | | | llvm-svn: 179160
* Support SCoPs with multiple exit edgesTobias Grosser2013-04-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | Regions that have multiple exit edges are very common. A simple if condition yields e.g. such a region: if / \ then else \ / after Region: if -> after This regions contains the bbs 'if', 'then', 'else', but not 'after'. It has two exit edges 'then' -> 'after' and 'else' -> 'after'. Previously we scheduled the RegionSimplify pass to translate such regions into simple regions. With this patch, we now support them natively. Contributed-by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179159
* clang-format: Many more filesTobias Grosser2013-03-231-2/+1
| | | | | | | | | | | | | After this commit, polly is clang-format clean. This can be tested with 'ninja polly-check-format'. Updates to clang-format may change this, but the differences will hopefully be both small and general improvements to the formatting. We currently have some not very nice formatting for a couple of items, DEBUG() stmts for example. I believe the benefit of being clang-format clean outweights the not perfect layout of this code. llvm-svn: 177796
* Remove dependence on canonical induction variableTobias Grosser2013-03-201-0/+1
| | | | | | | | When using the scev based code generation, we now do not rely on the presence of a canonical induction variable any more. This commit prepares the path to (conditionally) disable the induction variable canonicalization pass. llvm-svn: 177548
* Silence 'variable unused' warning in release modeTobias Grosser2013-03-201-0/+1
| | | | llvm-svn: 177515
* use the canonical IV only when it existsSebastian Pop2013-03-181-6/+8
| | | | llvm-svn: 177306
* CodeGen: clang-formatTobias Grosser2013-02-221-20/+18
| | | | llvm-svn: 175872
* add LoopToScev mapsSebastian Pop2013-02-151-11/+16
| | | | llvm-svn: 175295
* CodeGen: clang-format goodnessTobias Grosser2013-02-051-78/+73
| | | | | | The changed files are not yet clang-format clean, but we are getting close. llvm-svn: 174403
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-2/+2
| | | | | | reflect the migration in r171366. llvm-svn: 171370
* Formatting: Break lines after binary operators such as '&&'Tobias Grosser2012-12-291-26/+26
| | | | | | | | | | | | | | assert(Condition && "Text"); -> assert(Condition && "Text); This aligns Polly with the style used in LLVM. llvm-svn: 171242
* Fix obvious formatting problems.Tobias Grosser2012-12-291-13/+10
| | | | | | | | | | | | | | | | | | | | | | We fix the following formatting problems found by clang-format: - 80 cols violations - Obvious problems with missing or too many spaces - multiple new lines in a row clang-format suggests many more changes, most of them falling in the following two categories: 1) clang-format does not at all format a piece of code nicely 2) The style that clang-format suggests does not match the style used in Polly/LLVM I consider differences caused by reason 1) bugs, which should be fixed by improving clang-format. Differences due to 2) need to be investigated closer to understand the cause of the difference and the solution that should be taken. llvm-svn: 171241
* return -1 when polly::getNumberOfIterations returns -1Sebastian Pop2012-12-181-1/+4
| | | | llvm-svn: 170422
* isl: vector code generation based on ISL astSebastian Pop2012-12-181-15/+199
| | | | | | Original patch by Tobias Grosser, slightly modified by Sebastian Pop. llvm-svn: 170420
* autoconf/cmake: Always require isl code generation.Tobias Grosser2012-10-211-4/+0
| | | | | | | | 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
* isl-codegen: Support '<' and '>'Tobias Grosser2012-10-161-6/+27
| | | | | | | | 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
* Move TargetData to DataLayout to fix build breakage caused by LLVM r16540Micah Villmow2012-10-081-1/+1
| | | | llvm-svn: 165408
* Add a new isl based code generationTobias Grosser2012-10-021-0/+859
| | | | | | | | | 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
* add a check for ISL codegen at configure timeSebastian Pop2012-05-071-0/+21
llvm-svn: 156305
OpenPOWER on IntegriCloud