summaryrefslogtreecommitdiffstats
path: root/polly/test/Isl/CodeGen/exprModDiv.ll
Commit message (Collapse)AuthorAgeFilesLines
* [tests] Set -polly-import-jscop-dir=%S alwaysTobias Grosser2017-07-111-2/+2
| | | | | | This simplifies the test cases. llvm-svn: 307645
* IslAst: always use the context during ast generationTobias Grosser2016-11-101-16/+4
| | | | | | | | | | | | | | | | | | | Providing the context to the ast generator allows for additional simplifcations and -- more importantly -- allows to generate loops with only partially bounded domains, assuming the domains are bounded for all parameter configurations that are valid as defined by the context. This change fixes the crash reported in http://llvm.org/PR30956 The original reason why we did not include the context when generating an AST was that CLooG and later isl used to sometimes transfer some of the constraints that bound the size of parameters from the context into the generated AST. This resulted in operations with very large constants, which sometimes introduced problematic integer overflows. The latest versions of the isl AST generator are careful to not introduce such constants. Reported-by: Eli Friedman <efriedma@codeaurora.org> llvm-svn: 286442
* This reverts recent expression type changesTobias Grosser2016-06-111-21/+13
| | | | | | | | | | | | | | | | | | | | | 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-9/+17
| | | | | | | | | 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-061-8/+8
| | | | | | | | | 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
* Check overflows in RTCs and bail accordinglyJohannes Doerfert2016-05-121-10/+10
| | | | | | | | | | | | | | | 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
* Use regular expressions instead of temporary names for IR test [NFC]Johannes Doerfert2016-02-211-6/+6
| | | | llvm-svn: 261488
* Update to ISL 0.16.1Michael Kruse2016-01-151-16/+10
| | | | llvm-svn: 257898
* tests: Drop -polly-detect-unprofitable and -polly-no-early-exitTobias Grosser2015-10-061-2/+2
| | | | | | | | These flags are now always passed to all tests and need to be disabled if not needed. Disabling these flags, rather than passing them to almost all tests, significantly simplfies our RUN: lines. llvm-svn: 249422
* Reapply "BlockGenerator: Generate synthesisable instructions only on-demand"Tobias Grosser2015-09-301-6/+6
| | | | | | | | | | | | | | | Instructions which we can synthesis from a SCEV expression are not generated directly, but only when they are used as an operand of another instruction. This avoids generating unnecessary instructions and works more reliably than first inserting them and then deleting them later on. This commit was reverted in r248860 due to a remaining miscompile, where we forgot to synthesis the operand values that were referenced from scalar writes. test/Isl/CodeGen/scalar-store-from-same-bb.ll tests that we do this now correctly. llvm-svn: 248900
* Identify and hoist definitively invariant loadsJohannes Doerfert2015-09-291-21/+22
| | | | | | | | | | | | | | | | | | | As a first step in the direction of assumed invariant loads (loads that are not written in some context) we now detect and hoist definitively invariant loads. These invariant loads will be preloaded in the code generation and used in the optimized version of the SCoP. If the load is only conditionally executed the preloaded version will also only be executed under the same condition, hence we will never access memory that wouldn't have been accessed otherwise. This is also the most distinguishing feature to licm. As hoisting can make statements empty we will simplify the SCoP and remove empty statements that would otherwise cause artifacts in the code generation. Differential Revision: http://reviews.llvm.org/D13194 llvm-svn: 248861
* Revert "BlockGenerator: Generate synthesisable instructions only on-demand"Johannes Doerfert2015-09-291-6/+6
| | | | | | | | | | | | This reverts commit 07830c18d789ee72812d5b5b9b4f8ce72ebd4207. The commit broke at least one test in lnt, MultiSource/Benchmarks/Ptrdist/bc/number.c was miss compiled and the test produced a wrong result. One Polly test case that was added later was adjusted too. llvm-svn: 248860
* BlockGenerator: Generate synthesisable instructions only on-demandTobias Grosser2015-09-281-6/+6
| | | | | | | | | | | | | Instructions which we can synthesis from a SCEV expression are not generated directly, but only when they are used as an operand of another instruction. This avoids generating unnecessary instruction and works more reliably than first inserting them and then deleting them later on. Suggested-by: Johannes Doerfert <doerfert@cs.uni-saarland.de> Differential Revision: http://reviews.llvm.org/D13208 llvm-svn: 248712
* Do not detect Scops with only one loop.Tobias Grosser2015-08-271-2/+5
| | | | | | | | | | | | | | | | | | | | If a region does not have more than one loop, we do not identify it as a Scop in ScopDetection. The main optimizations Polly is currently performing (tiling, preparation for outer-loop vectorization and loop fusion) are unlikely to have a positive impact on individual loops. In some cases, Polly's run-time alias checks or conditional hoisting may still have a positive impact, but those are mostly enabling transformations which LLVM already performs for individual loops. As we do not focus on individual loops, we leave them untouched to not introduce compile time regressions and execution time noise. This results in good compile time reduction (oourafft: -73.99%, smg2000: -56.25%). Contributed-by: Pratik Bhatu <cs12b1010@iith.ac.in> Reviewers: grosser Differential Revision: http://reviews.llvm.org/D12268 llvm-svn: 246161
* Mark sdivs as 'exact' instead of lowering them ourselvesTobias Grosser2015-06-041-3/+3
| | | | | | | | | LLVM's instcombine already translates power-of-two sdivs that are known to be exact to fast ashr instructions. Hence, there is no need to add this logic ourselves. Pointed-out-by: Johannes Doerfert llvm-svn: 239025
* Ensure memory access mappings are defined for full domainTobias Grosser2015-06-041-11/+15
| | | | | | | | | | | | | | We now verify that memory access functions imported via JSON are indeed defined for the full iteration domain. Before this change we accidentally imported memory mappings such as i -> i / 127, which only defined a mapped for values of i that are evenly divisible by 127, but which did not define any mapping for the remaining values, with the result that isl just generated an access expression that had undefined behavior for all the unmapped values. In the incorrect test cases, we now either use floor(i/127) or we use p/127 and provide the information that p is indeed a multiple of 127. llvm-svn: 239024
* Lower signed-divisions without rounding to ashr instructionsTobias Grosser2015-06-031-5/+3
| | | | llvm-svn: 238929
* Translate power-of-two floor-division into ashrTobias Grosser2015-06-031-11/+36
| | | | | | | | | | | | | | | | | | Power-of-two floor divisions can be translated into an arithmetic shift operation. This allows us to replace a complex lowering that requires division operations: %pexp.fdiv_q.0 = sub i64 %21, 128 %pexp.fdiv_q.1 = add i64 %pexp.fdiv_q.0, 1 %pexp.fdiv_q.2 = icmp slt i64 %21, 0 %pexp.fdiv_q.3 = select i1 %pexp.fdiv_q.2, i64 %pexp.fdiv_q.1, i64 %21 %pexp.fdiv_q.4 = sdiv i64 %pexp.fdiv_q.3, 128 with a simple ashr: %polly.fdiv_q.shr = ashr i64 %21, 7 llvm-svn: 238905
* Exploit non-negative numeratorsTobias Grosser2015-05-291-0/+78
isl marks known non-negative numerators in modulo (and soon also division) operations. We now exploit this by generating unsigned operations. This is beneficial as unsigned operations with power-of-two denominators will be translated by isl to fast bitshift or bitwise and operations. llvm-svn: 238577
OpenPOWER on IntegriCloud