summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/Utils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-281-1/+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
* [PPCGCodeGeneration] Fix runtime check adjustments since they make ↵Siddharth Bhat2017-07-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | assumptions about BB layout. - There is a conditional branch that is used to switch between the old and new versions of the code. - If we detect that the build was unsuccessful, `PPCGCodeGeneration` will change the runtime check to be always set to false. - To actually *reach* this runtime check instruction, `PPCGCodeGeneration` was using assumptions about the layout of the BBs. - However, invariant load hoisting violates this assumption by inserting an extra basic block in the middle. - Fix the assumption on the layout by having `createScopConditionally` return the conditional branch instruction. - Use this reference to set to always-false. llvm-svn: 308010
* [NFC] Return both polly.start and polly.exiting from executeScopConditionally.Andreas Simbuerger2017-06-261-4/+4
| | | | | | | | | | | | | | This commit returns both the start and the exit block that are created by executeScopConditionally. In a future commit we will make use of the exit block. Before we would have to use the implicit property that there won't be any code generated between polly.start and polly.exiting at the time of use to find the correct block ('polly.exiting'). All usage location are semantically unchanged. llvm-svn: 306283
* [Polly][NewPM] Pull references to the legacy PM interface from utilities and ↵Philip Pfaffe2017-04-041-4/+3
| | | | | | | | | | | | | | | | | | | | | 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
* [Polly CodeGen] Break critical edge from RTC to original loop.Eli Friedman2016-11-021-0/+20
| | | | | | | | | | | | | | | This makes polly generate a CFG which is closer to what we want in LLVM IR, with a loop preheader for the original loop. This is just a cleanup, but it exposes some fragile assumptions. I'm not completely happy with the changes related to expandCodeFor; RTCBB->getTerminator() is basically a random insertion point which happens to work due to the way we generate runtime checks. I'm not sure what the right answer looks like, though. Differential Revision: https://reviews.llvm.org/D26053 llvm-svn: 285864
* Duplicate part of the Region interface in the Scop class [NFC]Johannes Doerfert2016-05-231-6/+6
| | | | | | | This allows to use the SCoP directly for various queries, thus to hide the underlying region more often. llvm-svn: 270426
* executeScopConditionally: Introduce special exiting blockTobias Grosser2015-12-091-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | When introducing separate control flow for the original and optimized code we introduce now a special 'ExitingBlock': \ / EnteringBB | SplitBlock---------\ _____|_____ | / EntryBB \ StartBlock | (region) | | \_ExitingBB_/ ExitingBlock | | MergeBlock---------/ | ExitBB / \ This 'ExitingBlock' contains code such as the final_reloads for scalars, which previously were just added to whichever statement/loop_exit/branch-merge block had been generated last. Having an explicit basic block makes it easier to find these constructs when looking at the CFG. llvm-svn: 255107
* Fix Codegen adding a second exit out of regionMichael Kruse2015-08-181-0/+12
| | | | | | | | | | executeScopConditionally would destroy a predecessor region if it the scop's entry was the region's exit block by forking it to polly.start and thus creating a secnd exit out of the region. This patch "shrinks" the predecessor region s.t. polly.split_new_and_old is not the region's exit anymore. llvm-svn: 245294
* Revise the simplification of regionsMichael Kruse2015-08-111-43/+133
| | | | | | | | | | | | | | | | | | | | The previous code had several problems: For newly created BasicBlocks it did not (always) call RegionInfo::setRegionFor in order to update its analysis. At the moment RegionInfo does not verify its BBMap, but will in the future. This is fixed by determining the region new BBs belong to and set it accordingly. The new executeScopConditionally() requires accurate getRegionFor information. Which block is created by SplitEdge depends on the incoming and outgoing edges of the blocks it connects, which makes handling its output more difficult than it needs to be. Especially for finding which block has been created an to assign a region to it for the setRegionFor problem above. This patch uses an implementation for splitEdge that always creates a block between the predecessor and successor. simplifyRegion has also been simplified by using SplitBlockPredecessors instead of SplitEdge. Isolating the entries and exits have been refectored into individual functions. Previously simplifyRegion did more than just ensuring that there is only one entering and one exiting edge. It ensured that the entering block had no other outgoing edge which was necessary for executeScopConditionally(). Now the latter uses the alternative splitEdge implementation which can handle this situation so simplifyRegion really only needs to simplify the region. Also, executeScopConditionally assumed that there can be no PHI nodes in blocks with one incoming edge. This is wrong and LCSSA deliberately produces such edges. However, previous passes ensured that there can be no such PHIs in exit nodes, but which will no longer hold in the future. The new code that the property that it preserves the identity of region block (the property that the memory address of the BasicBlock containing the instructions remains the same; new blocks only contain PHI nodes and a terminator), especially the entry block. As a result, there is no need to update the reference to the BasicBlock of ScopStmt that contain its instructions because they have been moved to other basic blocks. Reviewers: grosser Part of Differential Revision: http://reviews.llvm.org/D11867 llvm-svn: 244606
* Use value semantics for list of ScopStmt(s) instead of std::owningptrTobias Grosser2015-05-271-3/+3
| | | | | | | | | | | | | | | | David Blaike suggested this as an alternative to the use of owningptr(s) for our memory management, as value semantics allow to avoid the additional interface complexity caused by owningptr while still providing similar memory consistency guarantees. We could also have used a std::vector, but the use of std::vector would yield possibly changing pointers which currently causes problems as for example the memory accesses carry pointers to their parent statements. Such pointers should not change. Reviewer: jblaikie, jdoerfert Differential Revision: http://reviews.llvm.org/D10041 llvm-svn: 238290
* Use unique_ptr to clarify ownership of ScopStmtTobias Grosser2015-05-231-1/+1
| | | | llvm-svn: 238090
* Sort include directivesTobias Grosser2015-05-091-1/+0
| | | | | | | | | | 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
* [Refactor] Include explicitly what is usedJohannes Doerfert2015-03-011-0/+2
| | | | llvm-svn: 230901
* [PM] Update Polly for LLVM r226459 which removed another pass argumentChandler Carruth2015-01-191-2/+2
| | | | | | from an API in the process of preparing for the new pass manager. llvm-svn: 226460
* [PM] Update Polly for LLVM r226385 which made LoopInfo actually deriveChandler Carruth2015-01-181-1/+1
| | | | | | | from LoopInfoBase<...>, removing the need for the awkward getBase() dance. llvm-svn: 226387
* [PM] Update Polly following LLVM r226373 which refactors LoopInfo inChandler Carruth2015-01-171-1/+1
| | | | | | preparation for the new pass manager. llvm-svn: 226374
* [Refactor] Cleanup isl code generationJohannes Doerfert2014-09-101-8/+7
| | | | | | | | | | | | | | | | | | | | Summary: + Refactor the runtime check (RTC) build function + Added helper function to create an PollyIRBuilder + Change the simplify region function to create not only unique entry and exit edges but also enfore that the entry edge is unconditional + Cleaned the IslCodeGeneration runOnScop function: - less post-creation changes of the created IR + Adjusted and added test cases Reviewers: grosser, sebpop, simbuerg, dpeixott Subscribers: llvm-commits, #polly Differential Revision: http://reviews.llvm.org/D5076 llvm-svn: 217508
* Revert "[Refactor] Cleanup runtime code generation"Tobias Grosser2014-08-161-7/+8
| | | | | | | | | | | | | | | | This reverts commit 215466 (and 215528, a trivial formatting fix). The intention of these commits is a good one, but unfortunately they broke our LNT buildbot: http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3-polly-codegen-isl Several of the cleanup changes that have been combined in this 'fixup' are trivial and could probably be committed as obvious changes without risking to break the build. The remaining changes are little and it should be easy to figure out what went wrong. llvm-svn: 215817
* Fix formattingTobias Grosser2014-08-131-2/+1
| | | | llvm-svn: 215528
* [Refactor] Cleanup runtime code generationJohannes Doerfert2014-08-121-7/+7
| | | | | | | + Use regexp in two test case. + Refactor the runtime condition build function llvm-svn: 215466
* Update for RegionInfo changes.Matt Arsenault2014-07-191-1/+1
| | | | | | | Mostly related to missing includes and renaming of the pass to RegionInfoPass. llvm-svn: 213457
* [C++11] Use more range based forsTobias Grosser2014-06-281-3/+3
| | | | llvm-svn: 211981
* Introduce PollyIRBuilderTobias Grosser2014-03-041-2/+2
| | | | | | | | 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
* codegen: Update LoopInfo correctlyTobias Grosser2014-02-241-0/+4
| | | | | | | | | Add the 'polly.start' basic block to the loop that surrounds the scop we just codegenerate. This fixes PR13441 llvm-svn: 202000
* Adapt to DomTree changes in r199104Tobias Grosser2014-01-131-1/+2
| | | | llvm-svn: 199157
* Sort includesTobias Grosser2013-05-071-2/+0
| | | | llvm-svn: 181297
* Codegen: Replace region exit and entries recursivelyTobias Grosser2013-04-101-2/+3
| | | | | | | | | | | | | | During code generation we split the original entry and exit basic blocks of the scop to make room for the newly generated code. To keep the region tree up to date, we need to update the region tree. This patch ensures that not only the region of the scop is updated, but also all child regions that share the same entry or exit block. We have now test case here, as the bug is only exposed by the subsequent commit. The test cases of that commit also cover this bug. Contributed-by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179158
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-1/+1
| | | | | | reflect the migration in r171366. llvm-svn: 171370
* Speculative update to Polly for LLVM r159421 which moved IRBuilder.h. Chandler Carruth2012-06-291-1/+1
| | | | llvm-svn: 159423
* Move executeScopConditionally() into its own fileTobias Grosser2012-05-291-0/+84
We will reuse this function for the isl code generator. llvm-svn: 157605
OpenPOWER on IntegriCloud