LLVM 22.0.0git
llvm::BranchProbabilityInfo::SccInfo Class Reference

#include "llvm/Analysis/BranchProbabilityInfo.h"

Public Member Functions

LLVM_ABI SccInfo (const Function &F)
LLVM_ABI int getSCCNum (const BasicBlock *BB) const
 If BB belongs to some SCC then ID of that SCC is returned, otherwise -1 is returned.
bool isSCCHeader (const BasicBlock *BB, int SccNum) const
 Returns true if BB is a 'header' block in SCC with SccNum ID, false otherwise.
bool isSCCExitingBlock (const BasicBlock *BB, int SccNum) const
 Returns true if BB is an 'exiting' block in SCC with SccNum ID, false otherwise.
LLVM_ABI void getSccEnterBlocks (int SccNum, SmallVectorImpl< BasicBlock * > &Enters) const
 Fills in Enters vector with all such blocks that don't belong to SCC with SccNum ID but there is an edge to a block belonging to the SCC.
LLVM_ABI void getSccExitBlocks (int SccNum, SmallVectorImpl< BasicBlock * > &Exits) const
 Fills in Exits vector with all such blocks that don't belong to SCC with SccNum ID but there is an edge from a block belonging to the SCC.

Detailed Description

Definition at line 217 of file BranchProbabilityInfo.h.

Constructor & Destructor Documentation

◆ SccInfo()

BranchProbabilityInfo::SccInfo::SccInfo ( const Function & F)
explicit

Member Function Documentation

◆ getSccEnterBlocks()

void BranchProbabilityInfo::SccInfo::getSccEnterBlocks ( int SccNum,
SmallVectorImpl< BasicBlock * > & Enters ) const

Fills in Enters vector with all such blocks that don't belong to SCC with SccNum ID but there is an edge to a block belonging to the SCC.

Definition at line 243 of file BranchProbabilityInfo.cpp.

References getSCCNum(), isSCCHeader(), llvm::predecessors(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

◆ getSccExitBlocks()

void BranchProbabilityInfo::SccInfo::getSccExitBlocks ( int SccNum,
SmallVectorImpl< BasicBlock * > & Exits ) const

Fills in Exits vector with all such blocks that don't belong to SCC with SccNum ID but there is an edge from a block belonging to the SCC.

Definition at line 255 of file BranchProbabilityInfo.cpp.

References getSCCNum(), isSCCExitingBlock(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::successors().

◆ getSCCNum()

int BranchProbabilityInfo::SccInfo::getSCCNum ( const BasicBlock * BB) const

If BB belongs to some SCC then ID of that SCC is returned, otherwise -1 is returned.

If BB belongs to more than one SCC at the same time result is undefined.

Definition at line 236 of file BranchProbabilityInfo.cpp.

Referenced by getSccEnterBlocks(), and getSccExitBlocks().

◆ isSCCExitingBlock()

bool llvm::BranchProbabilityInfo::SccInfo::isSCCExitingBlock ( const BasicBlock * BB,
int SccNum ) const
inline

Returns true if BB is an 'exiting' block in SCC with SccNum ID, false otherwise.

Definition at line 256 of file BranchProbabilityInfo.h.

Referenced by getSccExitBlocks().

◆ isSCCHeader()

bool llvm::BranchProbabilityInfo::SccInfo::isSCCHeader ( const BasicBlock * BB,
int SccNum ) const
inline

Returns true if BB is a 'header' block in SCC with SccNum ID, false otherwise.

Definition at line 251 of file BranchProbabilityInfo.h.

Referenced by getSccEnterBlocks().


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