LLVM: include/llvm/CGData/OutlinedHashTree.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_CGDATA_OUTLINEDHASHTREE_H
16#define LLVM_CGDATA_OUTLINEDHASHTREE_H
17
23
24#include <unordered_map>
25
26namespace llvm {
27
28
29
30
31
33
35
37
38
39 std::unordered_map<stable_hash, std::unique_ptr> Successors;
40};
41
43
44 using EdgeCallbackFn =
46 using NodeCallbackFn = std::function<void(const HashNode *)>;
47
49 using HashSequencePair = std::pair<HashSequence, unsigned>;
50
51public:
52
53
54
55
56
58 EdgeCallbackFn CallbackEdge = nullptr,
59 bool SortedWalk = false) const;
60
61
66
67
69
70
71
72
73
74 LLVM_ABI size_t size(bool GetTerminalCountOnly = false) const;
75
76
78
79
82
83
84
85 LLVM_ABI void insert(const HashSequencePair &SequencePair);
86
87
89
90
91 LLVM_ABI std::optional find(const HashSequence &Sequence) const;
92
93private:
95};
96
97}
98
99#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
Definition OutlinedHashTree.h:42
void clear()
Release all hash nodes except the root hash node.
Definition OutlinedHashTree.h:62
LLVM_ABI size_t depth() const
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 CallbackNo...
LLVM_ABI std::optional< unsigned > find(const HashSequence &Sequence) const
HashNode * getRoot()
Definition OutlinedHashTree.h:81
const HashNode * getRoot() const
Definition OutlinedHashTree.h:80
LLVM_ABI void merge(const OutlinedHashTree *OtherTree)
Merge a OtherTree into this Tree.
LLVM_ABI void insert(const HashSequencePair &SequencePair)
Inserts a Sequence into the this tree.
LLVM_ABI size_t size(bool GetTerminalCountOnly=false) const
bool empty()
Definition OutlinedHashTree.h:68
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This is an optimization pass for GlobalISel generic memory operations.
uint64_t stable_hash
An opaque object representing a stable hash code.
A HashNode is an entry in an OutlinedHashTree, holding a hash value and a collection of Successors (o...
Definition OutlinedHashTree.h:32
std::unordered_map< stable_hash, std::unique_ptr< HashNode > > Successors
The successors of this node.
Definition OutlinedHashTree.h:39
std::optional< unsigned > Terminals
The number of terminals in the sequence ending at this node.
Definition OutlinedHashTree.h:36
stable_hash Hash
The hash value of the node.
Definition OutlinedHashTree.h:34