summaryrefslogtreecommitdiffstats
path: root/polly/lib/Transform
Commit message (Collapse)AuthorAgeFilesLines
* Sink all InitializePasses.h includesReid Kleckner2019-11-136-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of recompilation. I found this fact by looking at this table, which is sorted by the number of times a file was changed over the last 100,000 git commits multiplied by the number of object files that depend on it in the current checkout: recompiles touches affected_files header 342380 95 3604 llvm/include/llvm/ADT/STLExtras.h 314730 234 1345 llvm/include/llvm/InitializePasses.h 307036 118 2602 llvm/include/llvm/ADT/APInt.h 213049 59 3611 llvm/include/llvm/Support/MathExtras.h 170422 47 3626 llvm/include/llvm/Support/Compiler.h 162225 45 3605 llvm/include/llvm/ADT/Optional.h 158319 63 2513 llvm/include/llvm/ADT/Triple.h 140322 39 3598 llvm/include/llvm/ADT/StringRef.h 137647 59 2333 llvm/include/llvm/Support/Error.h 131619 73 1803 llvm/include/llvm/Support/FileSystem.h Before this change, touching InitializePasses.h would cause 1345 files to recompile. After this change, touching it only causes 550 compiles in an incremental rebuild. Reviewers: bkramer, asbirlea, bollu, jdoerfert Differential Revision: https://reviews.llvm.org/D70211
* [Stats] More polly fixes following llvm::Statistic changes in r374490.Volodymyr Sapsai2019-10-112-5/+5
| | | | llvm-svn: 374501
* [Polly] Fix lib/Transform/ScheduleOptimizer.cpp compilation on SolarisRainer Orth2019-09-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib/Transform/ScheduleOptimizer.cpp fails to compile on Solaris, both on the 9.x branch (first noticed when running test-release.sh without -no-polly) and on trunk: /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp: In function ‘MicroKernelParamsTy getMicroKernelParams(const llvm::TargetTransformInfo*, polly::MatMulInfoTy)’: /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:914:62: error: call of overloaded ‘sqrt(long unsigned int)’ is ambiguous 914 | ceil(sqrt(Nvec * LatencyVectorFma * ThroughputVectorFma) / Nvec) * Nvec; | ^ In file included from /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/math.h:24, from /usr/gcc/9/include/c++/9.1.0/cmath:45, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm-c/DataTypes.h:28, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/Support/DataTypes.h:16, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/Hashing.h:47, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/ArrayRef.h:12, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/include/polly/ScheduleOptimizer.h:12, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:48: /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:220:21: note: candidate: ‘long double std::sqrt(long double)’ 220 | inline long double sqrt(long double __X) { return __sqrtl(__X); } | ^~~~ /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:186:15: note: candidate: ‘float std::sqrt(float)’ 186 | inline float sqrt(float __X) { return __sqrtf(__X); } | ^~~~ /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:74:15: note: candidate: ‘double std::sqrt(double)’ 74 | extern double sqrt __P((double)); | ^~~~ /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:915:67: error: call of overloaded ‘ceil(long unsigned int)’ is ambiguous 915 | int Mr = ceil(Nvec * LatencyVectorFma * ThroughputVectorFma / Nr); | ^ In file included from /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/math.h:24, from /usr/gcc/9/include/c++/9.1.0/cmath:45, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm-c/DataTypes.h:28, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/Support/DataTypes.h:16, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/Hashing.h:47, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/include/llvm/ADT/ArrayRef.h:12, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/include/polly/ScheduleOptimizer.h:12, from /var/llvm/llvm-9.0.0-rc4/rc4/llvm.src/tools/polly/lib/Transform/ScheduleOptimizer.cpp:48: /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:196:21: note: candidate: ‘long double std::ceil(long double)’ 196 | inline long double ceil(long double __X) { return __ceill(__X); } | ^~~~ /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:160:15: note: candidate: ‘float std::ceil(float)’ 160 | inline float ceil(float __X) { return __ceilf(__X); } | ^~~~ /usr/gcc/9/lib/gcc/x86_64-pc-solaris2.11/9.1.0/include-fixed/iso/math_iso.h:76:15: note: candidate: ‘double std::ceil(double)’ 76 | extern double ceil __P((double)); | ^~~~ Fixed by adding casts to disambiguate, checked that it now compiles on both amd64-pc-solaris2.11 and sparcv9-sun-solaris2.11 and on x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D67442 llvm-svn: 371825
* [Polly] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-142-2/+2
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368935
* [ScopInliner] Register FunctionAnalysisManagerModuleProxy.Michael Kruse2019-06-171-0/+1
| | | | | | | | | | | | FunctionAnalysisManagerModuleProxy started to be used by the AlwaysInlinerPass in r363287 and therefore had to be registered in the New PassManager. Should fix the regression tests Polly :: ScopInliner/invariant-load-func.ll Polly :: ScopInliner/simple-inline-loop.ll llvm-svn: 363572
* [ScheduleTreeTransform] Silence compiler warning. NFC.Michael Kruse2019-06-061-1/+1
| | | | | | | Use size_t for position which is the return type type ArrayRef::size() it is compared to. llvm-svn: 362724
* [ScheduleOptimizer] Hoist extension nodes after schedule optimization.Michael Kruse2019-05-312-2/+516
| | | | | | | | | | | | | | | | | | | | | | Extension nodes make schedule trees are less flexible: Many operations, such as rescheduling, do not work on such schedule trees with extension. As such, some functionality such as determining parallel loops in isl's AST are disabled. Currently, only the pattern-matching generalized matrix-matrix multiplication optimization adds extension nodes (to add copy-in statements). This patch removes all extension nodes as the last step of the schedule optimization by hoisting the extension node's added domain up to the root domain node. All following passes can assume that schedule trees work without restrictions, including the parallelism test. Mark the outermost loop of the optimized matrix-matrix multiplication as parallel such that -polly-parallel is able to parallelize that loop. Differential Revision: https://reviews.llvm.org/D58202 llvm-svn: 362257
* [DeLICM] Use polly::singleton to allow empty result.Michael Kruse2019-05-211-2/+3
| | | | | | | | | | | isl_map_from_union_map cannot determine the map's space if the union_map is empty. polly::singleton was designed for this case. We pass the expected map space to avoid crashing in isl_map_from_union_map. This fixes an issue found by the aosp buildbot. Thanks to Eli Friedman for the reproducer. llvm-svn: 361290
* [ZoneAlgo] Fix PHI inconsistency in invalid contexts.Michael Kruse2019-05-101-0/+5
| | | | | | | | | | 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
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-289-18/+5
| | | | | | | | | | | | 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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1913-52/+39
| | | | | | | | | | | | | | | | | 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 broken formatting caused by test commitTheodoros Theodoridis2018-10-171-1/+1
| | | | llvm-svn: 344694
* Test commitTheodoros Theodoridis2018-10-171-1/+1
| | | | llvm-svn: 344682
* Rebase C++ bindings on top of latest isl bindingsTobias Grosser2018-08-011-14/+20
| | | | | | | | | | | | | | | | | | | | | | 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
* [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
* Use range for in normalizeValInst [NFCI]Tobias Grosser2018-06-291-27/+25
| | | | llvm-svn: 335971
* [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
* [OpTree] Introduce shortcut for computing the def->target mapping. NFCI.Michael Kruse2018-06-061-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-063-7/+7
| | | | | | | | | | | | | | 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
* Update for a header file move in LLVMDavid Blaikie2018-06-041-1/+1
| | | | llvm-svn: 333956
* [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
* [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
* [polly] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-158-125/+143
| | | | | | | | | | | 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
* Remove the last uses of isl::give and isl::takeTobias Grosser2018-04-294-21/+18
| | | | llvm-svn: 331126
* [DeLICM] Remove uses of isl::giveTobias Grosser2018-04-284-90/+58
| | | | llvm-svn: 331122
* [ZoneAlgo] Remove uses of isl::give - IITobias Grosser2018-04-281-13/+8
| | | | llvm-svn: 331121
* [ZoneAlgo] Remove uses of isl::giveTobias Grosser2018-04-281-41/+33
| | | | | | This moves more of Polly to islpp. llvm-svn: 331120
* [MaximalStaticExpansion] Replace copied function with version from ISLToolsTobias Grosser2018-04-281-43/+1
| | | | llvm-svn: 331118
* Fixup Polly for an LLVM header file change.David Blaikie2018-04-241-0/+1
| | | | llvm-svn: 330679
* Fix polly build after r328717Reid Kleckner2018-03-281-0/+1
| | | | llvm-svn: 328728
* Update for LLVM header movementDavid Blaikie2018-03-211-1/+1
| | | | llvm-svn: 328169
* Adjust to clang-format changesTobias Grosser2018-03-204-4/+0
| | | | llvm-svn: 328005
* Use isl::manage_copy to simplify calls to isl::manage(isl_.._copy())Tobias Grosser2018-02-202-11/+9
| | | | | | | | | | | As part of this cleanup a couple of unnecessary isl::manage(obj.copy()) pattern are eliminated as well. We checked for all potential cleanups by scanning for: "grep -R isl::manage\( lib/ | grep copy" llvm-svn: 325558
* Run clang-format after r324003. NFC.Michael Kruse2018-02-022-7/+7
| | | | llvm-svn: 324112
* Update polly for r323999.Benjamin Kramer2018-02-012-9/+9
| | | | llvm-svn: 324003
* [MaximalStaticExpansion] Simplify this code a bit. NFCI.Davide Italiano2017-11-251-6/+2
| | | | llvm-svn: 318988
* Run polly-update-format. NFC.Michael Kruse2017-11-211-1/+0
| | | | | | | polly-check-format has been failing since at least r318517, due to more than one cause. llvm-svn: 318795
* Port ScopInfo to the isl cpp bindingsPhilip Pfaffe2017-11-194-8/+8
| | | | | | | | | | | | | | | | | | | | | Summary: Most changes are mechanical, but in one place I changed the program semantics by fixing a likely bug: In `Scop::hasFeasibleRuntimeContext()`, I'm now explicitely handling the error-case. Before, when the call to `addNonEmptyDomainConstraints()` returned a null set, this (probably) accidentally worked because isl_bool_error converts to true. I'm checking for nullptr now. Reviewers: grosser, Meinersbur, bollu Reviewed By: Meinersbur Subscribers: nemanjai, kbarton, pollydev, llvm-commits Differential Revision: https://reviews.llvm.org/D39971 llvm-svn: 318632
* [NFC] Make r318597 compatible with clang-formatZhaoshi Zheng2017-11-171-1/+1
| | | | llvm-svn: 318561
* [nfc] Iwyu: forward-declare/include raw_ostream in zone algoPhilip Pfaffe2017-11-171-0/+1
| | | | llvm-svn: 318517
* [ForwardOpTree] Limit isl operations of known content reload.Michael Kruse2017-11-061-1/+8
| | | | | | | | | | Put the analysis part of reloadKnownContent under an isl max-operations quota scope, as has already been done for forwardKnownLoad. This should fix the aosp timeout of "GrTestUtils.cpp". llvm-svn: 317495
* [ZoneAlgo/ForwardOpTree] Normalize PHIs to their known incoming values.Michael Kruse2017-10-313-54/+307
| | | | | | | | | | | | | | | | | | | | | | | Represent PHIs by their incoming values instead of an opaque value of themselves. This allows ForwardOpTree to "look through" the PHIs and forward the incoming values since forwardings PHIs is currently not supported. This is particularly useful to cope with PHIs inserted by GVN LoadPRE. The incoming values all resolve to a load from a single array element which then can be forwarded. It should in theory also reduce spurious conflicts in value mapping (DeLICM), but I have not yet found a profitable case yet, so it is not included here. To avoid transitive closure and potentially necessary overapproximations of those, PHIs that may reference themselves are excluded from normalization and keep their opaque self-representation. Differential Revision: https://reviews.llvm.org/D39333 llvm-svn: 317008
* [DeLICM] Fix wrong assumed access execution order.Michael Kruse2017-10-311-1/+1
| | | | | | | | | | | | | | ForwardOpTree may already transform a scalar access to an array accesses. The access remains implicit (isOriginalScalarKind(), meaning that the access is always executed at the begin/end of a statement), but targets an array (isLatestArrayKind(), which is unrelated to whether the execution is implicit/explicit). Fix by properly using isOriginalXXX() to determine execution order. This fixes the buildbots on MultiSource/Benchmarks/DOE-ProxyApps-C/miniGMG. llvm-svn: 316995
* [ForwardOpTree] Use space indention. NFC.Michael Kruse2017-10-271-1/+1
| | | | llvm-svn: 316769
OpenPOWER on IntegriCloud