summaryrefslogtreecommitdiffstats
path: root/polly/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
...
* [Support] Add (Nonowning-)IslPtr::dump(). NFC.Michael Kruse2016-09-301-0/+22
| | | | | | | | | | | | The dump() methods can be called from a debugger instead of e.g. isl_*_dump(Var.Obj) where Var is a variable of type IslPtr/NonowningIslPtr. To ensure that the existence of the function pointers do not depdend on whether the methods are used somwhere, they are declared with external linkage. llvm-svn: 282870
* Update CFGPrinter -> CFGPrinterLegacyPassTobias Grosser2016-09-161-1/+1
| | | | | | .. to match recent changes in LLVM that broke the Polly compilation. llvm-svn: 281705
* Add -polly-flatten-schedule pass.Michael Kruse2016-09-082-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | The -polly-flatten-schedule pass reduces the number of scattering dimensions in its isl_union_map form to make them easier to understand. It is not meant to be used in production, only for debugging and regression tests. To illustrate, how it can make sets simpler, here is a lifetime set used computed by the porposed DeLICM pass without flattening: { Stmt_reduction_for[0, 4] -> [0, 2, o2, o3] : o2 < 0; Stmt_reduction_for[0, 4] -> [0, 1, o2, o3] : o2 >= 5; Stmt_reduction_for[0, 4] -> [0, 1, 4, o3] : o3 > 0; Stmt_reduction_for[0, i1] -> [0, 1, i1, 1] : 0 <= i1 <= 3; Stmt_reduction_for[0, 4] -> [0, 2, 0, o3] : o3 <= 0 } And here the same lifetime for a semantically identical one-dimensional schedule: { Stmt_reduction_for[0, i1] -> [2 + 3i1] : 0 <= i1 <= 4 } Differential Revision: https://reviews.llvm.org/D24310 llvm-svn: 280948
* GICHelper: Correctly assign return valueTobias Grosser2016-09-081-1/+1
| | | | | | | | | | ... to preserve reference counting logic. In practice the missing assignment would not have caused any issues. We still fix it as the code is wrong and it also causes noise in the clang static analysis runs. llvm-svn: 280946
* SCEVAffinator: Add missing __isl_take annotationsTobias Grosser2016-09-081-1/+2
| | | | llvm-svn: 280943
* Introduce option to run isl AST generation, but no IR generation.Tobias Grosser2016-09-021-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | We replace the options -polly-code-generator=none =isl with the options -polly-code-generation=none =ast =full This allows us to measure the overhead of Polly itself, versus the compile time increases due to us generating more IR and consequently the LLVM backends spending more time on this IR. We also use this opportunity to rename the option. The original name was introduced at a point where we still had two code generators. CLooG and the isl AST generator. Since we only have one AST generator left, there is no need to distinguish between 'isl' and something else. However, being able to disable code generation all together has been shown useful for debugging. Hence, we rename and extend this option to make it a good fit for its new use case. llvm-svn: 280554
* Drop '@brief' from doxygen commentsTobias Grosser2016-09-023-27/+27
| | | | | | | | LLVM's coding guideline suggests to not use @brief for one-sentence doxygen comments to improve readability. Switch this once and for all to ensure people do not copy @brief comments from other parts of Polly, when writing new code. llvm-svn: 280468
* Improve documentation and testing for isl_valFromAPIntTobias Grosser2016-08-261-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The recent unit tests we gained made clear that the semantics of isl_valFromAPInt are not clear, due to missing documentation. In this change we document both the calling interface as well as the implementation of isl_valFromAPInt. We also make the implementation easier to read by removing integer wrappig in abs() when passing in the minimal integer value for a given bitwidth. Even though wrapping and subsequently interpreting the result as unsigned value gives the correct result, this is far from obvious. Instead, we explicitly add one more bit to the input type to ensure that abs will never wrap. This change did not uncover a bug in the old implementation, but was introduced to increase readability. We update the tests to add a test case for this special case and use this opportunity to also test a number larger than 64 bit. Finally, we order the arguments of the test cases to make sure the expected output is first. This helps readability in case of failing test cases as gtest assumes the first value to be the exected value. Reviewed-by: Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D23917 llvm-svn: 279815
* Improve documentation and testing of APIntFromValTobias Grosser2016-08-261-4/+17
| | | | | | | | | | | | | | The recent unit tests we gained made clear that the semantics of APIntFromVal are not clear, due to missing documentation. In this change we document both the calling interface as well as the implementation of APIntFromVal. We also make the implementation easier to read by removing the use of magic numbers. Finally, we add tests to check the bitwidth of the created values as well as the correct modeling of very large numbers. Reviewed-by: Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D23910 llvm-svn: 279813
* [SCEVValidator] Don't reorder multiplies in extractConstantFactor.Eli Friedman2016-08-181-5/+4
| | | | | | | | | | | The existing code would add the operands in the wrong order, and eventually crash because the SCEV expression doesn't exactly match the parameter SCEV expression in SCEVAffinator::visit. (SCEV doesn't sort the operands to getMulExpr in general.) Differential Revision: https://reviews.llvm.org/D23592 llvm-svn: 279087
* [ScopDetect] Do not assert in case of AddRecs with non-constant start expressionTobias Grosser2016-08-151-2/+1
| | | | llvm-svn: 278738
* [GSoC] Add PolyhedralInfo pass - new interface to polly analysisJohannes Doerfert2016-07-251-0/+9
| | | | | | | | | | | | | Adding a new pass PolyhedralInfo. This pass will be the interface to Polly. Initially, we will provide the following interface: - #IsParallel(Loop *L) - return a bool depending on whether the loop is parallel or not for the given program order. Patch by Utpal Bora <cs14mtech11017@iith.ac.in> Differential Revision: https://reviews.llvm.org/D21486 llvm-svn: 276637
* GPGPU: Disable invariant load hoisting for GPU code generationTobias Grosser2016-07-191-0/+5
| | | | | | | | This simplifies the upcoming patches to add code generation for ScopStmts. Load hoisting support will later be added in a separate commit. This commit will be implicitly tested by the subsequent GPGPU changes. llvm-svn: 275969
* PPCGCodegen: Support compilation without GPU supportTobias Grosser2016-07-131-0/+7
| | | | llvm-svn: 275310
* Add accelerator code generation pass skeletonTobias Grosser2016-07-131-13/+30
| | | | | | | | | | | | | | | | | | | | | | | Add a new pass to serve as basis for automatic accelerator mapping in Polly. The pass structure and the analyses preserved are copied from CodeGeneration.cpp, as we will rely on IslNodeBuilder and IslExprBuilder for LLVM-IR code generation. Polly's accelerator code generation is enabled with -polly-target=gpu I would like to use this commit as opportunity to thank Yabin Hu for his work in the context of two Google summer of code projects during which he implemented initial prototypes of the Polly accelerator code generation -- in parts this code is already available in todays Polly (e.g., tools/GPURuntime). More will come as part of the upcoming Polly ACC changes. Reviewers: Meinersbur Subscribers: pollydev, llvm-commits Differential Revision: http://reviews.llvm.org/D22036 llvm-svn: 275275
* [SCEVAffinator] Fix assertion checking for constant divisor.Michael Kruse2016-07-121-1/+1
| | | | | | | | | | | An assertion in visitSDivInstruction() checked whether the divisor is constant by checking whether the argument is a ConstantInt. However, SCEVValidator allows the divisor to be simplified to a constant by ScalarEvolution. We synchronize the implementation of SCEVValidator and SCEVAffinator to both accept simplified SCEV expressions. llvm-svn: 275174
* Fix assertion due to buildMemoryAccess.Michael Kruse2016-07-081-2/+3
| | | | | | | | | | | | | For llvm the memory accesses from nonaffine loops should be visible, however for polly those nonaffine loops should be invisible/boxed. This fixes llvm.org/PR28245 Cointributed-by: Huihui Zhang <huihuiz@codeaurora.org> Differential Revision: http://reviews.llvm.org/D21591 llvm-svn: 274842
* Move getIndexExpressionsFromGEP() to ScopHelper. NFC.Michael Kruse2016-06-281-0/+49
| | | | | | | | This function is used by both ScopInfo and ScopBuilder. A common location for this function is required when ScopInfo and ScopBuilder are separated into separate files in the next commit. llvm-svn: 273981
* [GSoC 2016] New function pass DependenceInfoWrapperPassJohannes Doerfert2016-06-271-0/+1
| | | | | | | | | | | | | | This patch addresses: - A new function pass to compute polyhedral dependences. This is required to avoid the region pass manager. - Stores a map of Scop to Dependence object for all the scops present in a function. By default, access wise dependences are stored. Patch by Utpal Bora <cs14mtech11017@iith.ac.in> Differential Revision: http://reviews.llvm.org/D21105 llvm-svn: 273881
* [GSoC 2016]New function pass ScopInfoWrapperPassJohannes Doerfert2016-06-271-0/+1
| | | | | | | | | | | | This patch adds a new function pass ScopInfoWrapperPass so that the polyhedral description of a region, the SCoP, can be constructed and used in a function pass. Patch by Utpal Bora <cs14mtech11017@iith.ac.in> Differential Revision: http://reviews.llvm.org/D20962 llvm-svn: 273856
* clang-tidy: Add llvm namespace commentsTobias Grosser2016-06-233-4/+4
| | | | | | | | | | | | | | | | | | | | | | | llvm commonly adds a comment to the closing brace of a namespace to indicate which namespace is closed. clang-tidy provides with llvm-namespace-comment a handy tool to check for this habit. We use it to ensure we consitently use namespace comments in Polly. There are slightly different styles in how namespaces are closed in LLVM. As there is no large difference between the different comment styles we go for the style clang-tidy suggests by default. To reproduce this fix run: for i in `ls tools/polly/lib/*/*.cpp`; \ clang-tidy -checks='-*,llvm-namespace-comment' -p build $i -fix \ -header-filter=".*"; \ done This cleanup was suggested by Eugene Zelenko <eugene.zelenko@gmail.com> in http://reviews.llvm.org/D21488 and was split out to increase readability. llvm-svn: 273621
* Recommit: "[FIX] Determine insertion point during SCEV expansion"Tobias Grosser2016-06-111-5/+13
| | | | | | | This patch was originally contributed by Johannes Doerfert in r271892, but was in conflict with the revert in r272483. llvm-svn: 272486
* Recommit: "Look through IntToPtr & PtrToInt instructions"Tobias Grosser2016-06-113-6/+31
| | | | | | | | | | | | | IntToPtr and PtrToInt instructions are basically no-ops that we can handle as such. In order to generate them properly as parameters we had to improve the ScopExpander, though the change is the first in the direction of a more aggressive scalar synthetization. This patch was originally contributed by Johannes Doerfert in r271888, but was in conflict with the revert in r272483. This is a recommit with some minor adjustment to the test cases to take care of differing instruction names. llvm-svn: 272485
* This reverts recent expression type changesTobias Grosser2016-06-113-42/+9
| | | | | | | | | | | | | | | | | | | | | The recent expression type changes still need more discussion, which will happen on phabricator or on the mailing list. The precise list of commits reverted are: - "Refactor division generation code" - "[NFC] Generate runtime checks after the SCoP" - "[FIX] Determine insertion point during SCEV expansion" - "Look through IntToPtr & PtrToInt instructions" - "Use minimal types for generated expressions" - "Temporarily promote values to i64 again" - "[NFC] Avoid unnecessary comparison for min/max expressions" - "[Polly] Fix -Wunused-variable warnings (NFC)" - "[NFC] Simplify min/max expression generation" - "Simplify the type adjustment in the IslExprBuilder" Some of them are just reverted as we would otherwise get conflicts. I will try to re-commit them if possible. llvm-svn: 272483
* [FIX] Model the rounding behaviour of SRem correctlyJohannes Doerfert2016-06-071-8/+8
| | | | llvm-svn: 272001
* [FIX] Determine insertion point during SCEV expansionJohannes Doerfert2016-06-061-5/+13
| | | | llvm-svn: 271892
* Look through IntToPtr & PtrToInt instructionsJohannes Doerfert2016-06-063-6/+31
| | | | | | | | | IntToPtr and PtrToInt instructions are basically no-ops that we can handle as such. In order to generate them properly as parameters we had to improve the ScopExpander, though the change is the first in the direction of a more aggressive scalar synthetization. llvm-svn: 271888
* [NFC] Simplify codeJohannes Doerfert2016-06-061-1/+1
| | | | llvm-svn: 271886
* [FIX] Do not recognize division by 0 as affineJohannes Doerfert2016-06-061-2/+2
| | | | llvm-svn: 271885
* Replace getSCEV with getSCEVAtScopeJohannes Doerfert2016-06-061-4/+7
| | | | llvm-svn: 271881
* [NFC] Use the ScalarEvolution member of the SCEVAffinatorJohannes Doerfert2016-06-061-7/+4
| | | | llvm-svn: 271880
* [NFC] Coalesce invariant context sets earlyJohannes Doerfert2016-06-061-0/+2
| | | | llvm-svn: 271879
* [FIX] Correctly translate i1 expressionsJohannes Doerfert2016-06-021-1/+2
| | | | llvm-svn: 271534
* Decouple SCoP building logic from passJohannes Doerfert2016-05-311-2/+2
| | | | | | | | | | | | | | | | Created a new pass ScopInfoRegionPass. As name suggests, it is a region pass and it is there to preserve compatibility with our existing Polly passes. ScopInfoRegionPass will return a SCoP object for a valid region while the creation of the SCoP stays in the ScopInfo class. Contributed-by: Utpal Bora <cs14mtech11017@iith.ac.in> Reviewed-by: Tobias Grosser <tobias@grosser.es>, Johannes Doerfert <doerfert@cs.uni-saarland.de> Differential Revision: http://reviews.llvm.org/D20770 llvm-svn: 271259
* Use the SCoP directly for canSynthesize [NFC]Johannes Doerfert2016-05-231-3/+4
| | | | llvm-svn: 270429
* Add and use Scop::contains(Loop/BasicBlock/Instruction) [NFC]Johannes Doerfert2016-05-231-1/+1
| | | | llvm-svn: 270424
* Directly access information through the Scop class [NFC]Johannes Doerfert2016-05-231-3/+3
| | | | llvm-svn: 270421
* [FIX] Synthezise Sdiv/Srem/Udiv instructions correctly.Johannes Doerfert2016-05-231-22/+10
| | | | | | | This patch simplifies the Sdiv/Srem/Udiv expansion and thereby prevents errors, e.g., regarding the insertion point. llvm-svn: 270408
* Bring some comments up to date [NFC]Johannes Doerfert2016-05-121-8/+2
| | | | llvm-svn: 269301
* Support truncate operationsJohannes Doerfert2016-05-122-20/+37
| | | | | | | | | Truncate operations are basically modulo operations, thus we can model them that way. However, for large types we assume the operand to fit in the new type size instead of introducing a modulo with a very large constant. llvm-svn: 269300
* Handle llvm.assume inside the SCoPJohannes Doerfert2016-05-101-15/+14
| | | | | | | | | | The assumption attached to an llvm.assume in the SCoP needs to be combined with the domain of the surrounding statement but can nevertheless be used to refine the context. This fixes the problems mentioned in PR27067. llvm-svn: 269060
* Expose interpretAsUnsigned in the SCEVAffinator [NFC]Johannes Doerfert2016-05-101-6/+11
| | | | | | | | This exposes the functionality to interpret a SCEV, or better the piece-wise function created from the SCEV, as an unsigned value instead of a signed one. llvm-svn: 269044
* Rename Conjuncts -> Disjunctions. NFC.Michael Kruse2016-05-021-2/+2
| | | | | | | | The check for complexity compares the number of polyhedra in a set, which are combined by disjunctions (union, "OR"), not conjunctions (intersection, "AND"). llvm-svn: 268223
* Typo: isToComplex -> isTooComplex. NFC.Michael Kruse2016-05-021-5/+5
| | | | llvm-svn: 268220
* Allow unsigned divisionsJohannes Doerfert2016-04-292-27/+72
| | | | | | | | | | | | | After zero-extend operations and unsigned comparisons we now allow unsigned divisions. The handling is basically the same as for signed division, except the interpretation of the operands. As the divisor has to be constant in both cases we can simply interpret it as an unsigned value without additional complexity in the representation. For the dividend we could choose from the different representation schemes introduced for zero-extend operations but for now we will simply use an assumption. llvm-svn: 268032
* Refactor SCEVAffinator [NFC]Johannes Doerfert2016-04-291-14/+12
| | | | llvm-svn: 268031
* [FIX] Unsigned comparisons change invalid domainJohannes Doerfert2016-04-291-8/+10
| | | | | | | | | It does not suffice to take a global assumptions for unsigned comparisons but we also need to adjust the invalid domain of the statements guarded by such an assumption. To this end we allow to specialize the getPwAff call now in order to indicate unsigned interpretation. llvm-svn: 268025
* [FIX] Prevent division/modulo by zero in parametersJohannes Doerfert2016-04-291-2/+20
| | | | | | | | | | | | When we materialize parameter SCEVs we did so without considering the side effects they might have, e.g., both division and modulo are undefined if the right hand side is zero. This is a problem because we potentially extended the domain under which we evaluate parameters, thus we might have introduced such undefined behaviour. To prevent that from happening we will now guard divisions and modulo operations in the parameters with a compare and select. llvm-svn: 268023
* [FIX] Adjust assumption space for zext instructionsJohannes Doerfert2016-04-261-1/+2
| | | | llvm-svn: 267552
* Do not add but record signed-unsigned assumptionsJohannes Doerfert2016-04-261-1/+1
| | | | llvm-svn: 267528
OpenPOWER on IntegriCloud