|
LLVM
10.0.0
|
A "must be executed context" for a given program point PP is the set of instructions, potentially before and after PP, that are executed always when PP is reached. More...
#include "llvm/Analysis/MustExecute.h"
Public Types | |
| using | iterator = MustBeExecutedIterator |
| Iterator-based interface. More... | |
| using | const_iterator = const MustBeExecutedIterator |
Public Member Functions | |
| MustBeExecutedContextExplorer (bool ExploreInterBlock, GetterTy< const LoopInfo > LIGetter=[](const Function &) { return nullptr;}, GetterTy< const PostDominatorTree > PDTGetter=[](const Function &) { return nullptr;}) | |
| In the description of the parameters we use PP to denote a program point for which the must be executed context is explored, or put differently, for which the MustBeExecutedIterator is created. More... | |
| ~MustBeExecutedContextExplorer () | |
| Clean up the dynamically allocated iterators. More... | |
| iterator & | begin (const Instruction *PP) |
Return an iterator to explore the context around PP. More... | |
| const_iterator & | begin (const Instruction *PP) const |
Return an iterator to explore the cached context around PP. More... | |
| iterator & | end () |
| Return an universal end iterator. More... | |
| iterator & | end (const Instruction *) |
| const_iterator & | end () const |
| const_iterator & | end (const Instruction *) const |
| llvm::iterator_range< iterator > | range (const Instruction *PP) |
| } More... | |
| llvm::iterator_range< const_iterator > | range (const Instruction *PP) const |
Return an iterator range to explore the cached context around PP. More... | |
| bool | findInContextOf (const Instruction *I, const Instruction *PP) |
| } More... | |
| bool | findInContextOf (const Instruction *I, iterator &EIt, iterator &EEnd) |
Helper to look for I in the context defined by EIt and EEnd. More... | |
| const Instruction * | getMustBeExecutedNextInstruction (MustBeExecutedIterator &It, const Instruction *PP) |
Return the next instruction that is guaranteed to be executed after PP. More... | |
| const BasicBlock * | findForwardJoinPoint (const BasicBlock *InitBB) |
Find the next join point from InitBB in forward direction. More... | |
Public Attributes | |
| const bool | ExploreInterBlock |
| Parameter that limit the performed exploration. More... | |
A "must be executed context" for a given program point PP is the set of instructions, potentially before and after PP, that are executed always when PP is reached.
The MustBeExecutedContextExplorer an interface to explore "must be executed contexts" in a module through the use of MustBeExecutedIterator.
The explorer exposes "must be executed iterators" that traverse the must be executed context. There is little information sharing between iterators as the expected use case involves few iterators for "far apart" instructions. If that changes, we should consider caching more intermediate results.
Definition at line 373 of file MustExecute.h.
Definition at line 399 of file MustExecute.h.
Iterator-based interface.
Definition at line 398 of file MustExecute.h.
|
inline |
In the description of the parameters we use PP to denote a program point for which the must be executed context is explored, or put differently, for which the MustBeExecutedIterator is created.
| ExploreInterBlock | Flag to indicate if instructions in blocks other than the parent of PP should be explored. |
Definition at line 382 of file MustExecute.h.
|
inline |
Clean up the dynamically allocated iterators.
Definition at line 392 of file MustExecute.h.
References llvm::DeleteContainerSeconds().
|
inline |
Return an iterator to explore the context around PP.
Definition at line 402 of file MustExecute.h.
Referenced by llvm::IRPosition::getAttrs().
|
inline |
Return an iterator to explore the cached context around PP.
Definition at line 410 of file MustExecute.h.
|
inline |
Return an universal end iterator.
{
Definition at line 416 of file MustExecute.h.
Referenced by llvm::IRPosition::getAttrs().
|
inline |
Definition at line 417 of file MustExecute.h.
|
inline |
Definition at line 419 of file MustExecute.h.
|
inline |
Definition at line 420 of file MustExecute.h.
| const BasicBlock * MustBeExecutedContextExplorer::findForwardJoinPoint | ( | const BasicBlock * | InitBB | ) |
Find the next join point from InitBB in forward direction.
Definition at line 499 of file MustExecute.cpp.
References llvm::dbgs(), llvm::SmallVectorBase::empty(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor(), llvm::Value::getName(), getOrCreateCachedOptional(), llvm::BasicBlock::getParent(), llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlock(), llvm::BasicBlock::getUniqueSuccessor(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isGuaranteedToTransferExecutionToSuccessor(), LLVM_DEBUG, maybeEndlessLoop(), mayContainIrreducibleControl(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), and llvm::successors().
|
inline |
}
Helper to look for I in the context of PP.
The context is expanded until I was found or no more expansion is possible.
I was found. Definition at line 440 of file MustExecute.h.
References llvm::sys::path::begin(), and llvm::sys::path::end().
Referenced by llvm::IRPosition::getAttrs().
|
inline |
Helper to look for I in the context defined by EIt and EEnd.
The context is expanded until I was found or no more expansion is possible.
I was found. Definition at line 451 of file MustExecute.h.
References llvm::MustBeExecutedIterator::count(), and I.
| const Instruction * MustBeExecutedContextExplorer::getMustBeExecutedNextInstruction | ( | MustBeExecutedIterator & | It, |
| const Instruction * | PP | ||
| ) |
Return the next instruction that is guaranteed to be executed after PP.
| It | The iterator that is used to traverse the must be executed context. |
| PP | The program point for which the next instruction that is guaranteed to execute is determined. |
Definition at line 637 of file MustExecute.cpp.
References assert(), llvm::dbgs(), llvm::BasicBlock::front(), getMustBeExecutedNextInstruction(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::Instruction::getNumSuccessors(), llvm::Instruction::getParent(), llvm::Instruction::getSuccessor(), I, llvm::isGuaranteedToTransferExecutionToSuccessor(), llvm::Instruction::isTerminator(), LLVM_DEBUG, and llvm::MustBeExecutedIterator::MustBeExecutedIterator().
Referenced by getMustBeExecutedNextInstruction().
|
inline |
}
Return an iterator range to explore the context around PP.
Definition at line 424 of file MustExecute.h.
References llvm::sys::path::begin(), llvm::sys::path::end(), and llvm::make_range().
Referenced by llvm::createMustBeExecutedContextPrinter().
|
inline |
Return an iterator range to explore the cached context around PP.
Definition at line 429 of file MustExecute.h.
References llvm::sys::path::begin(), llvm::sys::path::end(), and llvm::make_range().
Parameter that limit the performed exploration.
See the constructor for their meaning. {
Definition at line 474 of file MustExecute.h.
1.8.13