LLVM API Documentation
Graph of irreducible control flow. More...
#include <BlockFrequencyInfoImpl.h>
Classes | |
struct | IrrNode |
Public Types | |
typedef BlockFrequencyInfoImplBase | BFIBase |
typedef BFIBase::BlockNode | BlockNode |
Public Member Functions | |
template<class BlockEdgesAdder > | |
IrreducibleGraph (BFIBase &BFI, const BFIBase::LoopData *OuterLoop, BlockEdgesAdder addBlockEdges) | |
Construct an explicit graph containing irreducible control flow. | |
template<class BlockEdgesAdder > | |
void | initialize (const BFIBase::LoopData *OuterLoop, BlockEdgesAdder addBlockEdges) |
void | addNodesInLoop (const BFIBase::LoopData &OuterLoop) |
void | addNodesInFunction () |
void | addNode (const BlockNode &Node) |
void | indexNodes () |
template<class BlockEdgesAdder > | |
void | addEdges (const BlockNode &Node, const BFIBase::LoopData *OuterLoop, BlockEdgesAdder addBlockEdges) |
void | addEdge (IrrNode &Irr, const BlockNode &Succ, const BFIBase::LoopData *OuterLoop) |
Public Attributes | |
BFIBase & | BFI |
BlockNode | Start |
const IrrNode * | StartIrr |
std::vector< IrrNode > | Nodes |
SmallDenseMap< uint32_t, IrrNode *, 4 > | Lookup |
Graph of irreducible control flow.
This graph is used for determining the SCCs in a loop (or top-level function) that has irreducible control flow.
During the block frequency algorithm, the local graphs are defined in a light-weight way, deferring to the BasicBlock or MachineBasicBlock graphs for most edges, but getting others from LoopData::ExitMap. The latter only has successor information.
IrreducibleGraph makes this graph explicit. It's in a form that can use GraphTraits (so that analyzeIrreducible() can use scc_iterator), and it explicitly lists predecessors and successors. The initialization that relies on MachineBasicBlock
is defined in the header.
Definition at line 525 of file BlockFrequencyInfoImpl.h.
Definition at line 526 of file BlockFrequencyInfoImpl.h.
Definition at line 530 of file BlockFrequencyInfoImpl.h.
llvm::bfi_detail::IrreducibleGraph::IrreducibleGraph | ( | BFIBase & | BFI, |
const BFIBase::LoopData * | OuterLoop, | ||
BlockEdgesAdder | addBlockEdges | ||
) | [inline] |
Construct an explicit graph containing irreducible control flow.
Construct an explicit graph of the control flow in OuterLoop
(or the top-level function, if OuterLoop
is nullptr
). Uses addBlockEdges
to add block successors that have not been packaged into loops.
BlockFrequencyInfoImpl::computeIrreducibleMass() is the only expected user of this.
Definition at line 558 of file BlockFrequencyInfoImpl.h.
References initialize().
void IrreducibleGraph::addEdge | ( | IrrNode & | Irr, |
const BlockNode & | Succ, | ||
const BFIBase::LoopData * | OuterLoop | ||
) |
Definition at line 548 of file BlockFrequencyInfoImpl.cpp.
References llvm::bfi_detail::IrreducibleGraph::IrrNode::Edges, llvm::BlockFrequencyInfoImplBase::BlockNode::Index, llvm::BlockFrequencyInfoImplBase::LoopData::isHeader(), Lookup(), and llvm::bfi_detail::IrreducibleGraph::IrrNode::NumIn.
Referenced by addEdges(), and llvm::bfi_detail::BlockEdgesAdder< BT >::operator()().
void llvm::bfi_detail::IrreducibleGraph::addEdges | ( | const BlockNode & | Node, |
const BFIBase::LoopData * | OuterLoop, | ||
BlockEdgesAdder | addBlockEdges | ||
) |
Definition at line 595 of file BlockFrequencyInfoImpl.h.
References addEdge(), BFI, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), I, llvm::BlockFrequencyInfoImplBase::BlockNode::Index, Lookup, and llvm::BlockFrequencyInfoImplBase::Working.
Referenced by initialize().
void llvm::bfi_detail::IrreducibleGraph::addNode | ( | const BlockNode & | Node | ) | [inline] |
Definition at line 569 of file BlockFrequencyInfoImpl.h.
References BFI, llvm::bfi_detail::BlockMass::getEmpty(), llvm::BlockFrequencyInfoImplBase::BlockNode::Index, Nodes, and llvm::BlockFrequencyInfoImplBase::Working.
void IrreducibleGraph::addNodesInFunction | ( | ) |
Definition at line 537 of file BlockFrequencyInfoImpl.cpp.
References llvm::ARMISD::BFI.
Referenced by initialize().
void IrreducibleGraph::addNodesInLoop | ( | const BFIBase::LoopData & | OuterLoop | ) |
Definition at line 530 of file BlockFrequencyInfoImpl.cpp.
References llvm::BlockFrequencyInfoImplBase::LoopData::getHeader(), N, llvm::BlockFrequencyInfoImplBase::LoopData::Nodes, and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by initialize().
void IrreducibleGraph::indexNodes | ( | ) |
Definition at line 544 of file BlockFrequencyInfoImpl.cpp.
void llvm::bfi_detail::IrreducibleGraph::initialize | ( | const BFIBase::LoopData * | OuterLoop, |
BlockEdgesAdder | addBlockEdges | ||
) |
Definition at line 581 of file BlockFrequencyInfoImpl.h.
References addEdges(), addNodesInFunction(), addNodesInLoop(), BFI, llvm::BlockFrequencyInfoImplBase::BlockNode::Index, Lookup, N, llvm::BlockFrequencyInfoImplBase::LoopData::Nodes, Start, StartIrr, and llvm::BlockFrequencyInfoImplBase::Working.
Referenced by IrreducibleGraph().
Definition at line 528 of file BlockFrequencyInfoImpl.h.
Referenced by addEdges(), addNode(), and initialize().
SmallDenseMap<uint32_t, IrrNode *, 4> llvm::bfi_detail::IrreducibleGraph::Lookup |
Definition at line 546 of file BlockFrequencyInfoImpl.h.
Referenced by addEdges(), and initialize().
std::vector<IrrNode> llvm::bfi_detail::IrreducibleGraph::Nodes |
Definition at line 545 of file BlockFrequencyInfoImpl.h.
Referenced by addNode().
Definition at line 543 of file BlockFrequencyInfoImpl.h.
Referenced by initialize().
Definition at line 544 of file BlockFrequencyInfoImpl.h.
Referenced by llvm::GraphTraits< IrreducibleGraph >::getEntryNode(), and initialize().