summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fix gcc compile failureTobias Grosser2016-07-111-1/+1
| | | | | | | | | Commit r275056 introduced a gcc compile failure due to us using two types named 'Type', the first being the newly introduced member variable 'Type' the second being llvm::Type. We resolve this issue by renaming the newly introduced member variable to AccessType. llvm-svn: 275057
* InvariantEquivClassTy: Use struct instead of 4-tuple to increase readabilityTobias Grosser2016-07-111-5/+5
| | | | | | | | | | | | | | Summary: With a struct we can use named accessors instead of generic std::get<3>() calls. This increases readability of the source code. Reviewers: jdoerfert Subscribers: pollydev, llvm-commits Differential Revision: http://reviews.llvm.org/D21955 llvm-svn: 275056
* Update for llvm r274769Justin Bogner2016-07-071-6/+6
| | | | llvm-svn: 274777
* isl: isl-0.17.1-164-gcbba1b6Tobias Grosser2016-07-061-1/+1
| | | | | | | | | | | This is a regular maintenance update to ensure the latest version of isl is tested. Interesting Changes: - AST nodes and expressions are now printed as YAML llvm-svn: 274614
* Try to fix polly buildbots.George Burgess IV2016-07-061-1/+0
| | | | | | Broken by r274589. llvm-svn: 274595
* CodegenCleanup: Drop CFLAA pass from codegen cleanup sequenceTobias Grosser2016-07-021-1/+0
| | | | | | | | | | | | Since r274197 -polly-position=before-vectorizer caused various LNT failures for example in SingleSource/Benchmarks/Linpack. These failures seem to only occur when the CFLAA pass is scheduled in our codegen-cleanup passes, which suggests that the way we call this AA pass is somehow problematic. As this pass is not of high importance, we drop the pass for now to prevent these failures from happening. At a later point, we might investigate more in-depth why this specific usage scenario caused correctness issues. llvm-svn: 274427
* clang-tidy: Add llvm namespace commentsTobias Grosser2016-06-233-3/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing copyright headerTobias Grosser2016-06-221-0/+9
| | | | | | | 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: 273436
* clang-tidy: apply modern-use-nullptr fixesTobias Grosser2016-06-221-3/+3
| | | | | | | | | | Instead of using 0 or NULL use the C++11 nullptr symbol when referencing null pointers. 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: 273435
* Replace ScalarReplAggregatesPass by SROAPass.Michael Kruse2016-06-151-1/+1
| | | | | | | | ScalarReplAggregatesPass was deprecated and replaced by SROAPass. ScalarReplAggregatesPass got finally removed in LLVM commit r272737, hence this patch is also a compile fix. llvm-svn: 272783
* Recommit: "Simplify min/max expression generation"Tobias Grosser2016-06-121-21/+16
| | | | | | | | | | | | | | As part of this simplification we pull complex logic out of the loop body and skip the previously redundantly executed first loop iteration. This is a partial recommit of r271514 and r271535 which where in conflict with the revert in r272483 and consequently also had to be reverted temporarily. The original patch was contributed by Johannes Doerfert. This patch is mostly a NFC, but dropping the first loop iteration can sometimes result in slightly simpler code. llvm-svn: 272502
* This reverts recent expression type changesTobias Grosser2016-06-115-167/+213
| | | | | | | | | | | | | | | | | | | | | 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
* Refactor division generation codeJohannes Doerfert2016-06-061-26/+46
| | | | | | | | | This patch refactors the code generation for divisions. This allows to always generate a shift for a power-of-two division and to utilize information about constant divisors in order to truncate the result type. llvm-svn: 271898
* [NFC] Generate runtime checks after the SCoPJohannes Doerfert2016-06-062-18/+10
| | | | | | | | | We now generate runtime checks __after__ the SCoP code generation and not before, though they are still inserted at the same position int the code. This allows to modify the runtime check during SCoP code generation. llvm-svn: 271894
* [NFC] Simplify codeJohannes Doerfert2016-06-061-2/+2
| | | | llvm-svn: 271889
* Use minimal types for generated expressionsJohannes Doerfert2016-06-062-39/+64
| | | | | | | | | | | | We now use the minimal necessary bit width for the generated code. If operations might overflow (add/sub/mul) we will try to adjust the types in order to ensure a non-wrapping computation. If the type adjustment is not possible, thus the necessary type is bigger than the type value of --polly-max-expr-bit-width, we will use assumptions to verify the computation will not wrap. However, for run-time checks we cannot build assumptions but instead utilize overflow tracking intrinsics. llvm-svn: 271878
* Fix modulo compared to zero.Michael Kruse2016-06-031-1/+1
| | | | | | | | | | | | | | | | In case of modulo compared to zero, we need to do signed modulo operation as unsigned can give different results based on whether the dividend is negative or not. This addresses llvm.org/PR27707 Contributed-by: Chris Jenneisch <chrisj@codeaurora.org> Reviewers: _jdoerfert, grosser, Meinersbur Differential Revision: http://reviews.llvm.org/D20145 llvm-svn: 271707
* Temporarily promote values to i64 againJohannes Doerfert2016-06-021-1/+4
| | | | | | | Operands of binary operations that might overflow will be temporarily promoted to i64 again, though that is not a sound solution for the problem. llvm-svn: 271538
* [NFC] Avoid unnecessary comparison for min/max expressionsJohannes Doerfert2016-06-021-1/+1
| | | | llvm-svn: 271535
* [Polly] Fix -Wunused-variable warnings (NFC)Matthew Simpson2016-06-021-2/+0
| | | | llvm-svn: 271518
* [NFC] Simplify min/max expression generationJohannes Doerfert2016-06-021-22/+8
| | | | llvm-svn: 271514
* Simplify the type adjustment in the IslExprBuilderJohannes Doerfert2016-06-023-113/+43
| | | | | | | | | We now have a simple function to adjust/unify the types of two (or three) operands before an operation that requieres the same type for all operands. Due to this change we will not promote parameters that are added to i64 anymore if that is not needed. llvm-svn: 271513
* [FIX] Ensure wrapping checks for unary expressionsJohannes Doerfert2016-06-021-1/+1
| | | | llvm-svn: 271512
* Decouple SCoP building logic from passJohannes Doerfert2016-05-312-4/+4
| | | | | | | | | | | | | | | | 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
* [Polly] Remove usage of the `apply` functionSanjoy Das2016-05-291-1/+1
| | | | | | | | | | | | | | | Summary: API-wise `apply` is a somewhat unidiomatic one-off function, and removing the only(?) use in polly will let me remove it from SCEV's exposed interface. Reviewers: jdoerfert, Meinersbur, grosser Subscribers: grosser, mcrosier, pollydev Differential Revision: http://reviews.llvm.org/D20779 llvm-svn: 271177
* Remove some unused local variables. NFC.Michael Kruse2016-05-231-13/+0
| | | | | | | Found by clang static analyzer (http://llvm.org/reports/scan-build/) and Visual Studio. llvm-svn: 270432
* Use the SCoP directly for canSynthesize [NFC]Johannes Doerfert2016-05-232-4/+4
| | | | llvm-svn: 270429
* Duplicate part of the Region interface in the Scop class [NFC]Johannes Doerfert2016-05-234-24/+20
| | | | | | | This allows to use the SCoP directly for various queries, thus to hide the underlying region more often. llvm-svn: 270426
* Add and use Scop::contains(Loop/BasicBlock/Instruction) [NFC]Johannes Doerfert2016-05-232-13/+10
| | | | llvm-svn: 270424
* Directly access information through the Scop class [NFC]Johannes Doerfert2016-05-233-6/+4
| | | | llvm-svn: 270421
* Simplify BlockGenerator::handleOutsideUsers interface [NFC]Johannes Doerfert2016-05-231-4/+4
| | | | llvm-svn: 270411
* [FIX] Let ScalarEvolution forget hoisted valuesJohannes Doerfert2016-05-231-0/+5
| | | | | | | We have to rethink the handling of escaping values in order to make this kind of "fixes" go away. llvm-svn: 270409
* Check overflows in RTCs and bail accordinglyJohannes Doerfert2016-05-123-10/+139
| | | | | | | | | | | | | | | We utilize assumptions on the input to model IR in polyhedral world. To verify these assumptions we version the code and guard it with a runtime-check (RTC). However, since the RTCs are themselves generated from the polyhedral representation we generate them under the same assumptions that they should verify. In other words, the guarantees that we try to provide with the RTCs do not hold for the RTCs themselves. To this end it is necessary to employ a different check for the RTCs that will verify the assumptions did hold for them too. Differential Revision: http://reviews.llvm.org/D20165 llvm-svn: 269299
* Simplify access relation for invariant loads early [NFC]Johannes Doerfert2016-05-101-1/+2
| | | | llvm-svn: 269046
* Prevent complex access ranges with low number of pieces.Johannes Doerfert2016-05-101-3/+15
| | | | | | | | | | | Previously we checked the number of pieces to decide whether or not a invariant load was to complex to be generated. However, there are cases when e.g., divisions cause the complexity to spike regardless of the number of pieces. To this end we now check the number of totally involved dimensions which will increase with the number of pieces but also the number of divisions. llvm-svn: 269045
* Codegen: Enable the detection of min/max expressionsTobias Grosser2016-05-071-0/+1
| | | | | | | | | Min/max expressions are easier to read and can in some cases also result in more concise IR that is generated as the min/max --- when lowered to a cmp+select pattern -- commonly has a simpler condition then the ternary condition isl would normally generate. llvm-svn: 268855
* 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
* BlockGenerator: Drop leftover debug statementTobias Grosser2016-04-281-1/+0
| | | | llvm-svn: 267874
* [FIX] Propagate execution domain of invariant loadsJohannes Doerfert2016-04-271-7/+15
| | | | | | | | | | | If the base pointer of an invariant load is is loaded conditionally, that condition needs to hold for the invariant load too. The structure of the program will imply this for domain constraints but not for imprecisions in the modeling. To this end we will propagate the execution context of base pointers during code generation and thus ensure the derived pointer does not access an invalid base pointer. llvm-svn: 267707
* Check only loop control of loops that are part of the regionJohannes Doerfert2016-04-251-3/+0
| | | | | | | This also removes a duplicated line of code in the region generator that caused a SPEC benchmark to fail with the new SCoPs. llvm-svn: 267404
* Allow pointer expressions in SCEVs again.Johannes Doerfert2016-04-101-83/+33
| | | | | | | | | In r247147 we disabled pointer expressions because the IslExprBuilder did not fully support them. This patch reintroduces them by simply treating them as integers. The only special handling for pointers that is left detects the comparison of two address_of operands and uses an unsigned compare. llvm-svn: 265894
* Add __isl_give annotations to return types [NFC]Johannes Doerfert2016-04-091-2/+3
| | | | llvm-svn: 265882
* Collect and verify generated parallel subfunctionsJohannes Doerfert2016-04-082-0/+5
| | | | | | | | We verify the optimized function now for a long time and it helped to track down bugs early. This will now also happen for all parallel subfunctions we generate. llvm-svn: 265823
* [FIX] Look through div & srem instructions in SCEVsJohannes Doerfert2016-04-081-2/+2
| | | | | | | | | The findValues() function did not look through div & srem instructions that were part of the argument SCEV. However, in different other places we already look through it. This mismatch caused us to preload values in the wrong order. llvm-svn: 265775
* [FIX] Adjust the insert point for non-affine region PHIsJohannes Doerfert2016-04-011-4/+7
| | | | | | | | | | If a non-affine region PHI is generated we should not move the insert point prior to the synthezised value in the same block as we might split that block at the insert point later on. Only if the incoming value should be placed in a different block we should change the insertion point. llvm-svn: 265132
* CodegenCleanup: Drop -load-combine passTobias Grosser2016-03-251-1/+0
| | | | | | | | | | | | | | | This pass is not enabled in the default tool chain and currently can run into an infinite loop, due to other parts of LLVM generating incorrect IR (http://llvm.org/PR27065) -- which is not executed and consequently does not seem to disturb other passes. As this pass is not really needed, we can just drop it to get our build clean. This fixes the timeout issues in MultiSource/Benchmarks/MiBench/consumer-jpeg and MultiSource/Benchmarks/mediabench/jpeg/jpeg-6a/cjpeg for -polly-position=before-vectorizer -polly-process-unprofitable.. Unfortunately, we are still left with a miscompile in cjpeg. llvm-svn: 264396
* Add namespace for struct [NFC]Johannes Doerfert2016-03-241-10/+12
| | | | | | This will clean up the doxygen documentation. llvm-svn: 264272
* Codegen:Do not invalidate dominator tree when bailing out during code generationTobias Grosser2016-03-231-6/+28
| | | | | | | | | When codegenerating invariant loads in some rare cases we cannot generate code and bail out. This change ensures that we maintain a valid dominator tree in these situations. This fixes llvm.org/PR26736 Contributed-by: Matthias Reisinger <d412vv1n@gmail.com> llvm-svn: 264142
* [BlockGenerator] Fix PHI merges for MK_Arrays.Michael Kruse2016-03-031-0/+10
| | | | | | | | | | | | | | | | | | Value merging is only necessary for scalars when they are used outside of the scop. While an array's base pointer can be used after the scop, it gets an extra ScopArrayInfo of type MK_Value. We used to generate phi's for both of them, where one was assuming the reault of the other phi would be the original value, because it has already been replaced by the previous phi. This resulted in IR that the current IR verifier allows, but is probably illegal. This reduces the number of LNT test-suite fails with -polly-position=before-vectorizer -polly-process-unprofitable from 16 to 10. Also see llvm.org/PR26718. llvm-svn: 262629
* Allow the client of DependenceInfo to obtain dependences at different ↵Hongbin Zheng2016-03-031-1/+2
| | | | | | granularities. llvm-svn: 262591
OpenPOWER on IntegriCloud