class ICFLoopSafetyInfo
Declaration
class ICFLoopSafetyInfo : public LoopSafetyInfo { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:135
Inherits from: LoopSafetyInfo
Method Overview
- public ICFLoopSafetyInfo(llvm::DominatorTree * DT)
- public virtual bool anyBlockMayThrow() const
- public virtual bool blockMayThrow(const llvm::BasicBlock * BB) const
- public virtual void computeLoopSafetyInfo(const llvm::Loop * CurLoop)
- public bool doesNotWriteMemoryBefore(const llvm::BasicBlock * BB, const llvm::Loop * CurLoop) const
- public bool doesNotWriteMemoryBefore(const llvm::Instruction & I, const llvm::Loop * CurLoop) const
- public void insertInstructionTo(const llvm::Instruction * Inst, const llvm::BasicBlock * BB)
- public virtual bool isGuaranteedToExecute(const llvm::Instruction & Inst, const llvm::DominatorTree * DT, const llvm::Loop * CurLoop) const
- public void removeInstruction(const llvm::Instruction * Inst)
- public virtual ~ICFLoopSafetyInfo()
Inherited from LoopSafetyInfo:
- public allLoopPathsLeadToBlock
- public anyBlockMayThrow
- public blockMayThrow
- protected computeBlockColors
- public computeLoopSafetyInfo
- public copyColors
- public getBlockColors
- public isGuaranteedToExecute
Methods
¶ICFLoopSafetyInfo(llvm::DominatorTree* DT)
ICFLoopSafetyInfo(llvm::DominatorTree* DT)
Declared at: llvm/include/llvm/Analysis/MustExecute.h:174
Parameters
¶virtual bool anyBlockMayThrow() const
virtual bool anyBlockMayThrow() const
Description
Returns true iff any block of the loop for which this info is contains an instruction that may throw or otherwise exit abnormally.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:146
¶virtual bool blockMayThrow(
const llvm::BasicBlock* BB) const
virtual bool blockMayThrow(
const llvm::BasicBlock* BB) const
Description
Returns true iff the block \p BB potentially may throw exception. It can be false-positive in cases when we want to avoid complex analysis.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:144
Parameters
- const llvm::BasicBlock* BB
¶virtual void computeLoopSafetyInfo(
const llvm::Loop* CurLoop)
virtual void computeLoopSafetyInfo(
const llvm::Loop* CurLoop)
Description
Computes safety information for a loop checks loop body & header for the possibility of may throw exception, it takes LoopSafetyInfo and loop as argument. Updates safety information in LoopSafetyInfo argument. Note: This is defined to clear and reinitialize an already initialized LoopSafetyInfo. Some callers rely on this fact.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:148
Parameters
- const llvm::Loop* CurLoop
¶bool doesNotWriteMemoryBefore(
const llvm::BasicBlock* BB,
const llvm::Loop* CurLoop) const
bool doesNotWriteMemoryBefore(
const llvm::BasicBlock* BB,
const llvm::Loop* CurLoop) const
Description
Returns true if we could not execute a memory-modifying instruction before we enter \p BB under assumption that \p CurLoop is entered.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:156
Parameters
- const llvm::BasicBlock* BB
- const llvm::Loop* CurLoop
¶bool doesNotWriteMemoryBefore(
const llvm::Instruction& I,
const llvm::Loop* CurLoop) const
bool doesNotWriteMemoryBefore(
const llvm::Instruction& I,
const llvm::Loop* CurLoop) const
Description
Returns true if we could not execute a memory-modifying instruction before we execute \p I under assumption that \p CurLoop is entered.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:161
Parameters
- const llvm::Instruction& I
- const llvm::Loop* CurLoop
¶void insertInstructionTo(
const llvm::Instruction* Inst,
const llvm::BasicBlock* BB)
void insertInstructionTo(
const llvm::Instruction* Inst,
const llvm::BasicBlock* BB)
Description
Inform the safety info that we are planning to insert a new instruction\p Inst into the basic block \p BB. It will make all cache updates to keep it correct after this insertion.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:167
Parameters
- const llvm::Instruction* Inst
- const llvm::BasicBlock* BB
¶virtual bool isGuaranteedToExecute(
const llvm::Instruction& Inst,
const llvm::DominatorTree* DT,
const llvm::Loop* CurLoop) const
virtual bool isGuaranteedToExecute(
const llvm::Instruction& Inst,
const llvm::DominatorTree* DT,
const llvm::Loop* CurLoop) const
Description
Returns true if the instruction in a loop is guaranteed to execute at least once (under the assumption that the loop is entered).
Declared at: llvm/include/llvm/Analysis/MustExecute.h:150
Parameters
- const llvm::Instruction& Inst
- const llvm::DominatorTree* DT
- const llvm::Loop* CurLoop
¶void removeInstruction(
const llvm::Instruction* Inst)
void removeInstruction(
const llvm::Instruction* Inst)
Description
Inform safety info that we are planning to remove the instruction \p Inst from its block. It will make all cache updates to keep it correct after this removal.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:172
Parameters
- const llvm::Instruction* Inst
¶virtual ~ICFLoopSafetyInfo()
virtual ~ICFLoopSafetyInfo()
Declared at: llvm/include/llvm/Analysis/MustExecute.h:176