15#ifndef LLVM_CODEGENDATA_OUTLINEDHASHTREE_H
16#define LLVM_CODEGENDATA_OUTLINEDHASHTREE_H
23#include <unordered_map>
39 std::unordered_map<stable_hash, std::unique_ptr<HashNode>>
Successors;
44 using EdgeCallbackFn =
46 using NodeCallbackFn = std::function<void(
const HashNode *)>;
49 using HashSequencePair = std::pair<HashSequence, unsigned>;
57 void walkGraph(NodeCallbackFn CallbackNode,
58 EdgeCallbackFn CallbackEdge =
nullptr,
59 bool SortedWalk =
false)
const;
74 size_t size(
bool GetTerminalCountOnly =
false)
const;
85 void insert(
const HashSequencePair &SequencePair);
91 std::optional<unsigned>
find(
const HashSequence &Sequence)
const;
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void clear()
Release all hash nodes except the root hash node.
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...
std::optional< unsigned > find(const HashSequence &Sequence) const
const HashNode * getRoot() const
void merge(const OutlinedHashTree *OtherTree)
Merge a OtherTree into this Tree.
void insert(const HashSequencePair &SequencePair)
Inserts a Sequence into the this tree.
size_t size(bool GetTerminalCountOnly=false) const
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.
A HashNode is an entry in an OutlinedHashTree, holding a hash value and a collection of Successors (o...
std::unordered_map< stable_hash, std::unique_ptr< HashNode > > Successors
The successors of this node.
std::optional< unsigned > Terminals
The number of terminals in the sequence ending at this node.
stable_hash Hash
The hash value of the node.