ΒΆbool isPotentiallyReachable(
    const llvm::Instruction* From,
    const llvm::Instruction* To,
    const SmallPtrSetImpl<llvm::BasicBlock*>*
        ExclusionSet = nullptr,
    const llvm::DominatorTree* DT = nullptr,
    const llvm::LoopInfo* LI = nullptr)

Description

Determine whether instruction 'To' is reachable from 'From', without passing through any blocks in ExclusionSet, returning true if uncertain. Determine whether there is a path from From to To within a single function. Returns false only if we can prove that once 'From' has been executed then 'To' can not be executed. Conservatively returns true. This function is linear with respect to the number of blocks in the CFG, walking down successors from From to reach To, with a fixed threshold. Using DT or LI allows us to answer more quickly. LI reduces the cost of an entire loop of any number of blocks to be the same as the cost of a single block. DT reduces the cost by allowing the search to terminate when we find a block that dominates the block containing 'To'. DT is most useful on branchy code but not loops, and LI is most useful on code with loops but does not help on branchy code outside loops.

Declared at: llvm/include/llvm/Analysis/CFG.h:69

Parameters

const llvm::Instruction* From
const llvm::Instruction* To
const SmallPtrSetImpl<llvm::BasicBlock*>* ExclusionSet = nullptr
const llvm::DominatorTree* DT = nullptr
const llvm::LoopInfo* LI = nullptr