summaryrefslogtreecommitdiffstats
path: root/polly/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [CodeGen] Fix order of PHINode and MA Write generation.Michael Kruse2019-05-201-1/+18
| | | | | | | | | | | | | | | | At the end of a region statement, the PHINode must be generated while the current IRBuilder's block is the region's exit node. For obvious reasons: The PHINode references the region's exiting block. A partial write would insert new control flow, i.e. insert new basic blocks between the exiting blocks and the current block. We fix this by generating the PHI nodes (region exit values) before generating any MemoryAccess's stores. This should fix the AOSP buildbot. Reported-by: Eli Friedman <efriedma@quicinc.com> llvm-svn: 361204
* [DependenceInfo] Remove dead initialization. NFC.Michael Kruse2019-05-201-2/+2
| | | | | | | | | | Fix scan-analyzer issue: Value stored to 'WARMemAccesses' during its initialization is never read Patch by Dominik Adamski <adamski.dominik@gmail.com> Signed-off-by: Dominik Adamski <adamski.dominik@gmail.com> llvm-svn: 361196
* [Polly] Don't crash on invalid delinearization result.Eli Friedman2019-05-141-1/+3
| | | | | | | | | | | | | | | | | | | In certain cases, it's possible for delinearization to decide one of the array dimensions should be some function of an induction variable inside the scop. Make sure if this happens, we refuse to use those dimensions for delinearization. Usually, we end up rejecting the scop before it actually crashes, but it looks like it's possible to slip past other checks in certain cases involving smax expressions. Fixes a crash that started showing up this week on the polly AOSP builder. As far as I can tell, this is a longstanding issue, though; it was just exposed by better SCEV analysis of smin expressions. Differential Revision: https://reviews.llvm.org/D61807 llvm-svn: 360708
* [ZoneAlgo] Fix PHI inconsistency in invalid contexts.Michael Kruse2019-05-102-0/+11
| | | | | | | | | | PHI nodes (reads) could point to multiple instances of predecessor blocks (PHI writes) when in an invalid context. Fix by removing PHI instances that are in an invalid or ouside assumed context. This fixes llvm.org/PR41656. llvm-svn: 360454
* [polly][SCEV] Expand SCEV matcher cases for new smin/umin opsKeno Fischer2019-05-083-0/+58
| | | | | | | These were added in rL360159, but I neglected to update polly at the same time. llvm-svn: 360238
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-2840-214/+28
| | | | | | | | | | | | This removes unused includes (and forward declarations) as suggested by include-what-you-use. If a transitive include of a removed include is required to compile a file, I added the required header (or forward declaration if suggested by include-what-you-use). This should reduce compilation time and reduce the number of iterative recompilations when a header was changed. llvm-svn: 357209
* [ConstantRange] Rename isWrappedSet() to isUpperWrapped()Nikita Popov2019-03-271-1/+1
| | | | | | | | | | | | | | Split out from D59749. The current implementation of isWrappedSet() doesn't do what it says on the tin, and treats ranges like [X, Max] as wrapping, because they are represented as [X, 0) when using half-inclusive ranges. This also makes it inconsistent with the semantics of isSignWrappedSet(). This patch renames isWrappedSet() to isUpperWrapped(), in preparation for the introduction of a new isWrappedSet() method with corrected behavior. llvm-svn: 357107
* Moving ManagedMemoryRewritePass when hybrid option is selectedMichael Kruse2019-03-251-4/+7
| | | | | | | | | | | | | | | Compiling with -polly-target=hybrid was causing Polly to occur two times in the pipeline. The reason was how the ManagedMemoryRewritePass was registered in the pass manager. ManagedMemoryRewritePass being a ModulePass was forcing all previous passes to get recomputed. This commit avoids Polly to appear two times in the pipeline registering the ManagedMemoryRewritePass later in the pass manager. Patch by Lorenzo Chelini <l.chelini@icloud.com> Differential Revision: https://reviews.llvm.org/D59263 llvm-svn: 356965
* [CodeGen] LLVM OpenMP Backend.Michael Kruse2019-03-195-173/+807
| | | | | | | | | | | | | | | | | | | | | 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
* [opaque pointer types] Update calls to CreateCall to pass the functionJames Y Knight2019-02-081-2/+3
| | | | | | type in lldb and polly. llvm-svn: 353549
* Fix/unify top comment in lib/Analysis/PolyhedralInfo.cppMichal Gorny2019-01-221-15/+16
| | | | | | | | | | | Change the top comment in PolyhedralInfo.cpp to use // instead of ///, similarly to headers in other files. This fixes the issue of copyright line exceeding textwidth and triggering polly-check-format45 failure, e.g. seen here: http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd8/builds/18293/steps/run%20unit%20tests/logs/stdio llvm-svn: 351808
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1945-180/+135
| | | | | | | | | | | | | | | | | 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
* [polly] Change to range-based invocation of llvm::sortMandeep Singh Grang2019-01-181-1/+1
| | | | llvm-svn: 351502
* Fix clang -Wimplicit-fallthrough warnings across llvm, NFCReid Kleckner2018-11-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch should not introduce any behavior changes. It consists of mostly one of two changes: 1. Replacing fall through comments with the LLVM_FALLTHROUGH macro 2. Inserting 'break' before falling through into a case block consisting of only 'break'. We were already using this warning with GCC, but its warning behaves slightly differently. In this patch, the following differences are relevant: 1. GCC recognizes comments that say "fall through" as annotations, clang doesn't 2. GCC doesn't warn on "case N: foo(); default: break;", clang does 3. GCC doesn't warn when the case contains a switch, but falls through the outer case. I will enable the warning separately in a follow-up patch so that it can be cleanly reverted if necessary. Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu Differential Revision: https://reviews.llvm.org/D53950 llvm-svn: 345882
* [TI removal] Generically discuss terminators rather than use the soon toChandler Carruth2018-10-181-1/+1
| | | | | | vanish subclass name. llvm-svn: 344728
* Fix broken formatting caused by test commitTheodoros Theodoridis2018-10-171-1/+1
| | | | llvm-svn: 344694
* Test commitTheodoros Theodoridis2018-10-171-1/+1
| | | | llvm-svn: 344682
* [TI removal] Make `getTerminator()` return a generic `Instruction`.Chandler Carruth2018-10-154-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | This removes the primary remaining API producing `TerminatorInst` which will reduce the rate at which code is introduced trying to use it and generally make it much easier to remove the remaining APIs across the codebase. Also clean up some of the stragglers that the previous mechanical update of variables missed. Users of LLVM and out-of-tree code generally will need to update any explicit variable types to handle this. Replacing `TerminatorInst` with `Instruction` (or `auto`) almost always works. Most of these edits were made in prior commits using the perl one-liner: ``` perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g' ``` This also my break some rare use cases where people overload for both `Instruction` and `TerminatorInst`, but these should be easily fixed by removing the `TerminatorInst` overload. llvm-svn: 344504
* [IslAst] Fix InParallelFor nesting.Michael Kruse2018-09-271-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IslAst could mark two nested outer loops as "OutermostParallel". It caused that the code generator tried to OpenMP-parallelize both loops, which it is not prepared loop. It was because the recursive AST build algorithm managed a flag "InParallelFor" to ensure that no nested loop is also marked as "OutermostParallel". Unfortunatetly the same flag was used by nodes marked as SIMD, and reset to false after the SIMD node. Since loops can be marked as SIMD inside "OutermostParallel" loops, the recursive algorithm again tried to mark loops as "OutermostParellel" although still nested inside another "OutermostParallel" loop. The fix exposed another bug: The function "astScheduleDimIsParallel" was only called when a loop was potentially "OutermostParallel" or "InnermostParallel", but as a side-effect also determines the minimum dependence distance. Hence, changing when we need to know whether a loop is "OutermostParallel" also changed which loop was annotated with "#pragma minimal dependence distance". Moreover, some complex condition linked with "InParallelFor" determined whether a loop should be an "InnermostParallel" loop. It missed some situations where it would not use mark as such although being inside an SIMD mark node, and therefore not be annotated using "#pragma simd". The changes in particular: 1. Split the "InParallelFor" flag into an "InParallelFor" and an "InSIMD" flag. 2. Unconditionally call "astScheduleDimIsParallel" for its side-effects and store the result in "InParallel" for later use. 3. Simplify the condition when a loop is "InnermostParallel". Fixes llvm.org/PR33153 and llvm.org/PR38073. llvm-svn: 343212
* [ScopDetection] Use addUnknown for calls in the AliasSetTracker.Eli Friedman2018-09-111-2/+6
| | | | | | | | | | | | | | | | | | | | | The general-purpose add() now sometimes adds unexpected loop-variant pointers to the AliasSetTracker, so certain loops would be rejected with -polly-allow-modref-calls. Use addUnknown() instead, which has the old behavior. I'm not completely convinced the resulting behavior is actually correct: ScopDetection::isValidAccess seems to mostly ignore "unknown" instructions in the AliasSetTracker. But it's not any worse than what was happening before. Committing without pre-commit review to unbreak the buildbots; the following tests were failing: test/ScopInfo/mod_ref_access_pointee_arguments.ll test/ScopInfo/mod_ref_read_pointee_arguments.ll test/ScopInfo/multidim_2d_with_modref_call_2.ll llvm-svn: 342010
* [PerfMonitor] Fix rdtscp callsitesTobias Grosser2018-09-111-15/+9
| | | | | | | | | | | | | Summary: Update all rdtscp callsites in PerfMonitor so that they conform with the signature changes introduced in r341698. Reviewers: grosser, bollu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51928 llvm-svn: 341946
* [IR] Replace `isa<TerminatorInst>` with `isTerminator()`.Chandler Carruth2018-08-263-4/+5
| | | | | | | | | | | | This is a bit awkward in a handful of places where we didn't even have an instruction and now we have to see if we can build one. But on the whole, this seems like a win and at worst a reasonable cost for removing `TerminatorInst`. All of this is part of the removal of `TerminatorInst` from the `Instruction` type hierarchy. llvm-svn: 340701
* [AST] Adapt Polly to AnalysisSetTracker changes. NFC.Michael Kruse2018-08-171-2/+2
| | | | | | | | | | | | The method AliasSetTracker::getAliasSetForPointer was removed and replaced by AliasSetTracker::getAliasSetFor for the restructuring in r339930. Since Polly uses AliasSetTracker::getAliasSetForPointer, a temporary fix has been committed in r339937 with a comment: Can someone from polly please migrate usage and then delete the wrapper? This commit is doing exactly that. llvm-svn: 340072
* [DepInfo] Use isl++ in Dependences::isValidSchedule. NFC.Michael Kruse2018-08-102-39/+26
| | | | | | | Also change StatementToIslMapTy to hold isl::map, because it is used as a parameter. llvm-svn: 339484
* Update isl-cpp bindingsTobias Grosser2018-08-092-9/+9
| | | | | | | | | We upstreamed the export of isl_val_2exp, to the official cpp bindings. In this process, we concluded that pow2 is a better and more widely used name for this functionality. Hence, both the official isl-cpp bindings and our derived variant use now the term pow2. llvm-svn: 339312
* Update to isl-0.20-65-gb822a210Tobias Grosser2018-08-0922-140/+341
| | | | | | | This update fixes https://https:/llvm.org/PR38348. Thanks Michael for reporting the issue to isl and Sven for fixing the issue. llvm-svn: 339311
* Update isl to isl-0.20-48-g13eba5b5Tobias Grosser2018-08-0719-170/+268
| | | | | | This is a regular maintenance updated. llvm-svn: 339095
* Make update-isl work with latest isl versionsTobias Grosser2018-08-071-2/+3
| | | | | | | | | Latest isl versions require clang to build a 'dist' package. Make sure we actually ask for it. While being there, also make sure we build isl on all cores. llvm-svn: 339094
* [JSONExporter] Print instead of ignoring parser error.Michael Kruse2018-08-021-2/+3
| | | | | | | | | | | Silence the warning warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] JSONExporter is a developer tool, there is no mechanism for error handling. Print the parser error and abort with a fatal error. llvm-svn: 338659
* [ScopBuilder] Set domain to empty instead of NULL.Michael Kruse2018-08-011-2/+5
| | | | | | | | | | | | | | The domain generation used nullptr to mark the domain of an error block as never-executed. Later, nullptr domains are recreated with a zero-tuple domain that then mismatches with the expected domain the error block within the loop. Instead of using nullptr, assign an empty domain which preserves the expected space. Remove empty domains during SCoP simplification. Fixes llvm.org/PR38218. llvm-svn: 338646
* PPCG codegenTobias Grosser2018-08-011-1/+2
| | | | | | | | The latest version of the isl C++ bindings does not export the 'set' method yet. Fall back to the C interface until this method can be exported. llvm-svn: 338512
* [isl++] drop the isl namespace qualifiers [NFC]Tobias Grosser2018-08-011-4463/+4463
| | | | | | | | | | These namespace qualifiers are not needed. Dropping them brings us closer to the official isl namespace qualifiers. While the delta of this change set is large, it only mechanically drops the 'isl::' prefixes. llvm-svn: 338505
* Rebase C++ bindings on top of latest isl bindingsTobias Grosser2018-08-013-302/+1449
| | | | | | | | | | | | | | | | | | | | | | The main difference in this change is that isl_stat is now always checked by default. As we elminiated most used of isl_stat, thanks to Philip Pfaffe's implementation of foreach, only a small set of changes is needed. This change does not include the following recent changes to isl's C++ bindings: - stricter error handling for isl_bool - dropping of the isl::namespace qualifiers The former requires a larger patch in Polly and consequently should go through a patch-review. The latter will be applied in the next commit to keep this commit free from noise. We also still apply a couple of other changes on top of the official isl bindings. This delta is expected to shrink over time. llvm-svn: 338504
* Update to isl-0.20-35-ge0a98b62Tobias Grosser2018-08-0157-209/+25786
| | | | llvm-svn: 338501
* [JSONExporter] Try to appease buildbot. NFC.Michael Kruse2018-08-011-1/+1
| | | | | | | The compiler does not seem to able move a local variable in the function's return statement. llvm-svn: 338466
* [Polly-ACC] Fix compilation after r338450. NFC.Michael Kruse2018-08-011-1/+1
| | | | llvm-svn: 338462
* [JSONExporter] Replace bundled Jsoncpp with llvm/Support/JSON.h. NFC.Michael Kruse2018-08-0119-6592/+80
| | | | | | Differential Revision: https://reviews.llvm.org/D49950 llvm-svn: 338461
* [CodeGen] Convert IslNodeBuilder::getNumberOfIterations to isl++. NFC.Michael Kruse2018-07-311-30/+18
| | | | llvm-svn: 338451
* [CodeGen] Convert IslNodeBuilder::createForSequential to isl++. NFC.Michael Kruse2018-07-311-25/+17
| | | | llvm-svn: 338450
* [CodeGen] Convert IslNodeBuilder::getUpperBound to isl++. NFC.Michael Kruse2018-07-311-30/+17
| | | | llvm-svn: 338449
* [DependenceInfo] Use isl++ to replace foreach_set with for loopTobias Grosser2018-07-171-9/+13
| | | | llvm-svn: 337248
* [IslNodeBuilder] Use isl++ to replace foreach_set with for loopTobias Grosser2018-07-171-14/+13
| | | | llvm-svn: 337247
* [ScopInfo] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-9/+16
| | | | llvm-svn: 337246
* [ZoneAlgo] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-9/+6
| | | | llvm-svn: 337245
* [FlattenSchedule] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-3/+2
| | | | llvm-svn: 337244
* [MaximalStaticExpansion] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-11/+6
| | | | llvm-svn: 337243
* [ForwardOpTree] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-5/+5
| | | | llvm-svn: 337242
* [Simplify] Replace isl foreach calls with for loopsTobias Grosser2018-07-171-27/+22
| | | | llvm-svn: 337241
* [FlattenAlgo] Replace more isl foreach calls with for loopsTobias Grosser2018-07-171-8/+7
| | | | | | | | | | This time we replace for loops where the return isl::stat::error has been used to carry status information. There are still two uses of foreach remaining as we do not have a corresponding for implementation for pw_aff functions. llvm-svn: 337239
* [FlattenAlgo] Replace some isl foreach calls with for loopsTobias Grosser2018-07-171-11/+7
| | | | | | Replace foreach calls which only return 'ok' with for loops. llvm-svn: 337238
OpenPOWER on IntegriCloud