summaryrefslogtreecommitdiffstats
path: root/polly
Commit message (Collapse)AuthorAgeFilesLines
...
* [Polly] Remove unwanted --check-prefix=CHECK from unit tests. NFC.Mandeep Singh Grang2016-04-152-2/+2
| | | | | | | | | | | | | | | | | Summary: Removed unwanted --check-prefix=CHECK from the following unit tests: DeadCodeElimination/dead_iteration_elimination.ll Isl/CodeGen/simple_vec_cast.ll Patch by: Mandeep Singh Grang (mgrang) Reviewers: jdoerfert, zinob, spop, grosser Projects: #polly Differential Revision: http://reviews.llvm.org/D19143 llvm-svn: 266411
* Add contexts to test cases. NFC.Michael Kruse2016-04-142-2/+12
| | | | | | | | As discussed in the Polly weekly phone call and reviews.llvm.org/D18878, the assumed contexts changed (widen) due to D18878/r265942. Also check these contexts in the tests affected by that change. llvm-svn: 266323
* Add InvalidContext to update_test.py.Michael Kruse2016-04-141-0/+4
| | | | | | | This allows the test update script to add 'Invalid Context:' to test cases. Enable with --check-include=InvalidContext. llvm-svn: 266322
* [FIX] Check the invalid context agains the context to rule out SCoPsJohannes Doerfert2016-04-122-0/+71
| | | | llvm-svn: 266096
* Do not by default minimize remarksJohannes Doerfert2016-04-123-10/+20
| | | | | | | | | | | | | We used checks to minimize the number of remarks we present to a user but these checks can become expensive, especially since all wrapping assumptions are emitted separately. Because there is not benefit for a "headless" run we put these checks under a command line flag. Thus, if the flag is not given we will emit "non-effective" remarks, e.g., duplicates and revert to the old behaviour if it is given. As this also changes the internal representation of some sets we set the flag by default for our unit tests. llvm-svn: 266087
* Record wrapping assumptions earlyJohannes Doerfert2016-04-1212-76/+53
| | | | | | | | Utilizing the record option for assumptions we can simplify the wrapping assumption generation a lot. Additionally, we can now report locations together with wrapping assumptions, though they might not be accurate yet. llvm-svn: 266069
* Record assumptions first and add them laterJohannes Doerfert2016-04-1211-20/+89
| | | | | | | | | | | | | | | | | | There are three reasons why we want to record assumptions first before we add them to the assumed/invalid context: 1) If the SCoP is not profitable or otherwise invalid without the assumed/invalid context we do not have to compute it. 2) Information about the context are gathered rather late in the SCoP construction (basically after we know all parameters), thus the user might see overly complicated assumptions to be taken while they would have been simplified later on. 3) Currently we cannot take assumptions at any point but have to wait, e.g., for the domain generation to finish. This makes wrapping assumptions much more complicated as they need to be and it will have a similar effect on "signed-unsigned" assumptions later. llvm-svn: 266068
* Introduce and use MemoryAccess::getPwAff() [NFC]Johannes Doerfert2016-04-122-4/+12
| | | | llvm-svn: 266066
* Do not assume switch modeling optimizes a SCoPJohannes Doerfert2016-04-121-1/+0
| | | | llvm-svn: 266065
* Introduce an invalid context for each statementJohannes Doerfert2016-04-123-50/+68
| | | | | | | | | | Collect the error domain contexts (formerly in the ErrorDomainCtxMap) for each statement in the new InvalidContext member variable. While this commit is basically a [NFC] it is a first step to make hoisting sound by allowing a more fine grained record of invalid contexts, e.g., here on statement level. llvm-svn: 266053
* Simplify SCEVAffinator code [NFC]Johannes Doerfert2016-04-121-15/+8
| | | | llvm-svn: 266051
* Allow overflow of indices with constant dim-sizes.Michael Kruse2016-04-114-19/+115
| | | | | | | | | | | | | | | | | | | Allow overflow of indices into the next higher dimension if it has constant size. E.g. float A[32][2]; ((float*)A)[5]; is effectively the same as A[2][1]; This can happen since r265379 as a side effect if ScopDetection recognizes an access as affine, but ScopInfo rejects the GetElementPtr. Differential Revision: http://reviews.llvm.org/D18878 llvm-svn: 265942
* Do not bind a non-const reference to a rvalue. NFC.Michael Kruse2016-04-111-2/+3
| | | | | | | | | | MSVC warns with: warning C4239: nonstandard extension used: 'initializing': conversion from 'llvm::DebugLoc' to 'llvm::DebugLoc &' note: A non-const reference may only be bound to an lvalue Change the reference to a const reference. llvm-svn: 265937
* Allow pointer expressions in SCEVs again.Johannes Doerfert2016-04-1015-166/+172
| | | | | | | | | 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
* [FIX] Do not allow select as a base pointer in the SCoP regionJohannes Doerfert2016-04-092-0/+68
| | | | llvm-svn: 265884
* Do not allow exception handling code in SCoPsJohannes Doerfert2016-04-091-0/+3
| | | | llvm-svn: 265883
* Add __isl_give annotations to return types [NFC]Johannes Doerfert2016-04-094-15/+20
| | | | llvm-svn: 265882
* [FIX] Do not recompute SCEVs but pass them to subfunctionsJohannes Doerfert2016-04-094-23/+70
| | | | | | | | | | | | This reverts commit 2879c53e80e05497f408f21ce470d122e9f90f94. Additionally, it adds SDiv and SRem instructions to the set of values discovered by the findValues function even if we add the operands to be able to recompute the SCEVs. In subfunctions we do not want to recompute SDiv and SRem instructions but pass them instead as they might have been created through the IslExprBuilder and are more complicated than simple SDiv/SRem instructions in the code. llvm-svn: 265873
* Fix: Always honor LLVM_LIBDIR_SUFFIX.Michael Kruse2016-04-091-1/+1
| | | | | | | | | | | Static libraries where installed into "lib${LLVM_LIBDIR_SUFFIX}" while shared ones into "lib". I found no justification for this behaviour. This patch changes both types of libraries to be install into "lib${LLVM_LIBDIR_SUFFIX}". LLVM and clang use the same behaviour. This fixes llvm.org/PR27305. llvm-svn: 265872
* [FIX] Do not crash on opaque (unsized) types.Johannes Doerfert2016-04-082-0/+30
| | | | llvm-svn: 265834
* [FIX] Teach the ScopExpander about parallel subfunctionsJohannes Doerfert2016-04-082-5/+58
| | | | llvm-svn: 265824
* Collect and verify generated parallel subfunctionsJohannes Doerfert2016-04-083-0/+13
| | | | | | | | 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
* Add testcase from PR27218. NFC.Michael Kruse2016-04-081-0/+49
| | | | | | | The the bug has already been fixed r265795, but this second testcase still useful. llvm-svn: 265809
* [ScopInfo] Fix check for element size mismatch.Michael Kruse2016-04-082-1/+59
| | | | | | | | | | | | The way to get the elements size with getPrimitiveSizeInBits() is not the same as used in other parts of Polly which should use DataLayout::getTypeAllocSize(). Its use only queries the size of the pointer and getPrimitiveSizeInBits returns 0 for types that require a DataLayout object such as pointers. Together with r265379, this should fix PR27195. llvm-svn: 265795
* [ScopInfo] Rename variable to AccType. NFC.Michael Kruse2016-04-081-8/+8
| | | | | | This avoids a name clash with the type llvm::Type. llvm-svn: 265788
* [FIX] Allow to lookup domains for non-affine subregion blocksJohannes Doerfert2016-04-083-23/+85
| | | | llvm-svn: 265779
* [FIX] Adjust execution context of hoisted loads wrt. error domainsJohannes Doerfert2016-04-083-41/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we build the domains for error blocks and later remove them we lose the information that they are not executed. Thus, in the SCoP it looks like the control will always reach the statement S: for (i = 0 ... N) if (*valid == 0) doSth(&ptr); S: A[i] = *ptr; Consequently, we would have assumed "ptr" to be always accessed and preloaded it unconditionally. However, only if "*valid != 0" we would execute the optimized version of the SCoP. Nevertheless, we would have hoisted and accessed "ptr"regardless of "*valid". This changes the semantic of the program as the value of "*valid" can cause a change of "ptr" and control if it is executed or not. To fix this problem we adjust the execution context of hoisted loads wrt. error domains. To this end we introduce an ErrorDomainCtxMap that maps each basic block to the error context under which it might be executed. Thus, to the context under which it is executed but an error block would have been executed to. To fill this map one traversal of the blocks in the SCoP suffices. During this traversal we do also "remove" error statements and those that are only reachable via error statements. This was previously done by the removeErrorBlockDomains function which is therefor not needed anymore. This fixes bug PR26683 and thereby several SPEC miscompiles. Differential Revision: http://reviews.llvm.org/D18822 llvm-svn: 265778
* [FIX] Handle multiplications in the SCEVAffinator againJohannes Doerfert2016-04-082-1/+102
| | | | | | | | | | | If ScalarEvolution cannot look through some expression but we do, it might happen that a multiplication will arrive at the SCEVAffinator::visitMulExpr. While we could always try to improve the extractConstantFactor function we might still miss something, thus we reintroduce the code to generate multiplicative piecewise-affine functions as a fall-back. llvm-svn: 265777
* Add test cases for the removal of error blocksJohannes Doerfert2016-04-082-0/+152
| | | | llvm-svn: 265776
* [FIX] Look through div & srem instructions in SCEVsJohannes Doerfert2016-04-085-11/+88
| | | | | | | | | 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
* Add test case forgotten in r265379.Tobias Grosser2016-04-051-0/+52
| | | | | | Thanks Johannes for reminding me. llvm-svn: 265423
* Remove dead code and comment [NFC]Johannes Doerfert2016-04-051-11/+1
| | | | llvm-svn: 265413
* [WWW] Update passesJohannes Doerfert2016-04-051-4/+1
| | | | llvm-svn: 265410
* [FIX] Ensure SAI objects for exit PHIsJohannes Doerfert2016-04-054-2/+106
| | | | | | | | | | | | | If all exiting blocks of a SCoP are error blocks and therefor not represented we will not generate accesses and consequently no SAI objects for exit PHIs. However, they are needed in the code generation to generate the merge PHIs between the original and optimized region. With this patch we enusre that the SAI objects for exit PHIs exist even if all exiting blocks turn out to be eror blocks. This fixes the crash reported in PR27207. llvm-svn: 265393
* ScopInfo: Check for possibly nested GEP in fixed-size delinTobias Grosser2016-04-051-0/+8
| | | | | | | | | | | | | We currently only consider the first GEP when delinearizing access functions, which makes us loose information about additional index expression offsets, which results in our SCoP model to be incorrect. With this patch we now compare the base pointers used to ensure we do not miss any additional offsets. This fixes llvm.org/PR27195. We may consider supporting nested GEP in our delinearization heuristics in the future. llvm-svn: 265379
* Do not allow to complex branch conditionsJohannes Doerfert2016-04-044-18/+171
| | | | | | | | | | | | | Even before we build the domain the branch condition can become very complex, especially if we have to build the complement of a lot of equality constraints. With this patch we bail if the branch condition has a lot of basic sets and parameters. After this patch we now successfully compile External/SPEC/CINT2000/186_crafty/186_crafty with "-polly-process-unprofitable -polly-position=before-vectorizer". llvm-svn: 265286
* Exploit graph properties during domain generationJohannes Doerfert2016-04-0414-86/+1131
| | | | | | | | | | | | | | | | | | | | | | | | | | | As a CFG is often structured we can simplify the steps performed during domain generation. When we push domain information we can utilize the information from a block A to build the domain of a block B, if A dominates B and there is no loop backede on a path from A to B. When we pull domain information we can use information from a block A to build the domain of a block B if B post-dominates A. This patch implements both ideas and thereby simplifies domains that were not simplified by isl. For the FINAL basic block in test/ScopInfo/complex-successor-structure-3.ll we used to build a universe set with 81 basic sets. Now it actually is represented as universe set. While the initial idea to utilize the graph structure depended on the dominator and post-dominator tree we can use the available region information as a coarse grained replacement. To this end we push the region entry domain to the region exit and pull it from the region entry for the region exit if applicable. With this patch we now successfully compile External/SPEC/CINT2006/400_perlbench/400_perlbench and SingleSource/Benchmarks/Adobe-C++/loop_unroll. Differential Revision: http://reviews.llvm.org/D18450 llvm-svn: 265285
* Factor out "adjustDomainDimensions" function [NFC]Johannes Doerfert2016-04-041-51/+52
| | | | llvm-svn: 265284
* [FIX] Do not create a SCoP in the presence of infinite loopsJohannes Doerfert2016-04-035-12/+81
| | | | | | | | If a loop has no exiting blocks the region covering we use during schedule genertion might not cover that loop properly. For now we bail out as we would not optimize these loops anyway. llvm-svn: 265280
* Revert "[FIX] Do not create a SCoP in the presence of infinite loops"Tobias Grosser2016-04-035-103/+15
| | | | | | | | | | | | | | This reverts commit r265260, as it caused the following 'make check-polly' failures: Polly :: ScopDetect/index_from_unpredictable_loop.ll Polly :: ScopInfo/multiple_exiting_blocks.ll Polly :: ScopInfo/multiple_exiting_blocks_two_loop.ll Polly :: ScopInfo/schedule-const-post-dominator-walk-2.ll Polly :: ScopInfo/schedule-const-post-dominator-walk.ll Polly :: ScopInfo/switch-5.ll llvm-svn: 265272
* [FIX] Do not create two SAI objects for exit PHIsJohannes Doerfert2016-04-032-2/+45
| | | | | | | | | If an exit PHI is written and also read in the SCoP we should not create two SAI objects but only one. As the read is only modeled to ensure OpenMP code generation knows about it we can simply use the EXIT_PHI MemoryKind for both accesses. llvm-svn: 265261
* [FIX] Do not create a SCoP in the presence of infinite loopsJohannes Doerfert2016-04-035-15/+103
| | | | | | | | If a loop has no exiting blocks the region covering we use during schedule genertion might not cover that loop properly. For now we bail out as we would not optimize these loops anyway. llvm-svn: 265260
* [FIX] Adjust the insert point for non-affine region PHIsJohannes Doerfert2016-04-012-4/+57
| | | | | | | | | | 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
* ScoPDetection: Obtain a known free diagnostic IDTobias Grosser2016-04-011-1/+2
| | | | | | | | | ... instead of hardcoding something that has been free at some point. This fixes a crash triggered by r265084, where the diagnostic IDs have been shifted in a way that resulted our hardcode ID to not be assigned any implementation. Our ID was likely already wrong earlier on, but this time we really crashed nicely. llvm-svn: 265114
* Update copyright year to 2016.Paul Robinson2016-03-302-3/+3
| | | | llvm-svn: 264955
* Revert 264782 and 264789Tobias Grosser2016-03-3015-1169/+138
| | | | | | | | | | | | | | | | | | | These caused LNT failures due to new assertions when running with -polly-position=before-vectorizer -polly-process-unprofitable for: FAIL: clamscan.compile_time FAIL: cjpeg.compile_time FAIL: consumer-jpeg.compile_time FAIL: shapes.compile_time FAIL: clamscan.execution_time FAIL: cjpeg.execution_time FAIL: consumer-jpeg.execution_time FAIL: shapes.execution_time The failures have been introduced by r264782, but r264789 had to be reverted as it depended on the earlier patch. llvm-svn: 264885
* Exploit graph properties during domain generationJohannes Doerfert2016-03-2915-89/+1122
| | | | | | | | | | | | | | | | | | | | | | | | As a CFG is often structured we can simplify the steps performed during domain generation. When we push domain information we can utilize the information from a block A to build the domain of a block B, if A dominates B. When we pull domain information we can use information from a block A to build the domain of a block B if B post-dominates A. This patch implements both ideas and thereby simplifies domains that were not simplified by isl. For the FINAL basic block in test/ScopInfo/complex-successor-structure-3.ll . we used to build a universe set with 81 basic sets. Now it actually is represented as universe set. While the initial idea to utilize the graph structure depended on the dominator and post-dominator tree we can use the available region information as a coarse grained replacement. To this end we push the region entry domain to the region exit and pull it from the region entry for the region exit. Differential Revision: http://reviews.llvm.org/D18450 llvm-svn: 264789
* Factor out "adjustDomainDimensions" function [NFC]Johannes Doerfert2016-03-291-51/+49
| | | | llvm-svn: 264782
* Factor out "getFirstNonBoxedLoopFor" function [NFC]Johannes Doerfert2016-03-291-6/+11
| | | | llvm-svn: 264781
* Bail as early as possibleJohannes Doerfert2016-03-292-29/+33
| | | | | | | | | | | | | | Instead of waiting for the domain construction to finish we will now bail as early as possible in case a complexity problem is encountered. This might save compile time but more importantly it makes the "abort" explicit. While we can always check if we invalidated the assumed context we can simply propagate the result of the construction back. This also removes the HasComplexCFG flag that was used for the very same reason. Differential Revision: http://reviews.llvm.org/D18504 llvm-svn: 264775
OpenPOWER on IntegriCloud