summaryrefslogtreecommitdiffstats
path: root/polly/lib/Support/VirtualInstruction.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
* [IR] Replace `isa<TerminatorInst>` with `isTerminator()`.Chandler Carruth2018-08-261-1/+1
| | | | | | | | | | | | 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
* Drop unnecessary whitespace [NFCI]Tobias Grosser2018-06-111-2/+2
| | | | llvm-svn: 334413
* [VirtualInst] Derive correct use kind of PHI operands. NFC.Michael Kruse2018-01-231-6/+26
| | | | | | | | | | VirtualUse::create is only called for MemoryKind::Value, but its consistency nonetheless checked in verifyUses(). PHI uses are always inter-stmt dependencies, which was not considered by the constructor method. The virtual and non-virtual execution paths were the same, such that verifyUses did not encounter any inconsistencies. llvm-svn: 323283
* [Simplify] Mark (and sweep) based on latest access relation.Michael Kruse2017-10-261-2/+2
| | | | | | | | | Previously we marked scalars based on the original access function. However, when a scalar read access is redirected, the original definition (or incoming values of a PHI) is not used anymore, and can be deleted (unless referenced by use that has not been redirected). llvm-svn: 316660
* Fix Memory Access of failing tests.Michael Kruse2017-09-011-1/+1
| | | | | | | | | | | Mark scalar dependences for different statements belonging to same BB as 'Inter'. Contributed-by: Nandini Singhal <cs15mtech01004@iith.ac.in> Differential Revision: https://reviews.llvm.org/D37147 llvm-svn: 312324
* [ForwardOpTree] Allow forwarding in the presence of region statementsTobias Grosser2017-08-311-5/+9
| | | | | | | | | | | | | | | | | | Summary: After region statements now also have instruction lists, this is a straightforward extension. Reviewers: Meinersbur, bollu, singam-sanjay, gareevroman Reviewed By: Meinersbur Subscribers: hfinkel, pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D37298 llvm-svn: 312249
* [VirtualInstruction] Handle MetadataAsValue as constant.Michael Kruse2017-08-031-1/+1
| | | | | | | | | | | | | | The complication of bspatch.cc of the AOSP buildbot currently fails presumably because the occurance of a MetadataAsValue in an operand. This kind of value can occur as operands of intrinsics, the typical example being the debug intrinsics. Polly currently ignores the debug intrinsics and it is not yet clear which other intrinic might occur. For such cases, and to unbreak the AOSP buildbot, treat a MetadataAsValue as a constant because it can be referenced without modification in generated code. llvm-svn: 309992
* [VirtualInstruction] Avoid use of getStmtFor(BB). NFC.Michael Kruse2017-08-031-1/+6
| | | | | | | | | | | With this patch, we get rid of the last use of getStmtFor(BB). Here this is done by getting the last statement of the incoming block in case the user is a phi node; otherwise just fetching the statement comprising the instruction for which the virtual use is being created. Differential Revision: https://reviews.llvm.org/D36268 llvm-svn: 309947
* [Simplify] Do not remove dependencies of phis within region stmts.Michael Kruse2017-07-281-1/+2
| | | | | | | These were wrongly assumed to be phi nodes that require MemoryKind::PHI accesses. llvm-svn: 309454
* [VirtualInstruction] Do not iterate over a region statement's instruction ↵Michael Kruse2017-07-281-0/+1
| | | | | | | | | list. NFC. It should be empty anyways. In this case it would even be redundant because we just all all instructions in region statements. llvm-svn: 309453
* [ScopBuilder/Simplify] Refactor isEscaping. NFC.Michael Kruse2017-07-271-20/+2
| | | | | | | | | | | | ScopBuilder and Simplify (through VirtualInstruction.cpp) previously used this functionality in their own implementation. Refactor them both into a common one into the Scop class. BlockGenerator also makes use of a similiar functionality, but also records outside users and takes place after region simplification. Merging it as well would be more complicated. llvm-svn: 309273
* [Simplify] Count PHINodes in simplifiable exit nodes as escaping use.Michael Kruse2017-07-271-0/+7
| | | | | | | | | After region exit simplification, the incoming block of a phi node in the SCoP region's exit block lands outside of the region. Since we treat SCoPs as if this already happened, we need to account for that when looking for outside uses of scalars (i.e. escaping scalars). llvm-svn: 309271
* [Simplify] Fix invalid removal write for escaping values.Michael Kruse2017-07-261-2/+2
| | | | | | | | | A PHI node's incoming block is the user of its operand, not the PHI's parent. Assuming the PHINode's parent being the user lead to the removal of a MemoryAccesses because its use was assumed to be inside of the SCoP. llvm-svn: 309164
* [ScopInfo] Rename ScopStmt::contains(BB) to represents(BB). NFC.Michael Kruse2017-07-251-1/+1
| | | | | | | | | | | In future, there will be no more a 1:1 correspondence between statements and basic blocks, the name `contains` does not correctly capture their relationship. A BB may infact comprise of multiple statements; hence we describe a statement 'representing' a basic block. Differential Revision: https://reviews.llvm.org/D35838 llvm-svn: 308982
* Annotate dump() functions with LLVM_DUMP_METHOD. NFC.Michael Kruse2017-07-211-2/+2
| | | | llvm-svn: 308749
* [Simplify] Remove unused instructions and accesses.Michael Kruse2017-07-201-0/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | Use a mark-and-sweep algorithm to find and remove unused instructions and MemoryAccesses. This is useful in particular to remove scalar writes that are never used anywhere. A scalar write in a loop induces a write-after-write dependency that stops the loop iterations to be rescheduled. Such writes can be a result of previous transformations such as DeLICM and operand tree forwarding. It adds a new class VirtualInstruction that represents an instruction in a particular statement. At the moment an instruction can only belong to the statement that represents a BasicBlock. In the future, instructions can be in one of multiple statements representing a BasicBlock (Nandini's work), in different statements than its BasicBlock would indicate, and even multiple statements at once (by forwarding operand trees). It also integrates nicely with the VirtualUse class. ScopStmt::contains(Instruction*) currently uses the instruction's parent BasicBlock to check whether it contains the instruction. It will need to check the actual statement list when one of the aforementioned features become possible. Differential Revision: https://reviews.llvm.org/D35656 llvm-svn: 308626
* Make byref llvm::Use parameters const. NFC.Michael Kruse2017-07-191-1/+2
| | | | llvm-svn: 308522
* [VirtualInstruction] Do a lookup instead of a linear search. NFC.Michael Kruse2017-05-111-20/+1
| | | | llvm-svn: 302837
* Introduce VirtualUse. NFC.Michael Kruse2017-05-041-0/+146
If a ScopStmt references a (scalar) value, there are multiple possibilities where this value can come. The decision about what kind of use it is must be handled consistently at different places, which can be error-prone. VirtualUse is meant to centralize the handling of the different types of value uses. This patch makes ScopBuilder and CodeGeneration use VirtualUse. This already helps to show inconsistencies with the value handling. In order to keep this patch NFC, exceptions to the general rules are added. These might be fixed later if they turn to problems. Overall, this should result in fewer post-codegen IR-verification errors, but instead assertion failures in `getNewValue` that are closer to the actual error. Differential Revision: https://reviews.llvm.org/D32667 llvm-svn: 302157
OpenPOWER on IntegriCloud