summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/LoopGenerators.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] LLVM OpenMP Backend.Michael Kruse2019-03-191-168/+40
| | | | | | | | | | | | | | | | | | | | | The ParallelLoopGenerator class is changed such that GNU OpenMP specific code was removed, allowing to use it as super class in a template-pattern. Therefore, the code has been reorganized and one may not use the ParallelLoopGenerator directly anymore, instead specific implementations have to be provided. These implementations contain the library-specific code. As such, the "GOMP" (code completely taken from the existing backend) and "KMP" variant were created. For "check-polly" all tests that involved "GOMP": equivalents were added that test the new functionalities, like static scheduling and different chunk sizes. "docs/UsingPollyWithClang.rst" shows how the alternative backend may be used. Patch by Michael Halkenhäuser <michaelhalk@web.de> Differential Revision: https://reviews.llvm.org/D59100 llvm-svn: 356434
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix the build after r314375Philip Pfaffe2017-09-281-1/+1
| | | | | | r314375 privatized Loop's constructor and replaced it with an Allocator. llvm-svn: 314412
* Disable the Loop Vectorizer in case of GEMMRoman Gareev2017-08-221-3/+3
| | | | | | | | | | | | | | Currently, in case of GEMM and the pattern matching based optimizations, we use only the SLP Vectorizer out of two LLVM vectorizers. Since the Loop Vectorizer can get in the way of optimal code generation, we disable the Loop Vectorizer for the innermost loop using mark nodes and emitting the corresponding metadata. Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D36928 llvm-svn: 311473
* Fix a lot of typos. NFC.Michael Kruse2017-06-081-2/+2
| | | | llvm-svn: 304974
* [Polly] Remove unused headerHongbin Zheng2017-05-121-2/+0
| | | | llvm-svn: 302868
* [Polly] Generate more 'canonical' induction variableHongbin Zheng2017-05-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | Today Polly generates induction variable in this way: polly.indvar = phi 0, polly.indvar.next ... polly.indvar.next = polly.indvar + stide polly.loop_cond = predicate polly.indvar, (UB - stride) Instead of: polly.indvar = phi 0, polly.indvar.next ... polly.indvar.next = polly.indvar + stide polly.loop_cond = predicate polly.indvar.next, UB The way Polly generate induction variable cause some problem in the indvar simplify pass. This patch make polly generate the later form, by assuming the induction variable never overflow Differential Revision: https://reviews.llvm.org/D33089 llvm-svn: 302866
* Exploit BasicBlock::getModule to shorten codeTobias Grosser2017-04-111-2/+1
| | | | | Suggested-by: Roman Gareev <gareevroman@gmail.com> llvm-svn: 299914
* SAdjust to recent change in constructor definition of AllocaInstTobias Grosser2017-04-111-2/+2
| | | | llvm-svn: 299913
* Update for alloca construction changesMatt Arsenault2017-04-111-1/+5
| | | | llvm-svn: 299905
* Fix formatting in LoopGeneratorsPhilip Pfaffe2017-04-041-2/+2
| | | | llvm-svn: 299424
* [Polly][NewPM] Pull references to the legacy PM interface from utilities and ↵Philip Pfaffe2017-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | helpers Summary: A couple of the utilities used to analyze or build IR make explicit use of the legacy PM on their interface, to access analysis results. This patch removes the legacy PM from the interface, and just passes the required results directly. This shouldn't introduce any function changes, although the API technically allowed to obtain two different analysis results before, one passed by reference and one through the PM. I don't believe that was ever intended, however. Reviewers: grosser, Meinersbur Reviewed By: grosser Subscribers: nemanjai, pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D31653 llvm-svn: 299423
* [OpenMP] Do not emit lifetime markers for contextTobias Grosser2017-03-181-9/+0
| | | | | | | | | | | | | | | | | | In commit r219005 lifetime markers have been introduced to mark the lifetime of the OpenMP context data structure. However, their use seems incorrect and recently caused a miscompile in ASC_Sequoia/CrystalMk after r298053 which was not at all related to r298053. r298053 only caused a change in the loop order, as this change resulted in a different isl internal representation which caused the scheduler to derive a different schedule. This change then caused the IR to change, which apparently created a pattern in which LLVM exploites the lifetime markers. It seems we are using the OpenMP context outside of the lifetime markers. Even though CrystalMk could probably be fixed by expanding the scope of the lifetime markers, it is not clear what happens in case the OpenMP function call is in a loop which will cause a sequence of starting and ending lifetimes. As it is unlikely that the lifetime markers give any performance benefit, we just drop them to remove complexity. llvm-svn: 298192
* Fix clang-formatTobias Grosser2016-12-191-2/+5
| | | | llvm-svn: 290103
* clang-tidy: apply modern-use-nullptr fixesTobias Grosser2016-06-221-3/+3
| | | | | | | | | | Instead of using 0 or NULL use the C++11 nullptr symbol when referencing null pointers. This cleanup was suggested by Eugene Zelenko <eugene.zelenko@gmail.com> in http://reviews.llvm.org/D21488 and was split out to increase readability. llvm-svn: 273435
* This reverts recent expression type changesTobias Grosser2016-06-111-8/+1
| | | | | | | | | | | | | | | | | | | | | The recent expression type changes still need more discussion, which will happen on phabricator or on the mailing list. The precise list of commits reverted are: - "Refactor division generation code" - "[NFC] Generate runtime checks after the SCoP" - "[FIX] Determine insertion point during SCEV expansion" - "Look through IntToPtr & PtrToInt instructions" - "Use minimal types for generated expressions" - "Temporarily promote values to i64 again" - "[NFC] Avoid unnecessary comparison for min/max expressions" - "[Polly] Fix -Wunused-variable warnings (NFC)" - "[NFC] Simplify min/max expression generation" - "Simplify the type adjustment in the IslExprBuilder" Some of them are just reverted as we would otherwise get conflicts. I will try to re-commit them if possible. llvm-svn: 272483
* Simplify the type adjustment in the IslExprBuilderJohannes Doerfert2016-06-021-1/+8
| | | | | | | | | We now have a simple function to adjust/unify the types of two (or three) operands before an operation that requieres the same type for all operands. Due to this change we will not promote parameters that are added to i64 anymore if that is not needed. llvm-svn: 271513
* Adjust formatting to clang-format changes in 256149Tobias Grosser2015-12-211-1/+1
| | | | llvm-svn: 256151
* polly/ADT: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-11-061-7/+7
| | | | | | | | | | | | | Remove all the implicit ilist iterator conversions from polly, in preparation for making them illegal in ADT. There was one oddity I came across: at line 95 of lib/CodeGen/LoopGenerators.cpp, there was a post-increment `Builder.GetInsertPoint()++`. Since it was a no-op, I removed it, but I admit I wonder if it might be a bug (both before and after this change)? Perhaps it should be a pre-increment? llvm-svn: 252357
* Move the ValueMapT declaration out of BlockGeneratorJohannes Doerfert2015-10-071-5/+3
| | | | | | | | | | | Value maps are created and used in many places and it is not always possible to include CodeGen/Blockgenerators.h. To this end, ValueMapT now lives in the ScopHelper.h which does not have any dependences itself. This patch also replaces uses of different other value map types with the ValueMapT. llvm-svn: 249606
* OpenMP: Name addresses in subfunction structureTobias Grosser2015-09-281-0/+1
| | | | | | | While debugging, this makes it easier to understand due to which memory reference these stores have been introduced. llvm-svn: 248717
* Do not use '.' in subfunction namesTobias Grosser2015-09-081-1/+7
| | | | | | | | | | 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
* OpenMP: Name the values passed to the subfunciton according to the original ↵Tobias Grosser2015-09-051-0/+1
| | | | | | llvm::Values llvm-svn: 246924
* Fix typoTobias Grosser2015-08-191-1/+1
| | | | llvm-svn: 245441
* Adapt to IRBuilder::CreateCall interface changeTobias Grosser2015-05-191-2/+2
| | | | | | | The IRBuilder::CreateCall interface was changed in r237624 and now requires an initializer list. llvm-svn: 237666
* Revert "Adjust formatting to latest clang-format change"Tobias Grosser2015-05-111-6/+1
| | | | | | | This reverts commit 236875. Daniel fixed the clang-format bug that introduced the changed formatting. llvm-svn: 236994
* Sort include directivesTobias Grosser2015-05-091-1/+1
| | | | | | | | | | Upcoming revisions of isl require us to include header files explicitly, which have previously been already transitively included. Before we add them, we sort the existing includes. Thanks to Chandler for sort_includes.py. A simple, but very convenient script. llvm-svn: 236930
* Adjust formatting to latest clang-format changeTobias Grosser2015-05-081-1/+6
| | | | llvm-svn: 236875
* [opaque pointer type] More GEP API migrationsDavid Blaikie2015-04-051-13/+13
| | | | llvm-svn: 234131
* [PM] Update Polly for LLVM r226394 and r226396 which changed some of theChandler Carruth2015-01-181-1/+1
| | | | | | | block splitting interfaces to accept specific analyses rather than a pass. llvm-svn: 226398
* [PM] Update Polly for LLVM r226385 which made LoopInfo actually deriveChandler Carruth2015-01-181-3/+3
| | | | | | | from LoopInfoBase<...>, removing the need for the awkward getBase() dance. llvm-svn: 226387
* Add PreHeader always to OuterLoopTobias Grosser2014-11-251-3/+4
| | | | | | This fixes a bug introduce in r217525. llvm-svn: 222766
* [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
* Put the parallel context alloca into the function entry block.Johannes Doerfert2014-10-031-2/+15
| | | | | | | | We use lifetime markers to limit the actual life range (similar to clang). Differential Revision: http://reviews.llvm.org/D5582 llvm-svn: 219005
* Add option to limit the maximal number of parallel threads.Johannes Doerfert2014-10-031-1/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D5581 llvm-svn: 219004
* [Refactor] Generalize parallel code generationJohannes Doerfert2014-10-031-122/+95
| | | | | | | | | | | | | + Generalized function names and comments + Removed OpenMP (omp) from the names and comments + Use common names (non OpenMP specific) for runtime library call creation methodes + Commented the parallel code generator and all its member functions + Refactored some values and methodes Differential Revision: http://reviews.llvm.org/D4990 llvm-svn: 219003
* [Refactor] Rename LoopAnnotator to ScopAnnotatorJohannes Doerfert2014-10-021-1/+1
| | | | | | | | | The LoopAnnotator doesn't annotate only loops any more, thus it is called ScopAnnotator from now on. This also removes unnecessary polly:: namespace tags. llvm-svn: 218878
* Annotate LLVM-IR for all parallel loopsJohannes Doerfert2014-10-011-7/+11
| | | | | | | | | | | | | | 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
* Allow to generate a loop without the GuardBBJohannes Doerfert2014-09-101-40/+47
| | | | | | | | | | | | 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
* Make used analysis passes explicitJohannes Doerfert2014-08-071-4/+4
| | | | | | | | Use the explicit analysis if possible, only for splitBlock we will continue to use the Pass * argument. This change allows us to remove the getAnalysis calls from the code generation. llvm-svn: 215121
* [Refactor] Use attributes to mark function as invalid for pollyJohannes Doerfert2014-07-151-1/+1
| | | | | | | + Test case annotated with the new attribute + Modified test case to check if subfunctions are annotated llvm-svn: 213093
* Use range-based for loopsTobias Grosser2014-06-041-2/+2
| | | | llvm-svn: 210170
* clang-format: Remove empty linesTobias Grosser2014-03-211-1/+0
| | | | llvm-svn: 204468
* avoid warningSebastian Pop2014-03-131-2/+2
| | | | | warning: multi-line comment [-Wcomment] llvm-svn: 203811
* Emit llvm.loop metadata for parallel loopsTobias Grosser2014-03-041-1/+8
| | | | | | | For now we only mark innermost loops for the loop vectorizer. We could later also mark not-innermost loops to enable the introduction of openmp parallelism. llvm-svn: 202854
* Introduce PollyIRBuilderTobias Grosser2014-03-041-1/+1
| | | | | | | | PollyIRBuilder is currently just a typedef to IRBuilder<>. Consequently, this change should not affect behavior. In subsequent patches we will extend its functionality to emit loop.parallel metadata. llvm-svn: 202853
* Use C++11 formattingTobias Grosser2014-03-021-8/+8
| | | | | | | clang-formats behaviour has changed for a couple of C++11 formattings. We adapt Polly to ensure our formatting checks are clean again. llvm-svn: 202650
* Update for llvm api change.Rafael Espindola2014-02-251-1/+2
| | | | llvm-svn: 202183
* Adapt to DomTree changes in r199104Tobias Grosser2014-01-131-2/+2
| | | | llvm-svn: 199157
OpenPOWER on IntegriCloud