summaryrefslogtreecommitdiffstats
path: root/polly/test/Isl/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC] Drop the "scattering" tuple nameJohannes Doerfert2015-02-0217-19/+19
| | | | llvm-svn: 227801
* [FIX] Activated a pointer test and removed obsolete commentJohannes Doerfert2015-01-301-2/+3
| | | | llvm-svn: 227524
* [FIX] Correct two C snippets in test casesJohannes Doerfert2015-01-292-2/+2
| | | | llvm-svn: 227407
* [FIX] Handle pointer-pointer comparisonsJohannes Doerfert2015-01-291-0/+47
| | | | | | This should fix a problem introduced by r225464. llvm-svn: 227404
* [FIX] Independent blocks with intrinsics handlingJohannes Doerfert2015-01-252-2/+2
| | | | | | Also an old option was removed from some new test cases llvm-svn: 227057
* Support for math/misc intrinsicsJohannes Doerfert2015-01-252-0/+187
| | | | | | | | | The support is currently limited as we only allow them in the input but do not emit them in the transformed SCoP due to the possible semantic changes. Differential Revision: http://reviews.llvm.org/D5225 llvm-svn: 227054
* Adjust to the new explicit debug metadataTobias Grosser2015-01-152-8/+8
| | | | | | This fixes the outfall of r226048 llvm-svn: 226134
* Use types of matching size when generating multi-dimensional address expressionsTobias Grosser2015-01-131-0/+42
| | | | | | | | | | This change ensures that the values that represent the array size of a multi-dimensional access are correctly sign-extended when used to compute a memory address used in the run-time alias check. To make the test case more readable, we name the instructions that we generate. llvm-svn: 225818
* Adjust test for the new 'distinct' metadata nodesTobias Grosser2015-01-092-5/+5
| | | | | | | 'distinct' was introduced in 225474. We now adjust the test cases to match for the additional 'distinct' marker. llvm-svn: 225512
* Add support for pointer types in expressionsTobias Grosser2015-01-081-0/+47
| | | | llvm-svn: 225464
* Drop all constant scheduling dimensionsTobias Grosser2015-01-0134-129/+129
| | | | | | | | | Schedule dimensions that have the same constant value accross all statements do not carry any information, but due to the increased dimensionality of the schedule cost compile time. To not pay this cost, we remove constant dimensions if possible. llvm-svn: 225067
* Hand-modify a testcase (still PR21532)Duncan P. N. Exon Smith2014-12-151-7/+7
| | | | | | | | | Bot was still tripping [1] on a testcase the upgrade script didn't handle in 224269. This is still fallout from r224257. [1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25435 llvm-svn: 224280
* Run upgrade script from PR21532 to match LLVM changesDuncan P. N. Exon Smith2014-12-155-75/+75
| | | | | | | | | Update tests for LLVM assembly format change in r224257 using the script attached to PR21532. I'm hoping this unsticks the bot [1]. [1]: http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/25432 llvm-svn: 224269
* Drop Cloog supportJohannes Doerfert2014-12-024-14/+32
| | | | | | | | | This commit drops the Cloog support for Polly. The scripts and documentation are changed to only use isl as prerequisity. In the code all Cloog specific parts have been removed and all relevant tests have been ported to the isl backend when it was created. llvm-svn: 223141
* Remove -polly-codegen-scev option and related codeTobias Grosser2014-11-3030-125/+52
| | | | | | | | SCEV based code generation has been the default for two weeks after having been tested for a long time. We now drop the support the non-scev-based code generation. llvm-svn: 222978
* Add PreHeader always to OuterLoopTobias Grosser2014-11-251-1/+1
| | | | | | This fixes a bug introduce in r217525. llvm-svn: 222766
* Modify test cases to work with SCEV based code generationTobias Grosser2014-11-166-19/+34
| | | | | | | | This patch includes tests where we actually need to adjust the CHECK lines for SCEV based code generation. Besides these adjustments we add explicit calls to -polly-codegen-scev=[true|false] and make sure we test both cases. llvm-svn: 222112
* Make usage of scev based code generation explicit in testsTobias Grosser2014-11-162-6/+6
| | | | | | This is in preparation of using SCEV based codegen by default in polly llvm-svn: 222111
* Independent blocks: SE->forget() scalars translated to arraysTobias Grosser2014-11-161-0/+41
| | | | | | | | | | This prevents SCEVs to reference values not valid any more and as a consequence solves a bug where such values reintroduced during ast generation caused the independent blocks pass to fail validation. http://llvm.org/PR21204 llvm-svn: 222103
* Switch default code generation backend to islTobias Grosser2014-11-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isl based backend has been tested since a long time and with the recently commited OpenMP support the last missing piece of functionality was ported from the CLooG backend. The isl based backend gives us interesting new functionality: - Run-time alias checks (enabled by default) Optimize scops that contain possibly aliasing pointers. This feature has largely increased the number of loop nests we consider for optimization. Thanks Johannes! - Delinearization (not yet enabled by default) Model accesses to multi-dimensional arrays precisely. This will allow us to understand kernels with multi-dimensional VLAs written in Julia, boost::ublas, coremark or C99. Thanks Sebastian! - Generation of higher quality code Sven and me spent a long time to optimize the quality of the generated code. A major focus were expressions as they result from modulos/divisions or piecewise affine expressions (a ? b : c). - Full/Partial tile separation, polyhedral unrolling The isl code generation provides functionality to generate specialized code for core and cleanup loops and to specialize code using polyhedral context information while unrolling statements. (not yet exploited in Polly) - Modifieable access functions We can now use standard isl functionality to remap memory accesses to new data locations. A standard use case is the use of shared memory, where accesses to a larger region in global memory need to be mapped to a smaller shared memory region using a modulo mapping. (not yet exploited in Polly) The cloog based code generation is still available for comparision, but is scheduled for removal. llvm-svn: 222101
* Introduce minimalistic cost model for auto parallelizationTobias Grosser2014-11-169-25/+25
| | | | | | | | | | | | | | | | | | Instead of parallelizing every parallel outermost loop, we now use a very minimalistic cost model. Specifically, we assume innermost loops are not worth parallelising and all non-innermost loops are. When parallelizing all loops in LNT we got several slowdowns/timeouts due to us parallelizing innermost loops that are executed only a couple of times (number of iterations not known statically). With this basic heuristic enabled LNT does not show any more timeouts, while several interesting loops are still parallelized. There are many ways to obtain an improved heuristic. Constructing such an improvide heuristic from a position of minimal slow-down and zero code size increase seems to be the best, as it allows us to track progress on LNT. llvm-svn: 222096
* Remove one incomplete test case accidentally committedTobias Grosser2014-11-151-55/+0
| | | | llvm-svn: 222089
* Add OpenMP code generation to isl backendTobias Grosser2014-11-1512-0/+656
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backend supports besides the classical code generation the upcoming SCEV based code generation (which the existing CLooG backend does not support robustly). OpenMP code generation in the isl backend benefits from our run-time alias checks such that the set of loops that can possibly be parallelized is a lot larger. The code was tested on LNT. We do not regress on builds without -polly-parallel. When using -polly-parallel most tests work flawlessly, but a few issues still remain and will be addressed in follow up commits. SCEV/non-SCEV codegen: - Compile time failure in ldecod and TimberWolfMC due a problem in our run-time alias check generation triggered by pointers that escape through the OpenMP subfunction (OpenMP specific). - Several execution time failures. Due to the larger set of loops that we now parallelize (compared to the classical code generation), we currently run into some timeouts in tests with a lot loops that have a low trip count and are slowed down by parallelizing them. SCEV only: - One existing failure in lencod due to llvm.org/PR21204 (not OpenMP specific) OpenMP code generation is the last feature that was only available in the CLooG backend. With the isl backend being the only one supporting features such as run-time alias checks and delinearization, we will soon switch to use the isl ast generator by the default and subsequently remove our dependency on CLooG. http://reviews.llvm.org/D5517 llvm-svn: 222088
* Safely generate new loop metadata nodeDavid Peixotto2014-11-071-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Polly was accidently modifying a debug info metadata node when attempting to generate a new unique metadata node for the loop id. The problem was that we had dwarf metadata that referred to a metadata node with a null value, like this: !6 = ... some dwarf metadata referring to !7 ... !7 = {null} When we attempt to generate a new metadata node, we reserve the first space for self-referential node by setting the first argument to null and then mutating the node later to refer to itself. However, because the nodes are uniqued based on pointer values, when we get the new metadata node it actually referred to an existing node (!7 in the example). When we went to modify the metadata to point to itself, we were accidently mutating the dwarf metatdata. We ended up in this situation: !6 = ... some dwarf metadata referring to !7 ... !7 = {!7} and this causes an assert when generating the debug info. The fix is simple, we just need to use a unique value when getting a new metadata node. The MDNode::getTemporary() provides exactly the API we need (and it is used in clang to generate the unique nodes). Differential Revision: http://reviews.llvm.org/D6174 llvm-svn: 221550
* BlockGenerator: Recompute values from SCEV before handing back the original ↵Tobias Grosser2014-11-051-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | values This patch moves the SCEV based (re)generation of values before the checking for scop-constant terms. It enables us to provide SCEV based replacements, which are necessary to correctly generate OpenMP subfunctions when using the SCEV based code generation. When recomputing a new value for a value used in the code of the original scop, we previously directly returned the same original value for all scop-constant expressions without even trying to regenerate these values using our SCEV expression. This is correct when the newly generated code remains fully in the same function, however in case we want to outline parts of the newly generated scop into subfunctions, this approach means we do not have any opportunity to update these values in the SCEV based code generation. (In the non-SCEV based code generation, we can provide such updates through the GlobalMap). To ensure we have this opportunity, we first try to regenerate scalar terms with our SCEV builder and will only return scop-constant expressions if SCEV based code generation was not possible. This change should not affect the results of the existing code generation passes. It only impacts the upcoming OpenMP based code generation. This commit also adds a test case. This test case passes before and after this commit. It was added to ensure test coverage for the changed code. llvm-svn: 221393
* Relax the condition on the jsop accesses regarding the alignment.Johannes Doerfert2014-10-102-0/+62
| | | | | | | | | | | We restricted the new access functions to be a subset of the old one because we want to keep the alignment, however if the alignment is "not special", thus the default for the type, we can allow any access. Differential Revision: http://reviews.llvm.org/D5680 llvm-svn: 219503
* Use the new access function (if present) to compute the access stride.Johannes Doerfert2014-10-101-0/+47
| | | | | | Differential Revision: http://reviews.llvm.org/D5661 llvm-svn: 219499
* Allow the VectorBlockGenerator to use the IslExprBuilder.Johannes Doerfert2014-10-081-1/+29
| | | | | | | This also enables the VectorBlockGenerator to build load store accesses according to the newAccessRelation of a MemoryAccess. llvm-svn: 219321
* [Fix] Non i1 typed select condition for weird pw aff functions.Johannes Doerfert2014-10-072-0/+137
| | | | | | | | | | | | | | | | | | | In case the pieceweise affine function used to create an isl_ast_expr had empty cases (e.g., with contradicting constraints on the parameters), it was possible that the condition of the isl_ast_expr select was not a comparison but a constant (thus of type i64). This patch does two thing: 1) Handle the case the condition of a select is not a i1 type like C. 2) Try to simplify the pieceweise affine functions for the min/max access when we generate runtime alias checks. That step can often remove empty or redundant cases as well as redundant constrains. This fixes bug: http://llvm.org/PR21167 Differential Revision: http://reviews.llvm.org/D5627 llvm-svn: 219208
* Allow multidimensional accesses in the IslExprBuilder.Johannes Doerfert2014-10-051-0/+78
| | | | | | | | | This resolved the issues with delinearized accesses that might alias, thus delinearization doesn't deactivate runtime alias checks anymore. Differential Revision: http://reviews.llvm.org/D5614 llvm-svn: 219078
* Introduce the ScopArrayInfo class.Johannes Doerfert2014-10-057-7/+104
| | | | | | | | | | | | | | | | | | | This class allows to store information about the arrays in the SCoP. For each base pointer in the SCoP one object is created storing the type and dimension sizes of the array. The objects can be obtained via the SCoP, a MemoryAccess or the isl_id associated with the output dimension of a MemoryAccess (the description of what is accessed). So far we use the information in the IslExprBuilder to create the right base type before indexing into the base array. This fixes the bug http://llvm.org/bugs/show_bug.cgi?id=21113 (both test cases are included). On top of that we can now build runtime alias checks for delinearized arrays as the dimension sizes are also part of the ScopArrayInfo objects. Differential Revision: http://reviews.llvm.org/D5613 llvm-svn: 219077
* DI: LLVM schema change: fold constants into stringDuncan P. N. Exon Smith2014-10-031-16/+16
| | | | | | | | | Update debug info testcases for the LLVM metadata schema change in r219010 to fold metadata constant operands into a single `MDString`. Part of PR17891. llvm-svn: 219019
* [Fix] Accidently changed the type of a libgomp argument in r219003.Johannes Doerfert2014-10-031-3/+3
| | | | | | | Only subsequent patches introduced tests for the signature in the generated IR, thus the tests were wrong too and are adjusted now. llvm-svn: 219017
* Add option to limit the maximal number of parallel threads.Johannes Doerfert2014-10-031-0/+36
| | | | | | Differential Revision: http://reviews.llvm.org/D5581 llvm-svn: 219004
* Align copied load/store instructions as the original.Johannes Doerfert2014-10-024-3/+92
| | | | | | | | | | This also forbids the json importer to access other memory locations than the original instruction as we to reuse the alignment of the original load/store. Differential Revision: http://reviews.llvm.org/D5560 llvm-svn: 218883
* Allow to annotate alias scopes in the new SCoP.Johannes Doerfert2014-10-023-18/+96
| | | | | | | | | The command line flag -polly-annotate-alias-scopes controls whether or not Polly annotates alias scopes in the new SCoP (default ON). This can improve later optimizations as the new SCoP is basically an alias free environment for them. llvm-svn: 218877
* Update testcase to new intrinsic formatAdrian Prantl2014-10-011-6/+6
| | | | llvm-svn: 218806
* Annotate LLVM-IR for all parallel loopsJohannes Doerfert2014-10-011-0/+64
| | | | | | | | | | | | | | This change allows to annotate all parallel loops with loop id metadata. Furthermore, it will annotate memory instructions with llvm.mem.parallel_loop_access metadata for all surrounding parallel loops. This is especially usefull if an external paralleliser is used. This also removes the PollyLoopInfo class and comments the LoopAnnotator. A test case for multiple parallel loops is attached. llvm-svn: 218793
* Build domtree of new loops correctlyTobias Grosser2014-09-281-1/+1
| | | | | | This fixes a bug introduced in r217525. llvm-svn: 218581
* [Fix] Allow pointer types as access elements and compare them correctlyJohannes Doerfert2014-09-191-0/+51
| | | | | | | | | | | This fixes two problems which are usualy caused together: 1) The elements of an isl AST access expression could be pointers not only integers, floats and vectores thereof. 2) The runtime alias checks need to compare pointers but if they are of a different type we need to cast them into a "max" type similar to the non pointer case. llvm-svn: 218113
* [RTC] Runtime Alias Checks for the ISL backend (missing tests)Johannes Doerfert2014-09-186-0/+270
| | | | | | Test files missing in r218046. llvm-svn: 218047
* [RTC] Runtime Alias Checks for the ISL backendJohannes Doerfert2014-09-181-2/+2
| | | | | | | | | | | | | | | | | This change will build all alias groups (minimal/maximal accesses to possible aliasing base pointers) we have to check before we can assume an alias free environment. It will also use these to create Runtime Alias Checks (RTC) in the ISL code generation backend, thus allow us to optimize SCoPs despite possibly aliasing pointers when this backend is used. This feature will be enabled for the isl code generator, e.g., --polly-code-generator=isl, but disabled for: - The cloog code generator (still the default). - The case delinearization is enabled. - The case non-affine accesses are allowed. llvm-svn: 218046
* [Fix] Rewire the Region after a unconditional entry edge is createdJohannes Doerfert2014-09-151-0/+63
| | | | | | | | | | | | We use SplitEdge to split a conditional entry edge of the SCoP region. However, SplitEdge can cause two different situations (depending on whether or not the edge is critical). This patch tests which one is present and deals with the former unhandled one. It also refactors and unifies the case we have to change the basic blocks of the SCoP to new ones (see replaceScopAndRegionEntry). llvm-svn: 217802
* Remove executable bit on test filesTobias Grosser2014-09-121-0/+0
| | | | | | Some test files had been marked executable by accident. llvm-svn: 217663
* Allow to generate a loop without the GuardBBJohannes Doerfert2014-09-101-0/+33
| | | | | | | | | | | | This allows us to omit the GuardBB in front of created loops if we can show the loop trip count is at least one. It also simplifies the dominance relation inside the new created region. A GuardBB (even with a constant branch condition) might trigger false dominance errors during function verification. Differential Revision: http://reviews.llvm.org/D5297 llvm-svn: 217525
* [Refactor] Cleanup isl code generationJohannes Doerfert2014-09-104-4/+84
| | | | | | | | | | | | | | | | | | | | Summary: + Refactor the runtime check (RTC) build function + Added helper function to create an PollyIRBuilder + Change the simplify region function to create not only unique entry and exit edges but also enfore that the entry edge is unconditional + Cleaned the IslCodeGeneration runOnScop function: - less post-creation changes of the created IR + Adjusted and added test cases Reviewers: grosser, sebpop, simbuerg, dpeixott Subscribers: llvm-commits, #polly Differential Revision: http://reviews.llvm.org/D5076 llvm-svn: 217508
* Always pipe in test filesTobias Grosser2014-08-3022-22/+22
| | | | | | | | | In Polly we used to have a mix of test cases, some that used 'opt %s' and others that used 'opt < %s'. We now change all to use 'opt < %s'. Piping in test files is preferable as it does prevent temporary files to be written to disk. This brings us in line with what is usus in LLVM. llvm-svn: 216816
* Replace %defaultOpts with explicit pass namesTobias Grosser2014-08-3045-46/+46
| | | | | | | | | | | | | | | | | | | | This replaces the use of %defaultOpts = '-basicaa -polly-prepare' with the minimal set of passes necessary for a test to succeed. Of the test cases that previously used %defaultOpts 76 test cases require none of these passes, 42 need -basicaa and only 2 need -polly-prepare. Our change makes this requirement explicit. In Polly many test cases have been using a macro '%defaultOpts' which run a couple of preparing passes before the actual Polly test case. This macro was introduced very early in the development of Polly and originally contained a large set of canonicalization passes. However, as the need for additional canonicalization passes makes test cases harder to understand and also more fragile in terms of changes in such passes, we aim since a longer time to only include the minimal set of passes necessary. This patch removes the last leftovers from of %defaultOpts and brings our tests cases more in line to what is usus in LLVM itself. llvm-svn: 216815
* Revert "[Refactor] Cleanup runtime code generation"Tobias Grosser2014-08-162-9/+9
| | | | | | | | | | | | | | | | This reverts commit 215466 (and 215528, a trivial formatting fix). The intention of these commits is a good one, but unfortunately they broke our LNT buildbot: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-codegen-isl Several of the cleanup changes that have been combined in this 'fixup' are trivial and could probably be committed as obvious changes without risking to break the build. The remaining changes are little and it should be easy to figure out what went wrong. llvm-svn: 215817
* [Refactor] Cleanup runtime code generationJohannes Doerfert2014-08-122-9/+9
| | | | | | | + Use regexp in two test case. + Refactor the runtime condition build function llvm-svn: 215466
OpenPOWER on IntegriCloud