LLVM 20.0.0git
Public Member Functions | List of all members
llvm::OutlinedHashTree Class Reference

#include "llvm/CGData/OutlinedHashTree.h"

Public Member Functions

void walkGraph (NodeCallbackFn CallbackNode, EdgeCallbackFn CallbackEdge=nullptr, bool SortedWalk=false) const
 Walks every edge and node in the OutlinedHashTree and calls CallbackEdge for the edges and CallbackNode for the nodes with the stable_hash for the source and the stable_hash of the sink for an edge.
 
void clear ()
 Release all hash nodes except the root hash node.
 
bool empty ()
 
size_t size (bool GetTerminalCountOnly=false) const
 
size_t depth () const
 
const HashNodegetRoot () const
 
HashNodegetRoot ()
 
void insert (const HashSequencePair &SequencePair)
 Inserts a Sequence into the this tree.
 
void merge (const OutlinedHashTree *OtherTree)
 Merge a OtherTree into this Tree.
 
std::optional< unsignedfind (const HashSequence &Sequence) const
 

Detailed Description

Definition at line 42 of file OutlinedHashTree.h.

Member Function Documentation

◆ clear()

void llvm::OutlinedHashTree::clear ( )
inline

Release all hash nodes except the root hash node.

Definition at line 62 of file OutlinedHashTree.h.

References assert(), getRoot(), and llvm::HashNode::Successors.

◆ depth()

size_t OutlinedHashTree::depth ( ) const
Returns
the depth of a OutlinedHashTree by traversing it.

Definition at line 59 of file OutlinedHashTree.cpp.

References llvm::Depth, N, Size, and walkGraph().

◆ empty()

bool llvm::OutlinedHashTree::empty ( )
inline
Returns
true if the hash tree has only the root node.

Definition at line 68 of file OutlinedHashTree.h.

References size().

◆ find()

std::optional< unsigned > OutlinedHashTree::find ( const HashSequence Sequence) const
Returns
the matching count if Sequence exists in the OutlinedHashTree.

Definition at line 120 of file OutlinedHashTree.cpp.

References getRoot(), I, llvm::HashNode::Successors, and llvm::HashNode::Terminals.

◆ getRoot() [1/2]

HashNode * llvm::OutlinedHashTree::getRoot ( )
inline

Definition at line 81 of file OutlinedHashTree.h.

◆ getRoot() [2/2]

const HashNode * llvm::OutlinedHashTree::getRoot ( ) const
inline
Returns
the root hash node of a OutlinedHashTree.

Definition at line 80 of file OutlinedHashTree.h.

Referenced by clear(), find(), insert(), merge(), and walkGraph().

◆ insert()

void OutlinedHashTree::insert ( const HashSequencePair &  SequencePair)

Inserts a Sequence into the this tree.

The last node in the sequence will increase Terminals.

Definition at line 71 of file OutlinedHashTree.cpp.

References getRoot(), llvm::HashNode::Hash, I, llvm::HashNode::Successors, and llvm::HashNode::Terminals.

◆ merge()

void OutlinedHashTree::merge ( const OutlinedHashTree OtherTree)

Merge a OtherTree into this Tree.

Definition at line 90 of file OutlinedHashTree.cpp.

References for(), getRoot(), llvm::HashNode::Hash, and I.

◆ size()

size_t OutlinedHashTree::size ( bool  GetTerminalCountOnly = false) const
Returns
the size of a OutlinedHashTree by traversing it. If GetTerminalCountOnly is true, it only counts the terminal nodes (meaning it returns the the number of hash sequences in the OutlinedHashTree).

Definition at line 51 of file OutlinedHashTree.cpp.

References N, Size, and walkGraph().

Referenced by empty().

◆ walkGraph()

void OutlinedHashTree::walkGraph ( NodeCallbackFn  CallbackNode,
EdgeCallbackFn  CallbackEdge = nullptr,
bool  SortedWalk = false 
) const

Walks every edge and node in the OutlinedHashTree and calls CallbackEdge for the edges and CallbackNode for the nodes with the stable_hash for the source and the stable_hash of the sink for an edge.

These generic callbacks can be used to traverse a OutlinedHashTree for the purpose of print debugging or serializing it.

Definition at line 21 of file OutlinedHashTree.cpp.

References llvm::SmallVectorImpl< T >::emplace_back(), getRoot(), P, llvm::sort(), and llvm::Successor.

Referenced by depth(), and size().


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