summaryrefslogtreecommitdiffstats
path: root/polly
Commit message (Collapse)AuthorAgeFilesLines
...
* [ScopBuilder/Simplify] Refactor isEscaping. NFC.Michael Kruse2017-07-274-41/+26
| | | | | | | | | | | | ScopBuilder and Simplify (through VirtualInstruction.cpp) previously used this functionality in their own implementation. Refactor them both into a common one into the Scop class. BlockGenerator also makes use of a similiar functionality, but also records outside users and takes place after region simplification. Merging it as well would be more complicated. llvm-svn: 309273
* [Simplify] Count PHINodes in simplifiable exit nodes as escaping use.Michael Kruse2017-07-272-0/+44
| | | | | | | | | After region exit simplification, the incoming block of a phi node in the SCoP region's exit block lands outside of the region. Since we treat SCoPs as if this already happened, we need to account for that when looking for outside uses of scalars (i.e. escaping scalars). llvm-svn: 309271
* [ScopInfo] Never print instruction list of region stmts.Michael Kruse2017-07-261-1/+1
| | | | | | | A region statement's instruction list is always empty and ignored by the code generator. Don't give the impression that it means anything. llvm-svn: 309197
* [Simplify] Do not setInstructions() of region stmts. NFC.Michael Kruse2017-07-262-0/+5
| | | | | | | The instruction list is ignored for region statements, there is no reason to set it. llvm-svn: 309196
* [Simplify] Fix invalid removal write for escaping values.Michael Kruse2017-07-262-2/+46
| | | | | | | | | A PHI node's incoming block is the user of its operand, not the PHI's parent. Assuming the PHINode's parent being the user lead to the removal of a MemoryAccesses because its use was assumed to be inside of the SCoP. llvm-svn: 309164
* [ScheduleOptimizer] Translate to C++ bindingsRoman Gareev2017-07-262-409/+313
| | | | | | | | | | Translate the ScheduleOptimizer to use the new isl C++ bindings. Reviewed-by: Michael Kruse <llvm@meinersbur.de> Differential Revision: https://reviews.llvm.org/D35845 llvm-svn: 309119
* [ScopInfo] Avoid use of getStmtFor(BB). NFC.Michael Kruse2017-07-261-4/+5
| | | | | | | | | | | | | Since there will be no more a 1:1 correspondence between statements and basic blocks, we would like to get rid of the method getStmtFor(BB) and its uses. Here we remove one of its uses in ScopInfo by fetching the statement in which the call instruction lies. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D35691 llvm-svn: 309110
* [SCEVValidator] Loop exit values of loops before the SCoP are synthesizable.Michael Kruse2017-07-264-6/+147
| | | | | | | | | | | | | | | | | | | | | | | In the following loop: int i; for (i = 0; i < func(); i+=1) ; SCoP: for (int j = 0; j<n; j+=1) S(i, j) The value i is synthesizable in the SCoP that includes only the j-loop. This is because i is fixed within the SCoP, it is irrelevant whether it originates from another loop. This fixes a strange case where a PHI was synthesiable in a SCoP, but not its incoming value, triggering an assertion. This should fix MultiSource/Applications/sgefa/sgefa of the perf-x86_64-penryn-O3-polly-before-vectorizer-unprofitable buildbot. llvm-svn: 309109
* Revert accidental isl changes in 308923Tobias Grosser2017-07-251-71/+6
| | | | | | | | | | | It seems I still had some incomplete changes in the tree when committing. In general, we only import changes from isl upstream. In this case, the changes were especially unfortunate, as they broke the error management in isl_flow.c and consequently caused regressions. Thanks to Michael Kruse for spotting this mistake. llvm-svn: 309039
* [ScopInfo] Rename ScopStmt::contains(BB) to represents(BB). NFC.Michael Kruse2017-07-254-7/+7
| | | | | | | | | | | In future, there will be no more a 1:1 correspondence between statements and basic blocks, the name `contains` does not correctly capture their relationship. A BB may infact comprise of multiple statements; hence we describe a statement 'representing' a basic block. Differential Revision: https://reviews.llvm.org/D35838 llvm-svn: 308982
* [IslAst] Untangle IslAst lit-testcases from specifics of the legacy-PMPhilip Pfaffe2017-07-256-12/+4
| | | | | | | | | | | | | | | | | | | | Summary: This consists instances of two changes: - Accept any order of checks for a specific loop form, that appear in different order in the new vs legacy-PM. - Remove checks for specific regions. Reviewers: grosser Reviewed By: grosser Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D35837 llvm-svn: 308976
* [ScopInfo] Fix assertion for PHIs not in a region stmts entry.Michael Kruse2017-07-252-1/+63
| | | | | | | A PHI node within a region statement is legal, but does not have a MemoryKind::PHI access. llvm-svn: 308973
* [PPCGCodeGeneration] Skip arrays with empty extent.Siddharth Bhat2017-07-252-4/+103
| | | | | | | | | | | | | | | | | Invariant load hoisted scalars, and arrays whose size we can statically compute to be 0 do not need to be allocated as arrays. Invariant load hoisted scalars are sent to the kernel directly as parameters. Earlier, we used to allocate `0` bytes of memory for these because our computation of size from `PPCGCodeGeneration::getArraySize` would result in `0`. Now, since we don't invariant loads as arrays in PPCGCodeGeneration, this problem does not occur anymore. Differential Revision: https://reviews.llvm.org/D35795 llvm-svn: 308971
* Move MemoryAccess::isStride* to isl++Tobias Grosser2017-07-244-45/+38
| | | | llvm-svn: 308927
* Move MemoryAccess::InvalidDomain to isl++Tobias Grosser2017-07-243-23/+83
| | | | llvm-svn: 308923
* Move MemoryAccess::getPwAff to isl++Tobias Grosser2017-07-242-13/+13
| | | | llvm-svn: 308895
* Move MemoryAccess::MemoryAccess to isl++Tobias Grosser2017-07-242-8/+8
| | | | llvm-svn: 308893
* Move ScopArrayInfo::getFromAccessFunction and getFromId to isl++Tobias Grosser2017-07-245-18/+29
| | | | llvm-svn: 308892
* [ForwardOpTree] Properly indent enumeration in comment. NFC.Michael Kruse2017-07-241-4/+4
| | | | llvm-svn: 308887
* [ForwardOpTree] Rename FD_CanForward to FD_CanForwardLeaf. NFC.Michael Kruse2017-07-241-4/+4
| | | | | | To make the meaning and distinction to FD_CanForwardTree clearer. llvm-svn: 308886
* [ForwardOpTree] Add comments to ForwardingDecision items. NFC.Michael Kruse2017-07-241-0/+30
| | | | | | | In particular, explain the difference between FD_CanForward and FD_CanForwardTree. llvm-svn: 308885
* [ForwardOpTree] Support read-only value uses.Michael Kruse2017-07-246-7/+149
| | | | | | | | | | | | Read-only values (values defined before the SCoP) require special handing with -polly-analyze-read-only-scalars=true (which is the default). If active, each use of a value requires a read access. When a copied value uses a read-only value, we must also ensure that such a MemoryAccess is available or is created. Differential Revision: https://reviews.llvm.org/D35764 llvm-svn: 308876
* [Polly] [NFC] [ScopDetection] Make `polly-only-func` perform regex scop name ↵Siddharth Bhat2017-07-242-6/+145
| | | | | | | | | | | | | | match. Summary: - We were using `.count` in `StringRef`, which matches substrings. - We may want to use this for equality as well. - Generalise this, so allow regexes as a parameter to `polly-only-func`. Differential Revision: https://reviews.llvm.org/D35728 llvm-svn: 308875
* [ForwardOpTree] Fix mixup in comment. NFC.Michael Kruse2017-07-241-2/+2
| | | | | | | | The cases DoIt==false and DoIt==true were mixed up. Thanks to Siddharth for noticing. llvm-svn: 308874
* [ScopInfo] Fix typo in method name. NFC.Michael Kruse2017-07-242-2/+2
| | | | | | | | prependInstrunction -> prependInstruction Thanks Nandini for noticing. llvm-svn: 308873
* Convert GPUNodeBuilder::getArraySize to islcpp.Siddharth Bhat2017-07-241-8/+11
| | | | | | | | | Note: PPCGCodeGeneration::pollyBuildAstExprForStmt is at https://reviews.llvm.org/D35770 Differential Revision: https://reviews.llvm.org/D35771 llvm-svn: 308870
* [NFC] Move PPCGCodeGeneration::pollyBuildAstExprForStmt to isl++.Siddharth Bhat2017-07-241-19/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D35771 llvm-svn: 308869
* Simplify: Adopt for translation of MemoryAccess::getAccessRelationTobias Grosser2017-07-231-1/+1
| | | | | | For some reason this one was missed earlier. llvm-svn: 308845
* Move MemoryAccess::get*ArrayId to isl++Tobias Grosser2017-07-233-14/+12
| | | | llvm-svn: 308843
* Move applyScheduleToAccessRelation to isl++Tobias Grosser2017-07-234-15/+15
| | | | llvm-svn: 308842
* Move MemoryAccess::getAddressFunction to isl++Tobias Grosser2017-07-234-6/+7
| | | | llvm-svn: 308841
* Move MemoryAccess::NewAccessRelation to isl++Tobias Grosser2017-07-2310-61/+55
| | | | | | We also move related accessor functions llvm-svn: 308840
* Move MemoryAccess::getOriginalAccessRelation to isl++Tobias Grosser2017-07-232-8/+8
| | | | llvm-svn: 308839
* Move MemoryAccess::AccessRelation to isl++Tobias Grosser2017-07-232-43/+36
| | | | llvm-svn: 308838
* Move MemoryAccess::createBasicAccessMap to isl++Tobias Grosser2017-07-232-9/+9
| | | | llvm-svn: 308837
* Move MemoryAccess::id to isl++Tobias Grosser2017-07-236-67/+72
| | | | llvm-svn: 308836
* [Simplify] Remove partial write accesses with empty domain.Michael Kruse2017-07-224-2/+126
| | | | | | | | | | | If the access relation's domain is empty, the access will never be executed. We can just remove it. We only remove write accesses. Partial read accesses are not yet supported and instructions in the statement might require the llvm::Value holding the read's result to be defined. llvm-svn: 308830
* [ScopInfo] Adapt indentation of instruction list printing.Michael Kruse2017-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | Change the indention of the last brace to align with the opening line. Before: Instructions { %val = fadd double %arg, 2.100000e+01 store double %val, double* %A } After: Instructions { %val = fadd double %arg, 2.100000e+01 store double %val, double* %A } llvm-svn: 308828
* [ForwardOpTree] Support hoisted invariant loads.Michael Kruse2017-07-222-5/+65
| | | | | | | | Hoisted loads can be trivially supported because there are no MemoryAccess to be modified, the loaded value is just available at code generation. llvm-svn: 308826
* [ForwardOpTree] Introduce the -polly-optree pass.Michael Kruse2017-07-2212-0/+769
| | | | | | | | | | | | | | | | | | This pass 'forwards' operand trees into statements that use them in order to avoid scalar dependencies. This minimal implementation handles only the case of speculatable instructions. We will successively add support for: - Hoisted loads - Read-only values - Synthesizable values - Loads - PHIs - Forwarding only parts of the tree Differential Revision: https://reviews.llvm.org/D35754 llvm-svn: 308825
* Move ScopArrayInfo to isl++Tobias Grosser2017-07-216-56/+51
| | | | | | This moves the full ScopArrayInfo class to isl++ llvm-svn: 308801
* Untangle ScopInfo lit-testcases from specifics of the legacy-PMPhilip Pfaffe2017-07-217-22/+19
| | | | | | | | | | | | | | | | | | | Summary: For the ScopInfo lit testsuite, this patch removes some dependences on output behaviour of the legacy PM. In most cases, these tests checked the tool output for labels created by the pass printer in the legacy PM. This doesn't work for the new PM anymore. Untangling the testcases is the first step to porting the testsuite for the new PM infrastructure. Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser Subscribers: llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D35727 llvm-svn: 308754
* [Polly][GPGPU] Added SPIR Code Generation and Corresponding Runtime Support ↵Philipp Schaad2017-07-215-43/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | for Intel Summary: Added SPIR Code Generation to the PPCG Code Generator. This can be invoked using the polly-gpu-arch flag value 'spir32' or 'spir64' for 32 and 64 bit code respectively. In addition to that, runtime support has been added to execute said SPIR code on Intel GPU's, where the system is equipped with Intel's open source driver Beignet (development version). This requires the cmake flag 'USE_INTEL_OCL' to be turned on, and the polly-gpu-runtime flag value to be 'libopencl'. The transformation of LLVM IR to SPIR is currently quite a hack, consisting in part of regex string transformations. Has been tested (working) with Polybench 3.2 on an Intel i7-5500U (integrated graphics chip). Reviewers: bollu, grosser, Meinersbur, singam-sanjay Reviewed By: grosser, singam-sanjay Subscribers: pollydev, nemanjai, mgorny, Anastasia, kbarton Tags: #polly Differential Revision: https://reviews.llvm.org/D35185 llvm-svn: 308751
* Annotate dump() functions with LLVM_DUMP_METHOD. NFC.Michael Kruse2017-07-212-6/+6
| | | | llvm-svn: 308749
* [ScopInfo] Don't compile dump() functions into non-assert builds. NFC.Michael Kruse2017-07-212-0/+16
| | | | | | This follows a convention used in LLVM. llvm-svn: 308748
* [ScopInfo] Print instructions in dump().Michael Kruse2017-07-218-31/+41
| | | | | | | | | | | | | | | | | | | Print a statement's instruction on dump() regardless of -polly-print-instructions. dump() is supposed to be used in the debugger only and never in regression tests. While debugging, get all the information we have and we are not bound to break anything. For non-dump purposes of print, forward the setting of -polly-print-instructions as parameters. Some calls to print() had to be changed because the PollyPrintInstructions setting is only available in ScopInfo.cpp. In ScheduleOptimizer.cpp, dump() was used in regression tests. That's not what dump() is for. The print parameter "PrintInstructions" will also be useful for an explicit print SCoP pass in a future patch. llvm-svn: 308746
* [NFC] [RegisterPasses] Fix typo: To early -> too early.Siddharth Bhat2017-07-211-1/+1
| | | | llvm-svn: 308743
* [NFC] [PPCGCodeGeneration] Print `verifyModule` failure to debug stream.Siddharth Bhat2017-07-211-0/+2
| | | | | | | If verifyModule fails, it is helpful to know why it failed. Add a log to the debug stream that prints the failure. llvm-svn: 308727
* Fix typo in function name Bllock -> BlockTobias Grosser2017-07-211-3/+3
| | | | llvm-svn: 308715
* [IslNodeBuilder] Relax complexity check in invariant loads and run it earlyTobias Grosser2017-07-204-93/+111
| | | | | | | | | | | | | | | | | | | | | | | | When performing invariant load hoisting we check that invariant load expressions are not too complex. Up to this commit, we performed this check by counting the sum of dimensions in the access range as a very simple heuristic. This heuristic is a little too conservative, as it prevents hoisting for any scops with a very large number of parameters. Hence, we update the heuristic to only count existentially quantified dimensions and set dimensions. We expect this to still detect the problematic expressions in h264 because of which this check was originally introduced. For some unknown reason, this complexity check was originally committed in IslNodeBuilder. It really belongs in ScopInfo, as there is no point in optimizing a program which we could have known earlier cannot be code generated. The benefit of running the check early is that we can avoid to even hoist checks that are expensive to code generate as invariant loads. This can be seen in the changed tests, where we now indeed detect the scop, but just not invariant load hoist the complicated access. We also improve the formatting of the code, document it, and use isl++ to simplify expressions. llvm-svn: 308659
OpenPOWER on IntegriCloud