struct MustBeExecutedContextExplorer

Declaration

struct MustBeExecutedContextExplorer { /* full declaration omitted */ };

Description

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.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:373

Member Variables

public const bool ExploreInterBlock
Parameter that limit the performed exploration. See the constructor for their meaning. {

Method Overview

  • public MustBeExecutedContextExplorer(bool ExploreInterBlock, GetterTy<const llvm::LoopInfo> LIGetter = [](const llvm::Function &) { return nullptr; }, GetterTy<const llvm::PostDominatorTree> PDTGetter = [](const llvm::Function &) { return nullptr; })
  • public llvm::MustBeExecutedContextExplorer::iterator & begin(const llvm::Instruction * PP)
  • public llvm::MustBeExecutedContextExplorer::const_iterator & begin(const llvm::Instruction * PP) const
  • public llvm::MustBeExecutedContextExplorer::iterator & end()
  • public llvm::MustBeExecutedContextExplorer::iterator & end(const llvm::Instruction *)
  • public llvm::MustBeExecutedContextExplorer::const_iterator & end() const
  • public llvm::MustBeExecutedContextExplorer::const_iterator & end(const llvm::Instruction *) const
  • public const llvm::BasicBlock * findForwardJoinPoint(const llvm::BasicBlock * InitBB)
  • public bool findInContextOf(const llvm::Instruction * I, const llvm::Instruction * PP)
  • public bool findInContextOf(const llvm::Instruction * I, llvm::MustBeExecutedContextExplorer::iterator & EIt, llvm::MustBeExecutedContextExplorer::iterator & EEnd)
  • public const llvm::Instruction * getMustBeExecutedNextInstruction(llvm::MustBeExecutedIterator & It, const llvm::Instruction * PP)
  • public llvm::iterator_range<iterator> range(const llvm::Instruction * PP)
  • public llvm::iterator_range<const_iterator> range(const llvm::Instruction * PP) const
  • public ~MustBeExecutedContextExplorer()

Methods

MustBeExecutedContextExplorer(
    bool ExploreInterBlock,
    GetterTy<const llvm::LoopInfo> LIGetter =
        [](const llvm::Function&) {
          return nullptr;
        },
    GetterTy<const llvm::PostDominatorTree>
        PDTGetter =
            [](const llvm::Function&) {
              return nullptr;
            })

Description

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.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:382

Parameters

bool ExploreInterBlock
Flag to indicate if instructions in blocks other than the parent of PP should be explored.
GetterTy<const llvm::LoopInfo> LIGetter = [](const llvm::Function &) { return nullptr; }
GetterTy<const llvm::PostDominatorTree> PDTGetter = [](const llvm::Function &) { return nullptr; }

llvm::MustBeExecutedContextExplorer::iterator&
begin(const llvm::Instruction* PP)

Description

Return an iterator to explore the context around \p PP.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:402

Parameters

const llvm::Instruction* PP

llvm::MustBeExecutedContextExplorer::
    const_iterator&
    begin(const llvm::Instruction* PP) const

Description

Return an iterator to explore the cached context around \p PP.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:410

Parameters

const llvm::Instruction* PP

llvm::MustBeExecutedContextExplorer::iterator&
end()

Description

Return an universal end iterator. {

Declared at: llvm/include/llvm/Analysis/MustExecute.h:416

llvm::MustBeExecutedContextExplorer::iterator&
end(const llvm::Instruction*)

Declared at: llvm/include/llvm/Analysis/MustExecute.h:417

Parameters

const llvm::Instruction*

llvm::MustBeExecutedContextExplorer::
    const_iterator&
    end() const

Declared at: llvm/include/llvm/Analysis/MustExecute.h:419

llvm::MustBeExecutedContextExplorer::
    const_iterator&
    end(const llvm::Instruction*) const

Declared at: llvm/include/llvm/Analysis/MustExecute.h:420

Parameters

const llvm::Instruction*

const llvm::BasicBlock* findForwardJoinPoint(
    const llvm::BasicBlock* InitBB)

Description

Find the next join point from \p InitBB in forward direction.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:469

Parameters

const llvm::BasicBlock* InitBB

bool findInContextOf(const llvm::Instruction* I,
                     const llvm::Instruction* PP)

Description

Helper to look for \p I in the context of \p PP. The context is expanded until \p I was found or no more expansion is possible.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:440

Parameters

const llvm::Instruction* I
const llvm::Instruction* PP

Returns

True, iff \p I was found.

bool findInContextOf(
    const llvm::Instruction* I,
    llvm::MustBeExecutedContextExplorer::iterator&
        EIt,
    llvm::MustBeExecutedContextExplorer::iterator&
        EEnd)

Description

Helper to look for \p I in the context defined by \p EIt and \p EEnd. The context is expanded until \p I was found or no more expansion is possible.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:451

Parameters

const llvm::Instruction* I
llvm::MustBeExecutedContextExplorer::iterator& EIt
llvm::MustBeExecutedContextExplorer::iterator& EEnd

Returns

True, iff \p I was found.

const llvm::Instruction*
getMustBeExecutedNextInstruction(
    llvm::MustBeExecutedIterator& It,
    const llvm::Instruction* PP)

Description

Return the next instruction that is guaranteed to be executed after \p PP.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:465

Parameters

llvm::MustBeExecutedIterator& It
The iterator that is used to traverse the must be executed context.
const llvm::Instruction* PP
The program point for which the next instruction that is guaranteed to execute is determined.

llvm::iterator_range<iterator> range(
    const llvm::Instruction* PP)

Description

Return an iterator range to explore the context around \p PP.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:424

Parameters

const llvm::Instruction* PP

llvm::iterator_range<const_iterator> range(
    const llvm::Instruction* PP) const

Description

Return an iterator range to explore the cached context around \p PP.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:429

Parameters

const llvm::Instruction* PP

~MustBeExecutedContextExplorer()

Description

Clean up the dynamically allocated iterators.

Declared at: llvm/include/llvm/Analysis/MustExecute.h:392