LLVM 24.0.0git
llvm::SimpleLoopSafetyInfo Class Reference

Simple and conservative implementation of LoopSafetyInfo that can give false-positive answers to its queries in order to avoid complicated analysis. More...

#include "llvm/Analysis/MustExecute.h"

Inheritance diagram for llvm::SimpleLoopSafetyInfo:
[legend]

Public Member Functions

 SimpleLoopSafetyInfo (const Loop *L)
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.
bool isGuaranteedToExecute (const Instruction &Inst, const DominatorTree *DT) const override
 Returns true if the instruction in a loop is guaranteed to execute at least once.
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 BasicBlock *BB, const DominatorTree *DT) const
 Return true if we must reach the block BB under assumption that the loop is entered.
 LoopSafetyInfo (const Loop *CurLoop)
virtual ~LoopSafetyInfo ()=default

Additional Inherited Members

Protected Member Functions inherited from llvm::LoopSafetyInfo
LLVM_ABI void computeBlockColors ()
 Computes block colors.
Protected Attributes inherited from llvm::LoopSafetyInfo
const LoopCurLoop

Detailed Description

Simple and conservative implementation of LoopSafetyInfo that can give false-positive answers to its queries in order to avoid complicated analysis.

Definition at line 106 of file MustExecute.h.

Constructor & Destructor Documentation

◆ SimpleLoopSafetyInfo()

llvm::SimpleLoopSafetyInfo::SimpleLoopSafetyInfo ( const Loop * L)
inlineexplicit

Definition at line 114 of file MustExecute.h.

References llvm::LoopSafetyInfo::LoopSafetyInfo().

Member Function Documentation

◆ anyBlockMayThrow()

bool SimpleLoopSafetyInfo::anyBlockMayThrow ( ) const
overridevirtual

Returns true iff any block of the loop for which this info is contains an instruction that may throw or otherwise exit abnormally.

Implements llvm::LoopSafetyInfo.

Definition at line 45 of file MustExecute.cpp.

Referenced by blockMayThrow(), and llvm::isSafeToUnrollAndJam().

◆ blockMayThrow()

bool SimpleLoopSafetyInfo::blockMayThrow ( const BasicBlock * BB) const
overridevirtual

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 40 of file MustExecute.cpp.

References anyBlockMayThrow().

◆ isGuaranteedToExecute()

bool SimpleLoopSafetyInfo::isGuaranteedToExecute ( const Instruction & Inst,
const DominatorTree * DT ) const
overridevirtual

Returns true if the instruction in a loop is guaranteed to execute at least once.

Implements llvm::LoopSafetyInfo.

Definition at line 273 of file MustExecute.cpp.

References llvm::LoopSafetyInfo::allLoopPathsLeadToBlock(), llvm::LoopSafetyInfo::CurLoop, and llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent().

Referenced by isMustExecuteIn().


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