summaryrefslogtreecommitdiffstats
path: root/polly/lib/Transform/DeadCodeElimination.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-281-5/+0
| | | | | | | | | | | | 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-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
* getDependences to new C++ interfaceTobias Grosser2018-06-061-2/+2
| | | | | | | | | | | | | | 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
* Move include/isl-noexceptions.h to include/isl/isl-noexceptions.hTobias Grosser2017-08-221-2/+1
| | | | llvm-svn: 311504
* [Polly] Move Scop::restrictDomains to islpp. NFC.Tobias Grosser2017-08-141-1/+1
| | | | | | | | Reviewers: grosser, Meinersbur, bollu Differential Revision: https://reviews.llvm.org/D36659 llvm-svn: 310814
* [ScopInfo] Move Scop::getPwAffOnly to isl++ [NFC]Tobias Grosser2017-08-061-1/+1
| | | | llvm-svn: 310231
* [ScopInfo] Move Scop::getDomains to isl++ [NFC]Tobias Grosser2017-08-061-1/+1
| | | | llvm-svn: 310230
* [ScopInfo] Move get*Writes/getReads/getAccesses to isl++Tobias Grosser2017-08-061-2/+2
| | | | llvm-svn: 310219
* [DeadCodeElimination] Translate to C++ bindingsTobias Grosser2017-03-101-34/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pass is a small and self-contained example of a piece of code that was written with the isl C interface. The diff of this change nicely shows how the C++ bindings can improve the readability of the code by avoiding the long C function names and by avoiding any need for memory management. As you will see, no calls to isl_*_copy or isl_*_free are needed anymore. Instead the C++ interface takes care of automatically managing the objects. This may introduce internally additional copies, but due to the isl reference counting, such copies are expected to be cheap. For performance critical operations, we will later exploit move semantics to eliminate unnecessary copies that have shown to be costly. Below we give a set of examples that shows the benefit of the C++ interface vs. the pure C interface. Check properties ---------------- Before: if (isl_aff_is_zero(aff) || isl_aff_is_one(aff)) return true; After: if (Aff.is_zero() || Aff.is_one()) return true; Type conversion --------------- Before: isl_union_pw_multi_aff *UPMA = isl_union_pw_multi_aff_from_union_map(umap); After: isl::union_pw_multi_aff UPMA = UMap; Type construction ----------------- Before: auto *Empty = isl_union_map_empty(space); After: auto Empty = isl::union_map::empty(Space); Operations ---------- Before: set = isl_union_set_intersect(set, set2); After: Set = Set.intersect(Set2); The use of isl::boolean in return types also adds an increases the robustness of Polly, as on conversion to true or false, we verify that no isl_bool_error has been returned and assert in case an error was returned. Before this change we would have just ignored the error and proceeded with (some) exection path. Tags: #polly Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D30619 llvm-svn: 297466
* [DeadCodeElim] Put -polly-dce-precise-steps into the Polly category.Michael Kruse2017-03-081-1/+2
| | | | llvm-svn: 297318
* Perform copying to created arrays according to the packing transformationRoman Gareev2016-09-141-0/+2
| | | | | | | | | | | | | | | | This is the fourth patch to apply the BLIS matmul optimization pattern on matmul kernels (http://www.cs.utexas.edu/users/flame/pubs/TOMS-BLIS-Analytical.pdf). BLIS implements gemm as three nested loops around a macro-kernel, plus two packing routines. The macro-kernel is implemented in terms of two additional loops around a micro-kernel. The micro-kernel is a loop around a rank-1 (i.e., outer product) update. In this change we perform copying to created arrays, which is the last step to implement the packing transformation. Reviewed-by: Tobias Grosser <tobias@grosser.es> Differential Revision: https://reviews.llvm.org/D23260 llvm-svn: 281441
* Drop '@brief' from doxygen commentsTobias Grosser2016-09-021-3/+3
| | | | | | | | LLVM's coding guideline suggests to not use @brief for one-sentence doxygen comments to improve readability. Switch this once and for all to ensure people do not copy @brief comments from other parts of Polly, when writing new code. llvm-svn: 280468
* clang-tidy: Add llvm namespace commentsTobias Grosser2016-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | llvm commonly adds a comment to the closing brace of a namespace to indicate which namespace is closed. clang-tidy provides with llvm-namespace-comment a handy tool to check for this habit. We use it to ensure we consitently use namespace comments in Polly. There are slightly different styles in how namespaces are closed in LLVM. As there is no large difference between the different comment styles we go for the style clang-tidy suggests by default. To reproduce this fix run: for i in `ls tools/polly/lib/*/*.cpp`; \ clang-tidy -checks='-*,llvm-namespace-comment' -p build $i -fix \ -header-filter=".*"; \ done 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: 273621
* Decouple SCoP building logic from passJohannes Doerfert2016-05-311-1/+1
| | | | | | | | | | | | | | | | Created a new pass ScopInfoRegionPass. As name suggests, it is a region pass and it is there to preserve compatibility with our existing Polly passes. ScopInfoRegionPass will return a SCoP object for a valid region while the creation of the SCoP stays in the ScopInfo class. Contributed-by: Utpal Bora <cs14mtech11017@iith.ac.in> Reviewed-by: Tobias Grosser <tobias@grosser.es>, Johannes Doerfert <doerfert@cs.uni-saarland.de> Differential Revision: http://reviews.llvm.org/D20770 llvm-svn: 271259
* Add __isl_give annotations to return types [NFC]Johannes Doerfert2016-04-091-1/+1
| | | | llvm-svn: 265882
* Allow the client of DependenceInfo to obtain dependences at different ↵Hongbin Zheng2016-03-031-2/+2
| | | | | | granularities. llvm-svn: 262591
* [NFC] Consistenly use commented and annotated ScopPass functionsJohannes Doerfert2015-09-271-3/+2
| | | | | | | | | | | The changes affect methods that are part of the Pass interface and include: - Comments that describe the methods purpose. - A consistent use of the keywords override and virtual. Additionally, the printScop method is now optional and removed from SCoP passes that do not implement it. llvm-svn: 248685
* Add explicit #includes for used isl featuresTobias Grosser2015-05-091-0/+1
| | | | llvm-svn: 236931
* 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
* Create a dependence struct to hold dependence information for a SCoP.Johannes Doerfert2015-03-051-4/+5
| | | | | | | | | | | The new Dependences struct in the DependenceInfo holds all information that was formerly part of the DependenceInfo. It also provides the same interface for the user to access this information. This is another step to a more general ScopPass interface that does allow multiple SCoPs to be "in flight". llvm-svn: 231327
* Rename the Dependences pass to DependenceInfo [NFC]Johannes Doerfert2015-03-041-5/+5
| | | | | | | | | | We rename the Dependences pass to DependenceInfo as a first step to a caching pass policy. The new DependenceInfo pass will later provide "Dependences" for a SCoP. To keep consistency the test folder is renamed too. llvm-svn: 231308
* [Refactor] Use virtual and override appropriatelyJohannes Doerfert2015-03-011-3/+3
| | | | | | | + Add override for overwritten methods. + Remove virtual for methods we do not want to be overwritten. llvm-svn: 230898
* [Refactor] Add a Scop & as argument to printScopJohannes Doerfert2015-03-011-2/+2
| | | | | | This is the first step in the interface simplification. llvm-svn: 230897
* Dead code elimination: Update dependences after eliminating codeTobias Grosser2014-12-171-1/+7
| | | | | | | | | | | | Without updating dependences we may lose implicit transitive dependences for which all explicit dependences have gone through the statement iterations we have just eliminated. No test case. We should probably implement a -verify-dependences option. This fixes llvm.org/PR21227 llvm-svn: 224459
* DeadCodeElimination: Fix liveout computationTobias Grosser2014-07-141-14/+22
| | | | | | | | | | | | | | | We move back to a simple approach where the liveout is the last must-write statement for a data-location plus all may-write statements. The previous approach did not work out. We would have to consider per-data-access dependences, instead of per-statement dependences to correct it. As this adds complexity and it seems we would not gain anything over the simpler approach that we implement in this commit, I moved us back to the old approach of computing the liveout, but enhanced it to also add may-write accesses. We also fix the test case and explain why we can not perform dead code elimination in this case. llvm-svn: 212925
* Remove unnecessary isl annotationsTobias Grosser2014-07-111-2/+2
| | | | | | | They where just left over from copy-pasting. Reported-by: Johannes Doerfert <jdoerfert@codeaurora.org> llvm-svn: 212800
* DeadCodeElim: Compute correct liveout for non-affine accessesTobias Grosser2014-07-111-15/+25
| | | | | | | Thanks to Johannes Doerfert for narrowing down the bug. Reported-by: Chris Jenneisch <chrisj@codeaurora.org> llvm-svn: 212796
* Model statement wise reduction dependencesJohannes Doerfert2014-06-201-1/+2
| | | | | | | | | | | | | + Collect reduction dependences + Introduced TYPE_RED in Dependences.h which can be used to obtain the reduction dependences + Used TYPE_RED to prevent parallelization while we do not have a privatizing code generation + Relax the dependences for non-parallel code generation + Add privatization dependences to ensure correctness + 12 Test cases to check for reduction and privatization dependences llvm-svn: 211369
* clang-format: Remove empty linesTobias Grosser2014-03-211-1/+0
| | | | llvm-svn: 204468
* Allow several polly command line options to be provided multiple timesTobias Grosser2014-03-131-1/+1
| | | | | Contributed-by: Sam Novak <snovak@uwsp.edu> llvm-svn: 203869
* Move transformations into own directoryAndreas Simbuerger2014-03-111-0/+157
Move all transformations into their own directory. CMakeLists are adjusted accordingly. llvm-svn: 203607
OpenPOWER on IntegriCloud