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

Inherited from LoopSafetyInfo:

Methods

ICFLoopSafetyInfo(llvm::DominatorTree* DT)

Declared at: llvm/include/llvm/Analysis/MustExecute.h:174

Parameters

llvm::DominatorTree* DT

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

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)

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

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

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)

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

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)

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()

Declared at: llvm/include/llvm/Analysis/MustExecute.h:176