LLVM 20.0.0git
|
#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 HashNode * | getRoot () const |
HashNode * | getRoot () |
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< unsigned > | find (const HashSequence &Sequence) const |
Definition at line 42 of file OutlinedHashTree.h.
|
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.
size_t OutlinedHashTree::depth | ( | ) | const |
Definition at line 59 of file OutlinedHashTree.cpp.
References llvm::Depth, N, Size, and walkGraph().
|
inline |
Definition at line 68 of file OutlinedHashTree.h.
References size().
std::optional< unsigned > OutlinedHashTree::find | ( | const HashSequence & | Sequence | ) | const |
Sequence
exists in the OutlinedHashTree. Definition at line 120 of file OutlinedHashTree.cpp.
References getRoot(), I, llvm::HashNode::Successors, and llvm::HashNode::Terminals.
|
inline |
Definition at line 81 of file OutlinedHashTree.h.
Definition at line 80 of file OutlinedHashTree.h.
Referenced by clear(), find(), 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 getRoot(), llvm::HashNode::Hash, I, 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 for(), 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(), P, llvm::sort(), and llvm::Successor.