LLVM: llvm::ICFLoopSafetyInfo Class Reference (original) (raw)

This implementation of LoopSafetyInfo use ImplicitControlFlowTracking to give precise answers on "may throw" queries. More...

#include "[llvm/Analysis/MustExecute.h](MustExecute%5F8h%5Fsource.html)"

Public Member Functions
bool blockMayThrow (const BasicBlock *BB) const override
Returns true iff the block BB potentially may throw exception.
bool anyBlockMayThrow () const override
Returns true iff any block of the loop for which this info is contains an instruction that may throw or otherwise exit abnormally.
void computeLoopSafetyInfo (const Loop *CurLoop) override
Computes safety information for a loop checks loop body & header for the possibility of may throw exception, it takes LoopSafetyInfo and loop as argument.
bool isGuaranteedToExecute (const Instruction &Inst, const DominatorTree *DT, const Loop *CurLoop) const override
Returns true if the instruction in a loop is guaranteed to execute at least once (under the assumption that the loop is entered).
bool doesNotWriteMemoryBefore (const BasicBlock *BB, const Loop *CurLoop) const
Returns true if we could not execute a memory-modifying instruction before we enter BB under assumption that CurLoop is entered.
bool doesNotWriteMemoryBefore (const Instruction &I, const Loop *CurLoop) const
Returns true if we could not execute a memory-modifying instruction before we execute I under assumption that CurLoop is entered.
void insertInstructionTo (const Instruction *Inst, const BasicBlock *BB)
Inform the safety info that we are planning to insert a new instruction Inst into the basic block BB.
void removeInstruction (const Instruction *Inst)
Inform safety info that we are planning to remove the instruction Inst from its block.
Public Member Functions inherited from llvm::LoopSafetyInfo
LLVM_ABI const DenseMap< BasicBlock *, ColorVector > & getBlockColors () const
Returns block colors map that is used to update funclet operand bundles.
LLVM_ABI void copyColors (BasicBlock *New, BasicBlock *Old)
Copy colors of block Old into the block New.
LLVM_ABI bool allLoopPathsLeadToBlock (const Loop *CurLoop, const BasicBlock *BB, const DominatorTree *DT) const
Return true if we must reach the block BB under assumption that the loop CurLoop is entered.
LoopSafetyInfo ()=default
virtual ~LoopSafetyInfo ()=default

This implementation of LoopSafetyInfo use ImplicitControlFlowTracking to give precise answers on "may throw" queries.

This implementation uses cache that should be invalidated by calling the methods insertInstructionTo and removeInstruction whenever we modify a basic block's contents by adding or removing instructions.

Definition at line 133 of file MustExecute.h.

anyBlockMayThrow()

bool ICFLoopSafetyInfo::anyBlockMayThrow ( ) const overridevirtual

blockMayThrow()

Returns true iff the block BB potentially may throw exception.

It can be false-positive in cases when we want to avoid complex analysis.

Implements llvm::LoopSafetyInfo.

Definition at line 69 of file MustExecute.cpp.

computeLoopSafetyInfo()

void ICFLoopSafetyInfo::computeLoopSafetyInfo ( const Loop * CurLoop) overridevirtual

doesNotWriteMemoryBefore() [1/2]

doesNotWriteMemoryBefore() [2/2]

insertInstructionTo()

isGuaranteedToExecute()

removeInstruction()


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