LLVM 19.0.0git
Public Member Functions | List of all members
llvm::BranchProbabilityInfo::SccInfo Class Reference

#include "llvm/Analysis/BranchProbabilityInfo.h"

Public Member Functions

 SccInfo (const Function &F)
 
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.
 
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.
 
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 215 of file BranchProbabilityInfo.h.

Constructor & Destructor Documentation

◆ SccInfo()

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

Definition at line 217 of file BranchProbabilityInfo.cpp.

References llvm::dbgs(), F, LLVM_DEBUG, and llvm::scc_begin().

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 247 of file BranchProbabilityInfo.cpp.

References 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 259 of file BranchProbabilityInfo.cpp.

References 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 240 of file BranchProbabilityInfo.cpp.

◆ 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 254 of file BranchProbabilityInfo.h.

◆ 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 249 of file BranchProbabilityInfo.h.


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