summaryrefslogtreecommitdiffstats
path: root/polly/test/Isl/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [FIX] Repair test case that was unprofitableJohannes Doerfert2015-09-201-5/+5
| | | | llvm-svn: 248124
* Model fixed-size multi-dimensional arrays if possible multi-dimensionalTobias Grosser2015-09-171-0/+45
| | | | | | | | | If the GEP instructions give us enough insights, model scalar accesses as multi-dimensional (and generate the relevant run-time checks to ensure correctness). This will allow us to simplify the dependence computation in a subsequent commit. llvm-svn: 247906
* Use modulo semantic to generate non-integer-overflow assumptionsJohannes Doerfert2015-09-154-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This will allow to generate non-wrap assumptions for integer expressions that are part of the SCoP. We compare the common isl representation of the expression with one computed with modulo semantic. For all parameter combinations they are not equal we can have integer overflows. The nsw flags are respected when the modulo representation is computed, nuw and nw flags are ignored for now. In order to not increase compile time to much, the non-wrap assumptions are collected in a separate boundary context instead of the assumed context. This helps compile time as the boundary context can become complex and it is therefor not advised to use it in other operations except runtime check generation. However, the assumed context is e.g., used to tighten dependences. While the boundary context might help to tighten the assumed context it is doubtful that it will help in practice (it does not effect lnt much) as the boundary (or no-wrap assumptions) only restrict the very end of the possible value range of parameters. PET uses a different approach to compute the no-wrap context, though lnt runs have shown that this version performs slightly better for us. llvm-svn: 247732
* [test] Load Polly before using the polly flagsTobias Grosser2015-09-141-2/+5
| | | | llvm-svn: 247551
* [FIX] XFAIL test that depends on pending LLVM commitJohannes Doerfert2015-09-141-0/+1
| | | | llvm-svn: 247550
* [FIX] Handle error blocks in non-affine regions correctlyJohannes Doerfert2015-09-141-0/+58
| | | | llvm-svn: 247545
* [FIX] Allow the whole SCoP to be a non-affine subregionJohannes Doerfert2015-09-141-0/+35
| | | | llvm-svn: 247544
* Revert r247278 "Disable support for modulo expressions"Johannes Doerfert2015-09-143-18/+2
| | | | | | | | This reverts commit 00c5b6ca8832439193036aadaaaee92a43236219. We can handle modulo expressions in the domain again. llvm-svn: 247542
* Propagate exit conditions as described in the PET paperJohannes Doerfert2015-09-145-25/+24
| | | | | | | | | At some point we build loop trip counts using this method. It was replaced by a simpler trick that works only for affine (e.g., not modulo) constraints and relies on the removal of unbounded parts. In order to allow modulo constrains again we go back to the former, more accurate method. llvm-svn: 247540
* Update polly for explicit type parameter to global alias changeDavid Blaikie2015-09-111-14/+14
| | | | llvm-svn: 247382
* Allow general loops with one latchJohannes Doerfert2015-09-107-22/+22
| | | | | | | | | | | | | | | | | | | As we do not rely on ScalarEvolution any more we do not need to get the backedge taken count. Additionally, our domain generation handles everything that is affine and has one latch and our ScopDetection will over-approximate everything else. This change will therefor allow loops with: - one latch - exiting conditions that are affine Additionally, it will not check for structured control flow anymore. Hence, loops and conditionals are not necessarily single entry single exit regions any more. Differential Version: http://reviews.llvm.org/D12758 llvm-svn: 247289
* Clean-up unit testsMichael Kruse2015-09-108-11/+0
| | | | | | Remove redundant flags and duplicate invocations of the same test. llvm-svn: 247285
* Replace ScalarEvolution based domain generationJohannes Doerfert2015-09-105-49/+37
| | | | | | | | | | | | | | | | | | | | | | This patch replaces the last legacy part of the domain generation, namely the ScalarEvolution part that was used to obtain loop bounds. We now iterate over the loops in the region and propagate the back edge condition to the header blocks. Afterwards we propagate the new information once through the whole region. In this process we simply ignore unbounded parts of the domain and thereby assume the absence of infinite loops. + This patch already identified a couple of broken unit tests we had for years. + We allow more loops already and the step to multiple exit and multiple back edges is minimal. + It allows to model the overflow checks properly as we actually visit every block in the SCoP and know where which condition is evaluated. - It is currently not compatible with modulo constraints in the domain. Differential Revision: http://reviews.llvm.org/D12499 llvm-svn: 247279
* Disable support for modulo expressionsJohannes Doerfert2015-09-103-0/+16
| | | | | | | | | The support for modulo expressions is not comlete and makes the new domain generation harder. As the currently broken domain generation needs to be replaced, we will first swap in the new, fixed domain generation and make it compatible with the modulo expressions later. llvm-svn: 247278
* [PM] Update Polly for the new AA infrastructure landed in r247167.Chandler Carruth2015-09-093-3/+3
| | | | llvm-svn: 247198
* Disable support for pointer expressionsJohannes Doerfert2015-09-094-0/+20
| | | | | | | | The support for pointer expressions is broken as it can only handle some patterns in the IslExprBuilder. We should to treat pointers in expressions the same as integers at some point and revert this patch. llvm-svn: 247147
* Allow PHI nodes in the region exit blockJohannes Doerfert2015-09-087-0/+428
| | | | | | | | | | | | While we do not need to model PHI nodes in the region exit (as it is not part of the SCoP), we need to prepare for the case that the exit block is split in code generation to create a single exiting block. If this will happen, hence if the region did not have a single exiting block before, we will model the operands of the PHI nodes as escaping scalars in the SCoP. Differential Revision: http://reviews.llvm.org/D12051 llvm-svn: 247078
* Move more compile-time bailouts into -polly-detect-unprofitableTobias Grosser2015-09-083-4/+4
| | | | | | | | | | Instead of having two separate options -polly-detect-scops-in-functions-without-loops and -polly-detect-scops-in-regions-without-loops we now just use -polly-detect-unprofitable to force the detection of scops ignoring any compile time saving bailout heuristics. llvm-svn: 247057
* Do not use '.' in subfunction namesTobias Grosser2015-09-0810-18/+18
| | | | | | | | | | Certain backends, e.g. NVPTX, do not support '.' in function names. Hence, we ensure all '.' are replaced by '_' when generating function names for subfunctions. For the current OpenMP code generation, this is not strictly necessary, but future uses cases (e.g. GPU offloading) need this issue to be fixed. llvm-svn: 246980
* Drop alias metadata in checks of RuntimeDebugBuilder testTobias Grosser2015-09-061-4/+4
| | | | | | | | Our alias metadata is currently not emitted in a deterministic order. As it is not needed in this test, we just drop it for now (but keep in mind to fix this). llvm-svn: 246942
* Add option -polly-codegen-add-debug-printingTobias Grosser2015-09-062-0/+202
| | | | | | | | | | | | | When this option is enabled, Polly will emit printf calls for each scalar load/and store which dump the scalar value loaded/stored at run time. This patch also refactors the RuntimeDebugBuilder to use variadic templates when generating CPU printfs. As result, it now becomes easier to print strings that consist of a set of arguments. Also, as a single printf call is emitted, it is more likely for such strings to be emitted atomically if executed multi-threaded. llvm-svn: 246941
* Add forgotten .jscop fileTobias Grosser2015-09-051-0/+21
| | | | llvm-svn: 246925
* OpenMP: Name the values passed to the subfunciton according to the original ↵Tobias Grosser2015-09-052-18/+17
| | | | | | llvm::Values llvm-svn: 246924
* OpenMP codegen: support generation of multi-dimensional access functionsTobias Grosser2015-09-051-0/+78
| | | | | | | | | | When computing the index expressions for new, multi-dimensional memory accesses these new index expressions may reference original llvm::Values that are not transfered into the OpenMP subfunction. Using GlobalMap we now replace references to such values with the rewritten values that have e.g. been passed to the OpenMP subfunction. llvm-svn: 246923
* Allow the import of multi-dimensional access functionsTobias Grosser2015-09-051-0/+21
| | | | | | | | | | | Originally, we disallowed the import of multi-dimensional access functions due to our code generation not supporting the generation of new address expressions for multi-dimensional memory accesses. When building our run-time alias check infrastructure we added code generation support for multi-dimensional address calculations. Hence, we can now savely allow the import of new multi-dimensional access functions. llvm-svn: 246917
* Always use the branch instructions to model the PHI-node writesTobias Grosser2015-08-311-0/+49
| | | | | | | | | | Before this commit we did this only for Arguments or Constants, but indeed an instruction may define a value a lot higher up in the dominance tree, but the actual write generally needs to happen right before branching to the PHI node. Otherwise, the writes of different branches into PHI nodes may get intermixed if they lay higher up in the dominance tree. llvm-svn: 246441
* Generate scalar initialization loads at the beginning of the start BBTobias Grosser2015-08-311-0/+45
| | | | | | | | | Our OpenMP code generation generated part of its launching code directly into the start basic block and without this change the scalar initialization was run _after_ the OpenMP threads have been launched. This resulted in uninitialized scalar values to be used. llvm-svn: 246427
* OpenMP-codegen: Correctly pass function arguments to subfunctionsTobias Grosser2015-08-311-0/+59
| | | | | | | Before we only checked if certain instructions can be expanded by us. Now we check any value, including function arguments. llvm-svn: 246425
* Do not model scalar references to constant valuesTobias Grosser2015-08-311-1/+5
| | | | llvm-svn: 246418
* Traverse the SCoP to compute non-loop-carried domain conditionsJohannes Doerfert2015-08-302-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to compute domain conditions for conditionals we will now traverse the region in the ScopInfo once and build the domains for each block in the region. The SCoP statements can then use these constraints when they build their domain. The reason behind this change is twofold: 1) This removes a big chunk of preprocessing logic from the TempScopInfo, namely the Conditionals we used to build there. Additionally to moving this logic it is also simplified. Instead of walking the dominance tree up for each basic block in the region (as we did before), we now traverse the region only once in order to collect the domain conditions. 2) This is the first step towards the isl based domain creation. The second step will traverse the region similar to this step, however it will propagate back edge conditions. Once both are in place this conditional handling will allow multiple exit loops additional logic. Reviewers: grosser Differential Revision: http://reviews.llvm.org/D12428 llvm-svn: 246398
* Store scalar dependences from outside the scop into alloca locationsTobias Grosser2015-08-301-1/+6
| | | | | | | | | | | | We already modeled read-only dependences to scalar values defined outside the scop as memory reads and also generated read accesses from the corresponding alloca instructions that have been used to pass these scalar values around during code generation. However, besides for PHI nodes that have already been handled, we failed to store the orignal read-only scalar values into these alloc. This commit extends the initialization of scalar values to all read-only scalar values used within the scop. llvm-svn: 246394
* Ignore debug intrinsics and do not model their potential scalar metadata readsTobias Grosser2015-08-301-1/+8
| | | | | | | | | | Our code generation currently does not support scalar references to metadata values. Hence, it would crash if we try to model scalar dependences to metadata values. Fortunately, for one of the common uses, debug information, we can for now just ignore the relevant intrinsics and consequently the issue of how to model scalar dependences to metadata. llvm-svn: 246388
* Drop alias tags from vector test caseTobias Grosser2015-08-301-2/+4
| | | | | | They are not really part of what is tested here. llvm-svn: 246382
* DI: Fix testcases after LLVM r246327Duncan P. N. Exon Smith2015-08-282-2/+2
| | | | | | | | | | I ran the script from r246327 and it touched all the right files; committing now to hopefully right the bots, but if my check-polly doesn't come back clean I'll keep looking. http://lab.llvm.org:8011/builders/polly-amd64-linux/builds/33648 llvm-svn: 246341
* Do not detect Scops with only one loop.Tobias Grosser2015-08-2714-17/+36
| | | | | | | | | | | | | | | | | | | | 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
* [Vectorizer] Detect strides in multi-dimensional arraysTobias Grosser2015-08-241-0/+76
| | | | | | | The original code was only correct for one-dimensional arrays, but derived incorrect strides for multi-dimensional arrays. llvm-svn: 245888
* Only derive number of loop iterations for loops we can actually vectorizeTobias Grosser2015-08-241-0/+71
| | | | llvm-svn: 245870
* Manually check a loop formRoman Gareev2015-08-211-0/+38
| | | | | | | Add manual check of a loop form and return non-negative number of iterations in case of trivially vectorizable loop. llvm-svn: 245680
* Check feasibility for the runtime check context wrt. the domain.Johannes Doerfert2015-08-205-1/+19
| | | | | | | | If nothing is executed we can bail out early. Otherwise we can use the constraints that ensure at least one statement is executed for simplification. llvm-svn: 245585
* Check for feasible runtime check context earlyJohannes Doerfert2015-08-201-44/+0
| | | | | | | | | | Instead of generating code for an empty assumed context we bail out early. As the number of assumptions we generate increases this becomes more and more important. Additionally, this change will allow us to hide internal contexts that are only used in runtime checks e.g., a boundary context with constraints not suited for simplifications. llvm-svn: 245540
* Generate alias metadata even in OpenMP modeTobias Grosser2015-08-191-0/+52
| | | | | | | | To make alias scope metadata generation work in OpenMP mode we now provide the ScopAnnotator with information about the base pointer rewrite that happens when passing arrays into the OpenMP subfunction. llvm-svn: 245451
* Fix Codegen adding a second exit out of regionMichael Kruse2015-08-181-0/+31
| | | | | | | | | | executeScopConditionally would destroy a predecessor region if it the scop's entry was the region's exit block by forking it to polly.start and thus creating a secnd exit out of the region. This patch "shrinks" the predecessor region s.t. polly.split_new_and_old is not the region's exit anymore. llvm-svn: 245294
* Introduce the ScopExpander as a SCEVExpander replacementJohannes Doerfert2015-08-186-3/+198
| | | | | | | | | | | | | | | The SCEVExpander cannot deal with all SCEVs Polly allows in all kinds of expressions. To this end we introduce a ScopExpander that handles the additional expressions separatly and falls back to the SCEVExpander for everything else. Reviewers: grosser, Meinersbur Subscribers: #polly Differential Revision: http://reviews.llvm.org/D12066 llvm-svn: 245288
* [FIX] Create location if a needed value was not yet demotedJohannes Doerfert2015-08-171-28/+2
| | | | | | | | | | | | | | | | | This allows the code generation to continue working even if a needed value (that is reloaded anyway) was not yet demoted. Instead of failing it will now create the location for future demotion to memory and load from that location. The stores will use the same location and by construction execute before the load even if the textual order in the generated AST is otherwise. Reviewers: grosser, Meinersbur Subscribers: #polly Differential Revision: http://reviews.llvm.org/D12072 llvm-svn: 245203
* Add 2nd test case for sdiv/srem instructions in a SCEVTobias Grosser2015-08-161-0/+43
| | | | llvm-svn: 245186
* [FIX] Add XFAIL to crashing test caseJohannes Doerfert2015-08-161-0/+4
| | | | llvm-svn: 245180
* Add a crashing test case for the scalar code generationJohannes Doerfert2015-08-161-0/+66
| | | | | | | | | | | This test case crashes the scalar code generation as we are not consistent with the usage of the assumed context. To be precise, we use the assumed context for the dependence analysis but not to restrict the domains of the statements. A step by step explanation of the problem is given in the test case. llvm-svn: 245176
* Fix test case after recent LLVM changesTobias Grosser2015-08-131-2/+2
| | | | llvm-svn: 244954
* Manuallt simplify test caseTobias Grosser2015-08-131-5/+1
| | | | llvm-svn: 244907
* Add test case for SCEV synthesizingMichael Kruse2015-08-131-0/+50
| | | | | | | CodeGenerator currently tries to generate code for a parameter using values values that are computed later. llvm-svn: 244903
OpenPOWER on IntegriCloud