summaryrefslogtreecommitdiffstats
path: root/polly/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ScopInfo] Replace isl foreach calls with for loopsTobias Grosser2018-07-161-18/+6
| | | | | | | | After Philip added support for range-based for loops to our C++ bindings, we now convert another bunch of foreach calls to range-for loops. This improves general readability of the code. llvm-svn: 337201
* [Polly][isl] Add neutrally-named accessors to isl list elements and sizesPhilip Pfaffe2018-07-131-0/+84
| | | | | | | | | | | | | | Summary: This could simplify the isl iterator implementation a lot. Reviewers: grosser, Meinersbur, bollu Reviewed By: grosser Subscribers: pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D49019 llvm-svn: 337054
* Add a file that was missing in r336425Philip Pfaffe2018-07-061-0/+513
| | | | llvm-svn: 336430
* Update isl to isl-0.19-224-gce84a511Tobias Grosser2018-07-0624-640/+424
| | | | | | | | This is a maintenance update. Besides many minor changes it ships two functions "isl_*_list_size" and "isl_*_list_get_at" which will allow us to simplify the iterator implementation in Polly. llvm-svn: 336425
* [ScopInfo] Move foldSizeConstantsToRight() to isl++Tobias Grosser2018-07-051-61/+30
| | | | | | | | | | | | | | Summary: This patch updates the isl interface used in `foldSizeConstantsToRight()` to the new C++ interface. Reviewers: chelini, grosser, philip.pfaffe, Meinersbur Reviewed By: grosser Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D48965 llvm-svn: 336362
* [CodeGen] Fix potential null pointer dereference. NFC.Michael Kruse2018-07-051-3/+5
| | | | | | | | | | ScalarEvolution::getSCEV dereferences its argument, s.t. passing nullptr leads to undefined behaviour. Check for nullptr before calling it instead of checking its argument afterwards. llvm-svn: 336350
* [PPCGCodeGen] Change printf to outs() to prevent garbled output. [NFC]Siddharth Bhat2018-07-041-8/+8
| | | | | | | | | | | | | | | | | Summary: It appears that llvm uses unbuffered C++ streams. So, we should not mix C and C++ stream operations, because that will give us mixed up output. Reviewers: efriedma, jdoerfert, Meinersbur, gareevroman, sebpop, zinob, huihuiz, pollydev, grosser, singam-sanjay, philip.pfaffe Reviewed By: philip.pfaffe Subscribers: nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D40126 llvm-svn: 336288
* ScopInfo: simplify equivalence classes before storing them [NFCI]Tobias Grosser2018-07-041-0/+2
| | | | | | | | | This change has no impact on upstream Polly directly, but reduces output noise for some internal isl versions we are testing. In general, storing simpler and more canonical output is a good idea. Hence, it seems useful to upstream this change. llvm-svn: 336281
* [Polly-ACC] Add isl_space.h to gpu_tree.cSiddharth Bhat2018-07-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds <isl_space.h> to gpu_tree.c. This prevents a segfault when allocating a new isl_space in the function create_sync_domain(), as the compiler now knows that the return type is a pointer instead of assuming the function returns an int. This has been updated in upstream PPCG, so we should bump up our PPCG version. Initially discovered by Philip Pfaffe in Polly. Reviewers: grosser, bollu, philip.pfaffe Reviewed By: bollu Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D48883 Contributed-by: Alain Denzler <alaindenzler@gmail.com> llvm-svn: 336251
* [polly-acc] change cl_get_* return types to 32/64bitPhilip Pfaffe2018-07-021-9/+17
| | | | | | | | | | | | | | | | | | | Summary: This patch changes the return types for ocl_get_* functions during SPIR code generation. Because these functions return size_t types, the return type needs to be changed to the actual size of size_t on the device. Based on work by Michal Babej and Pekka Jääskeläinen Patch by: Alain Denzler Reviewers: grosser, philip.pfaffe, bollu Reviewed By: grosser, philip.pfaffe Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D48774 llvm-svn: 336080
* Use range for in normalizeValInst [NFCI]Tobias Grosser2018-06-291-27/+25
| | | | llvm-svn: 335971
* Translate a couple of foreach callbacks into range-based iterator loopsTobias Grosser2018-06-291-38/+25
| | | | | | | Thanks to Philip Pfaffe for providing iterator support in the previous commit. llvm-svn: 335970
* [ScopHelper] Provide support for recognising collective invariant loadsPhilip Pfaffe2018-06-292-13/+63
| | | | | | | | | | | | | | Summary: This patch aims to provide support for detecting load patterns which are collectively invariant but right now `isHoistableLoad()` is checking each load instruction individually which cannot detect the load pattern as a whole. Patch by: Sahil Girish Yerawar Reviewers: bollu, philip.pfaffe, Meinersbur Reviewed By: philip.pfaffe, Meinersbur Differential Revision: https://reviews.llvm.org/D48026 llvm-svn: 335949
* [ScopHelper] Cache ScopExpander results.Eli Friedman2018-06-271-0/+12
| | | | | | | | | | | | | | | | | | | The number of SCEV expressions is usually linear in the number of IR instructions being modeled. However, a naive SCEV visitor is not. For an expression like x*x, "x" will be visited twice. If x is itself an expression like x*x, that will be visited twice, etc, and the overall runtime is O(2^N) in the number of SCEV expressions. To prevent this from happening, add a cache, so we only visit each SCEV expression once. Not sure this is the best solution. Maybe we can instead check whether the SCEV is scop-invariant (in which case we never need to map the value). But we don't have a utility for that at the moment. Differential Revision: https://reviews.llvm.org/D47087 llvm-svn: 335783
* [ZoneAlgo] Use getDefToTarget in makeValInst. NFC.Michael Kruse2018-06-262-115/+85
| | | | | | | | | | | | Move the optimized getDefToTarget() from ForwardOpTree to ZoneAlgo such that it can be used by makeValInst. This reduces the compile time of GrTestUtils of the aosp buildbot from 2m46s to 21s, which should fix the timeout issue. Differential Revision: https://reviews.llvm.org/D48579 llvm-svn: 335606
* Move ScopInfo to isl++Tobias Grosser2018-06-191-2/+1
| | | | llvm-svn: 335029
* Adjust for clang-format changesTobias Grosser2018-06-181-6/+6
| | | | llvm-svn: 334941
* [ScopInfo] Move splitAliasGroupsByDomain and getAccessDomain to isl++ [NFCI]Tobias Grosser2018-06-181-10/+8
| | | | llvm-svn: 334940
* [ScopInfo] Move more functions to isl++ [NFCI]Tobias Grosser2018-06-181-24/+17
| | | | | | | | | | | This change includes: - getFortranArrayIds - adjustDomainDimensions - propagateInvalidStmtDomains - buildAliasGroupsForAccesses llvm-svn: 334939
* [ScopInfo] Move addNonEmptyDomainConstraints to isl++ [NFCI]Tobias Grosser2018-06-181-2/+2
| | | | llvm-svn: 334938
* Move buildConditionSet to C++Tobias Grosser2018-06-181-16/+21
| | | | llvm-svn: 334937
* Simplify the implementation of getCUDALibDeviceFunction. NFC.Philip Pfaffe2018-06-141-13/+9
| | | | | | | | | | | | | | | | Summary: The function is currently awfully complicated. Drop the IILE and use StringRef over std::string. Reviewers: Meinersbur, grosser, bollu Reviewed By: Meinersbur Subscribers: nemanjai, kbarton, bollu, llvm-commits, pollydev Differential Revision: https://reviews.llvm.org/D48070 llvm-svn: 334695
* Drop unnecessary whitespace [NFCI]Tobias Grosser2018-06-111-2/+2
| | | | llvm-svn: 334413
* [ScopBuilder] Slightly improve code structure [NFCI]Tobias Grosser2018-06-111-1/+2
| | | | | | | | First build the surrounding loops and then build up the polyhedral structures. Before r326664 we had to mix these updates, clean this up to improve readability (slightly). llvm-svn: 334412
* Update isl to isl-0.19-185-g8e9f55ceTobias Grosser2018-06-1126-85/+733
| | | | | | This is mainly a maintenance update. llvm-svn: 334406
* Run clang-formatPhilip Pfaffe2018-06-071-1/+1
| | | | llvm-svn: 334172
* Fix a missing lambda return type that tripped the buildersPhilip Pfaffe2018-06-071-1/+1
| | | | llvm-svn: 334166
* [OpTree] Introduce shortcut for computing the def->target mapping. NFCI.Michael Kruse2018-06-062-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case the schedule has not changed and the operand tree root uses a value defined in an ancestor loop, the def-to-target mapping is trivial. For instance, the SCoP for (int i < 0; i < N; i+=1) { DefStmt: D = ...; for (int j < 0; j < N; j+=1) { TargetStmt: use(D); } } has DefStmt-to-TargetStmt mapping of { DefStmt[i] -> TargetStmt[i,j] } This should apply on the majority of def-to-target mappings. This patch detects this case and directly constructs the expected mapping. It assumes that the mapping never crosses the loop header DefStmt is in, which ForwardOpTree does not support at the moment anyway. Differential Revision: https://reviews.llvm.org/D47752 llvm-svn: 334134
* getDependences to new C++ interfaceTobias Grosser2018-06-066-23/+30
| | | | | | | | | | | | | | Reviewers: Meinersbur, grosser, bollu, cs15btech11044, jdoerfert Reviewed By: grosser Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D47786 llvm-svn: 334092
* Fix formattingTobias Grosser2018-06-051-1/+1
| | | | llvm-svn: 333988
* Update for a header file move in LLVMDavid Blaikie2018-06-042-2/+2
| | | | llvm-svn: 333956
* partitionSetParts from C to C++ interface.Tobias Grosser2018-06-011-41/+32
| | | | | | | | | | | | | | | | Summary: partitionSetParts from C to new C++ interface. Reviewers: grosser, Meinersbur, jdoerfert, bollu, cs15btech11044 Reviewed By: grosser, Meinersbur Subscribers: llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D47252 llvm-svn: 333780
* [ZoneAlgo] Make ZoneAlgorithm::isNormalized out-of-quota safe.Michael Kruse2018-05-312-12/+21
| | | | | | | | | | | | | | | The aosp-O3-polly-before-vectorizer-unprofitable buildbot currently fails in ZoneAlgorithm::isNormalized, presumably because an out-of-quota happens in that function. Modify ZoneAlgorithm::isNormalized to return an isl::boolean such it can report an error. In the failing case, it was called in an assertion in ForwardOpTree. Allow to pass the assertion in an out-of-quota event, a condition that is later checked before forwarding an operand tree. llvm-svn: 333709
* Update isl C++ bindingsTobias Grosser2018-05-311-0/+1267
| | | | | | | | | | | | | This update adds new list types and adds functions which convert isl data types to lists of their contained elements: isl::set::get_basic_set_list isl::union_set::get_set_list isl::map::get_basic_map_list isl::union_map::get_map_list llvm-svn: 333688
* Update isl to isl-0.19-173-g77fe2538Tobias Grosser2018-05-3132-52/+343
| | | | | | | | | Besides other changes, this update introduces functions to translate a maps and sets into lists of their elements. These lists are useful as we can define iterators for lists, which allow us to replace many uses of foreach. llvm-svn: 333621
* [ForwardOpTree] Use less computationally expensive method to compute ↵Michael Kruse2018-05-291-59/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | def-to-target map. NFCI. When forwarding a LoadInst to another statement, a map that translates their domain is needed. Before this patch, is was computed by appending the def-to-use map to the def-to-target of the operand tree's target. This patch lets the new method getDefToTarget do this. This is computationally less expensive due to: * Caching of the result such that it can be used for multiple operands tree to the same target. * The map is only computed when there is a LoadInst that needs it. * It is only computed for the statement requiring the translator map, instead of having an intermediate result for every edge in the operand tree. The downside is that this scheme cannot handle forwarding from a previous loop iteration (which would require the entire path from statement to target). Since ForwardOpTree currently does not support forwarding across loop iterations (SCEV expressions would need to be transformed), this was not needed anyway. Differential Revision: https://reviews.llvm.org/D47385 llvm-svn: 333426
* [ScopInfo] Update Scop::addUserContext() to C++ interfaceTobias Grosser2018-05-281-21/+10
| | | | | | | | | | | | | | Summary: This patch updates `Scop::addUserContext()` function to the new C++ interface and replaces the `auto` keyword with explicit type wherever used in this function. Reviewers: grosser, bollu, philip.pfaffe, chelini, Meinersbur Reviewed By: grosser Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47438 llvm-svn: 333366
* Update isl to isl-0.19-152-g437e6ab0Tobias Grosser2018-05-2355-290/+669
| | | | | | | | Besides normal updates this change also contains a bug-fix to in isl_coalesce which broke the AOSP buildbot. Thanks to Michael Kruse for reporting this bug and Sven Verdoolage for fixing this bug. llvm-svn: 333118
* createNextIterationMap from C to C++ interfaceTobias Grosser2018-05-231-13/+13
| | | | | | | | | | | | | | | | Summary: update createNextIterationMap function to new C++ interface. Reviewers: grosser, Meinersbur, jdoerfert, bollu, cs15btech11044 Reviewed By: cs15btech11044 Subscribers: llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D47102 llvm-svn: 333113
* [Acc] Re-land r326643 to finally fix PR33208.Philip Pfaffe2018-05-231-2/+4
| | | | | | | Other than before, don't clear out LI entirely but only those relevant loops. llvm-svn: 333089
* CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne2018-05-211-2/+3
| | | | | | | | | | up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
* [polly] Drop nonexistant LLVM_PLUGIN_EXPORT macro from llvmGetPassPluginInfo()Roman Lebedev2018-05-191-1/+1
| | | | | | | | | | | | Fixes build: /build/polly/lib/Support/RegisterPasses.cpp:709:80: error: expected ';' after top level declarator extern "C" ::llvm::PassPluginLibraryInfo LLVM_ATTRIBUTE_WEAK LLVM_PLUGIN_EXPORT ^ ; Was missed in rL332796 / D47082 llvm-svn: 332814
* [SCEVAffinator] BB can be null; don't use it to get the LLVMContext.Eli Friedman2018-05-181-1/+1
| | | | | | Fixes post-commit review comment on r332309. llvm-svn: 332775
* [DeLICM] Avoid assertion on out-of-quota.Michael Kruse2018-05-161-0/+4
| | | | | | | | | | An assertion was not prepared to be passed a nullptr because the out-of-quota limit was exceeded. Bail-out before the assertion since the assertion does not apply on out-of-quote. This fixes llvm.org/PR37477. llvm-svn: 332488
* [ScopInfo] Remove usage of isl_set_n_basic_set()Philip Pfaffe2018-05-161-14/+12
| | | | | | | | | | Summary: This patch aims to remove the usage of old C-styled isl functions (in this case `isl_set_n_basic_set()`) in favor of new C++ isl interface based methods in `ScopInfo.cpp`. Patch by Sahil Yerawar Differential Revision: https://reviews.llvm.org/D46935 llvm-svn: 332471
* [SI] Create Scop Name lazilyPhilip Pfaffe2018-05-151-2/+2
| | | | | | | | | | | | | Summary: Creating the Scop name is expensive, because creating the Region name it's derived from is expensive. So create the name lazily, because getName() is actually called rarely. This is a reiteration of r328666, which introduced a use-after-free and got reverted in r331363. Differential Revision: https://reviews.llvm.org/D46868 llvm-svn: 332359
* [polly] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-1521-238/+268
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44978 llvm-svn: 332352
* [SCEVAffinator] Fix handling of pwaff complexity limit.Eli Friedman2018-05-141-3/+11
| | | | | | | | | | | nullptr is not a valid affine expression, and none of the callers check for null, so we eventually hit an isl error and crash. Instead, invalidate the scop and return a constant zero. Differential Revision: https://reviews.llvm.org/D46445 llvm-svn: 332309
* [ScopInfo] Remove bail out condition in buildMinMaxAccess().Michael Kruse2018-05-091-12/+10
| | | | | | | | | | | | | | | | | | | | | The condition was introduced in r267142 to mitigate a long compile-time case. In r306087, a max-computation limit was introduced that should handle the same case while leaving the max disjuncts heuristic it should have replaced intact. Today, the max disjuncts bail-out causes problems in that it prematurely stops SCoPs from being detected, e.g. in SPEC's lbm. This would hit less like if isl_set_coalesce would be called after isl_set_remove_divs (which makes more basic_set likely to be coalescable) instead of before. This patch tries to remove the premature max-disjuncts bail-out condition by using simple_hull() to reduce the computational overhead, instead of directly invalidating that SCoP. Differential Revision: https://reviews.llvm.org/D45066 Contributed-by: Sahil Girish Yerawar <cs15btech11044@iith.ac.in> llvm-svn: 331891
* Revert "[polly] [ScopInfo] Don't pre-compute the name of the Scop's region."Philip Pfaffe2018-05-021-2/+2
| | | | | | | | | This reverts commit 0f9dc03765dc301fff7a52e2a0e1dd3e5f3130c5, r328666. The change introduced a use-after-free, caused by the temporary name string being destroyed after converting it to a StringRef. llvm-svn: 331363
OpenPOWER on IntegriCloud