LLVM  8.0.1
Public Member Functions | List of all members
llvm::OrderedInstructions Class Reference

#include "llvm/Analysis/OrderedInstructions.h"

Public Member Functions

 OrderedInstructions (DominatorTree *DT)
 Constructor. More...
 
bool dominates (const Instruction *, const Instruction *) const
 Return true if first instruction dominates the second. More...
 
bool dfsBefore (const Instruction *, const Instruction *) const
 Return true if the first instruction comes before the second in the dominator tree DFS traversal if they are in different basic blocks, or if the first instruction comes before the second in the same basic block. More...
 
void invalidateBlock (const BasicBlock *BB)
 Invalidate the OrderedBasicBlock cache when its basic block changes. More...
 

Detailed Description

Definition at line 30 of file OrderedInstructions.h.

Constructor & Destructor Documentation

◆ OrderedInstructions()

llvm::OrderedInstructions::OrderedInstructions ( DominatorTree DT)
inline

Constructor.

Definition at line 45 of file OrderedInstructions.h.

References dfsBefore(), and dominates().

Member Function Documentation

◆ dfsBefore()

bool OrderedInstructions::dfsBefore ( const Instruction InstA,
const Instruction InstB 
) const

Return true if the first instruction comes before the second in the dominator tree DFS traversal if they are in different basic blocks, or if the first instruction comes before the second in the same basic block.

Definition at line 41 of file OrderedInstructions.cpp.

References llvm::DomTreeNodeBase< NodeT >::getDFSNumIn(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), and llvm::Instruction::getParent().

Referenced by OrderedInstructions(), and llvm::PredicateInfoClasses::valueComesBefore().

◆ dominates()

bool OrderedInstructions::dominates ( const Instruction InstA,
const Instruction InstB 
) const

Return true if first instruction dominates the second.

Given 2 instructions, use OrderedBasicBlock to check for dominance relation if the instructions are in the same basic block, Otherwise, use dominator tree.

Definition at line 32 of file OrderedInstructions.cpp.

References llvm::DominatorTree::dominates(), and llvm::Instruction::getParent().

Referenced by llvm::InstructionPrecedenceTracking::isPreceededBySpecialInstruction(), and OrderedInstructions().

◆ invalidateBlock()

void llvm::OrderedInstructions::invalidateBlock ( const BasicBlock BB)
inline

Invalidate the OrderedBasicBlock cache when its basic block changes.

i.e. If an instruction is deleted or added to the basic block, the user should call this function to invalidate the OrderedBasicBlock cache for this basic block.

Definition at line 60 of file OrderedInstructions.h.

References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::erase().

Referenced by llvm::InstructionPrecedenceTracking::clear(), llvm::InstructionPrecedenceTracking::insertInstructionTo(), and llvm::InstructionPrecedenceTracking::removeInstruction().


The documentation for this class was generated from the following files: