class SimpleLoopSafetyInfo
Declaration
class SimpleLoopSafetyInfo : public LoopSafetyInfo { /* full declaration omitted */ };
Description
Simple and conservative implementation of LoopSafetyInfo that can give false-positive answers to its queries in order to avoid complicated analysis.
Declared at: llvm/include/llvm/Analysis/MustExecute.h:110
Inherits from: LoopSafetyInfo
Member Variables
- private bool MayThrow = false
- private bool HeaderMayThrow = false
Method Overview
- public bool anyBlockMayThrow() const
- public bool blockMayThrow(const llvm::BasicBlock * BB) const
- public void computeLoopSafetyInfo(const llvm::Loop * CurLoop)
- public bool isGuaranteedToExecute(const llvm::Instruction & Inst, const llvm::DominatorTree * DT, const llvm::Loop * CurLoop) const
Inherited from LoopSafetyInfo:
- public allLoopPathsLeadToBlock
- public anyBlockMayThrow
- public blockMayThrow
- protected computeBlockColors
- public computeLoopSafetyInfo
- public copyColors
- public getBlockColors
- public isGuaranteedToExecute
Methods
¶bool anyBlockMayThrow() const
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:118
¶bool blockMayThrow(
const llvm::BasicBlock* BB) const
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:116
Parameters
- const llvm::BasicBlock* BB
¶void computeLoopSafetyInfo(
const llvm::Loop* CurLoop)
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:120
Parameters
- const llvm::Loop* CurLoop
¶bool isGuaranteedToExecute(
const llvm::Instruction& Inst,
const llvm::DominatorTree* DT,
const llvm::Loop* CurLoop) const
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:122
Parameters
- const llvm::Instruction& Inst
- const llvm::DominatorTree* DT
- const llvm::Loop* CurLoop