summaryrefslogtreecommitdiffstats
path: root/polly/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Recommit: "Look through IntToPtr & PtrToInt instructions"Tobias Grosser2016-06-114-3/+179
| | | | | | | | | | | | | 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-1153-518/+279
| | | | | | | | | | | | | | | | | | | | | 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-072-4/+107
| | | | llvm-svn: 272001
* Refactor division generation codeJohannes Doerfert2016-06-062-11/+20
| | | | | | | | | 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-065-29/+29
| | | | | | | | | 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
* [FIX] Determine insertion point during SCEV expansionJohannes Doerfert2016-06-061-0/+43
| | | | llvm-svn: 271892
* Look through IntToPtr & PtrToInt instructionsJohannes Doerfert2016-06-064-3/+179
| | | | | | | | | 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
* [FIX] Do not recognize division by 0 as affineJohannes Doerfert2016-06-061-0/+36
| | | | llvm-svn: 271885
* Use minimal types for generated expressionsJohannes Doerfert2016-06-0646-255/+266
| | | | | | | | | | | | 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-0/+48
| | | | | | | | | | | | | | | | 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-022-45/+51
| | | | | | | 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
* [Polly] Fix test case after rL271151Sanjoy Das2016-06-021-25/+28
| | | | | | | | | | | | | | | | | | | | | | Summary: After rL271151 (SCEV change) SCEV no longer unconditionally transfers nuw/nsw from the increment operation to the post-inc value; this transfer only happens if there is undefined behavior in the program if the increment overflowed (as opposed to just generating poison). The loops in `wraping_signed_expr_1.ll` are in non-canonical form (they're not rotated), and that defeats LLVM's poison-is-UB analysis. IMO the easiest fix here is to run `wraping_signed_expr_1.ll` through `-loop-rotate` to canonicalize the loops, which is what this patch does. Reviewers: jdoerfert, Meinersbur, grosser Subscribers: grosser, mcrosier, pollydev Differential Revision: http://reviews.llvm.org/D20778 llvm-svn: 271536
* [FIX] Correctly translate i1 expressionsJohannes Doerfert2016-06-023-6/+53
| | | | llvm-svn: 271534
* [FIX] Test case broken by r271522.Johannes Doerfert2016-06-021-6/+3
| | | | llvm-svn: 271531
* Simplify the type adjustment in the IslExprBuilderJohannes Doerfert2016-06-022-51/+45
| | | | | | | | | 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
* [GSoC 2016] [Polly] [FIX] Determination of statements that contain matrixRoman Gareev2016-05-312-0/+28
| | | | | | | | | | multiplication Fix small issues related to characters, operators and descriptions of tests. Differential Revision: http://reviews.llvm.org/D20806 llvm-svn: 271264
* Temporarily xfail test case which broke after a fix in SCEVTobias Grosser2016-05-291-0/+5
| | | | | | | This should keep the buildbots quite while we decide how to update the test case. llvm-svn: 271169
* Determination of statements that contain matrix multiplicationRoman Gareev2016-05-282-0/+128
| | | | | | | | | | | | | | | | | Add determination of statements that contain, in particular, matrix multiplications and can be optimized with [1] to try to get close-to-peak performance. It can be enabled via polly-pm-based-opts, which is false by default. Refs: [1] - http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf Contributed-by: Roman Gareev <gareevroman@gmail.com> Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: http://reviews.llvm.org/D20575 llvm-svn: 271128
* Optimistic assume required invariant loads to be invariantJohannes Doerfert2016-05-235-7/+224
| | | | | | | | | Before this patch we bailed if a required invariant load was potentially overwritten. However, now we will optimistically assume it is actually invariant and, to this end, restrict the valid parameter space as well as the execution context with regards to potential overwrites of the location. llvm-svn: 270416
* [FIX] Require base pointers of loads that might alias to be hoistedJohannes Doerfert2016-05-231-0/+48
| | | | | | | | | | | Since the base pointer of a possibly aliasing pointer might not alias with any other pointer it (the base pointer) might not be tagged as "required invariant". However, we need it do be in order to compare the accessed addresses of the derived (possibly aliasing) pointer. This patch also tries to clean up the load hoisting a little bit. llvm-svn: 270412
* [FIX] Let ScalarEvolution forget hoisted valuesJohannes Doerfert2016-05-231-0/+59
| | | | | | | We have to rethink the handling of escaping values in order to make this kind of "fixes" go away. llvm-svn: 270409
* [FIX] Synthezise Sdiv/Srem/Udiv instructions correctly.Johannes Doerfert2016-05-232-9/+67
| | | | | | | This patch simplifies the Sdiv/Srem/Udiv expansion and thereby prevents errors, e.g., regarding the insertion point. llvm-svn: 270408
* Revert "Optimistic assume required invariant loads to be invariant"Johannes Doerfert2016-05-193-93/+7
| | | | | | | This reverts commit 787e642207ca978f2e800140529fc7049ea1f3de until the lnt failures are fixed. llvm-svn: 270061
* Optimistic assume required invariant loads to be invariantJohannes Doerfert2016-05-193-7/+93
| | | | | | | | So far we bailed if a required invariant load was potentially overwritten in the SCoP. From now on we will optimistically assume it is actually invariant and, to this end, restrict the valid parameter space. llvm-svn: 270060
* Compute the MaxLoopDepth during domain construction [NFC]Johannes Doerfert2016-05-191-1/+1
| | | | llvm-svn: 270052
* Cleanup rejection log handling [NFC]Johannes Doerfert2016-05-121-4/+4
| | | | | | | | | | | | This patch cleans up the rejection log handling during the ScopDetection. It consists of two interconnected parts: - We keep all detection contexts for a function in order to provide more information to the user, e.g., about the rejection of extended/intermediate regions. - We remove the mutable "RejectLogs" member as the information is available through the detection contexts. llvm-svn: 269323
* Support truncate operationsJohannes Doerfert2016-05-128-9/+202
| | | | | | | | | 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
* Check overflows in RTCs and bail accordinglyJohannes Doerfert2016-05-127-38/+179
| | | | | | | | | | | | | | | 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
* Invalidate unprofitable SCoPs after creationJohannes Doerfert2016-05-101-2/+2
| | | | | | | | | | If a profitable run is performed we will check if the SCoP seems to be profitable after creation but before e.g., dependence are computed. This is needed as SCoP detection only approximates the actual SCoP representation. In the end this should allow us to be less conservative during the SCoP detection while keeping the compile time in check. llvm-svn: 269074
* Weaken profitability constraints during ScopDetectionJohannes Doerfert2016-05-102-7/+6
| | | | | | | | Regions with one affine loop can be profitable if the loop is distributable. To this end we will allow them to be treated as profitable if they contain at least two non-trivial basic blocks. llvm-svn: 269064
* [FIX] Cleanup isl objects prior to early exitJohannes Doerfert2016-05-101-0/+59
| | | | llvm-svn: 269061
* Handle llvm.assume inside the SCoPJohannes Doerfert2016-05-105-1/+147
| | | | | | | | | | 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
* Propagate complexity problems during domain generation [NFC]Johannes Doerfert2016-05-101-0/+52
| | | | | | | | This patches makes the propagation of complexity problems during domain generation consistent. Additionally, it makes it less likely to encounter ill-formed domains later, e.g., during schedule generation. llvm-svn: 269055
* [FIX] Create error-restrictions lateJohannes Doerfert2016-05-102-0/+96
| | | | | | | | | | | | | | | Before this patch we generated error-restrictions only for error-blocks, thus blocks (or regions) containing a not represented function call. However, the same reasoning is needed if the invalid domain of a statement subsumes its actual domain. To this end we move the generation of error-restrictions after the propagation of the invalid domains. Consequently, error-statements are now defined more general as statements that are assumed to be not executed. Additionally, we do not record an empty domain for such statements but a nullptr instead. This allows to distinguish between error-statements and dead-statements. llvm-svn: 269053
* Refactor simplifySCoP [NFC]Johannes Doerfert2016-05-101-0/+31
| | | | | | | Remove obsolete code and decrease the indention in the Scop::simplifySCoP() function. llvm-svn: 269049
* Simplify the internal representation according to the context [NFC]Johannes Doerfert2016-05-1012-22/+30
| | | | | | | | We now use context information to simplify the domains and access functions of the SCoP instead of just aligning them with the parameter space. llvm-svn: 269048
* Codegen: Enable the detection of min/max expressionsTobias Grosser2016-05-074-9/+7
| | | | | | | | | 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
* test: Use CHECK-NEXT to not miss instructions in test outputTobias Grosser2016-05-071-25/+23
| | | | llvm-svn: 268854
* Update to ISL 0.17.Michael Kruse2016-05-042-2/+2
| | | | | | | | | | | | This release includes sevaral improvments compared to the previous version isl-0.16.1-145-g243bf7c (from the ISL 0.17 announcement): - optionally combine SCCs incrementally in scheduler - optionally maximize coincidence in scheduler - optionally avoid loop coalescing in scheduler - minor AST generator improvements - improve support for expansions in schedule trees llvm-svn: 268500
* [ScheduleOptimizer] Add -polly-opt-outer-coincidence option.Michael Kruse2016-05-021-0/+69
| | | | | | | | | | | | Add a command line switch to set the isl_options_set_schedule_outer_coincidence option. ISL then tries to build schedules where the outer member of a band satisfies the coincidence constraints. In practice this allows loop skewing for more parallelism in inner loops. llvm-svn: 268222
* Allow unsigned divisionsJohannes Doerfert2016-04-296-14/+226
| | | | | | | | | | | | | 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
* [FIX] TypoJohannes Doerfert2016-04-291-1/+1
| | | | llvm-svn: 268027
* [FIX] Prevent division/modulo by zero in parameters -- test caseJohannes Doerfert2016-04-291-0/+56
| | | | | | This commits a test case for r268023. llvm-svn: 268026
* [FIX] Unsigned comparisons change invalid domainJohannes Doerfert2016-04-291-0/+41
| | | | | | | | | 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] Correct assumption simplificationJohannes Doerfert2016-04-282-2/+6
| | | | | | | | Assumptions and restrictions can both be simplified with the domain of a statement but not the same way. After this patch we will correctly distinguish them. llvm-svn: 267885
* test: Make test case independent of earlier instructionsTobias Grosser2016-04-281-5/+5
| | | | | | | Instead of matching for %6, we use a regexp to match for the result strings. This test case caused unrelated noise in http://reviews.llvm.org/D15722. llvm-svn: 267875
* [FIX] Propagate execution domain of invariant loadsJohannes Doerfert2016-04-271-0/+73
| | | | | | | | | | | 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
* Allow unsigned comparisonsJohannes Doerfert2016-04-264-15/+95
| | | | | | | | With this patch we will optimistically assume that the result of an unsigned comparison is the same as the result of the same comparison interpreted as signed. llvm-svn: 267559
* [FIX] Adjust assumption space for zext instructionsJohannes Doerfert2016-04-262-1/+31
| | | | llvm-svn: 267552
* Do not add but record signed-unsigned assumptionsJohannes Doerfert2016-04-262-2/+1
| | | | llvm-svn: 267528
OpenPOWER on IntegriCloud