LLVM 22.0.0git
|
#include "llvm/CGData/OutlinedHashTree.h"
Public Member Functions | |
LLVM_ABI 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 () |
LLVM_ABI size_t | size (bool GetTerminalCountOnly=false) const |
LLVM_ABI size_t | depth () const |
const HashNode * | getRoot () const |
HashNode * | getRoot () |
LLVM_ABI void | insert (const HashSequencePair &SequencePair) |
Inserts a Sequence into the this tree. | |
LLVM_ABI void | merge (const OutlinedHashTree *OtherTree) |
Merge a OtherTree into this Tree. | |
LLVM_ABI std::optional< unsigned > | find (const HashSequence &Sequence) const |
Definition at line 43 of file OutlinedHashTree.h.
|
inline |
Release all hash nodes except the root hash node.
Definition at line 63 of file OutlinedHashTree.h.
References assert(), getRoot(), and llvm::HashNode::Successors.
size_t OutlinedHashTree::depth | ( | ) | const |
Definition at line 59 of file OutlinedHashTree.cpp.
References llvm::Depth, N, Size, and walkGraph().
|
inline |
Definition at line 69 of file OutlinedHashTree.h.
References size().
std::optional< unsigned > OutlinedHashTree::find | ( | const HashSequence & | Sequence | ) | const |
Sequence
exists in the OutlinedHashTree. Definition at line 119 of file OutlinedHashTree.cpp.
References getRoot(), I, llvm::HashNode::Successors, and llvm::HashNode::Terminals.
|
inline |
Definition at line 82 of file OutlinedHashTree.h.
Definition at line 81 of file OutlinedHashTree.h.
Referenced by clear(), find(), getMatchedEntries(), insert(), merge(), and walkGraph().
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 llvm::Count, getRoot(), llvm::HashNode::Hash, I, llvm::Next, llvm::HashNode::Successors, and llvm::HashNode::Terminals.
void OutlinedHashTree::merge | ( | const OutlinedHashTree * | OtherTree | ) |
Merge a OtherTree
into this Tree.
Definition at line 90 of file OutlinedHashTree.cpp.
References getRoot(), llvm::HashNode::Hash, and I.
size_t OutlinedHashTree::size | ( | bool | GetTerminalCountOnly = false | ) | const |
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().
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(), llvm::Next, P, llvm::sort(), and llvm::Successor.