/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/ADT/ScopedHashTable.h
Line | Count | Source |
1 | | //===- ScopedHashTable.h - A simple scoped hash table -----------*- C++ -*-===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | // |
9 | | // This file implements an efficient scoped hash table, which is useful for |
10 | | // things like dominator-based optimizations. This allows clients to do things |
11 | | // like this: |
12 | | // |
13 | | // ScopedHashTable<int, int> HT; |
14 | | // { |
15 | | // ScopedHashTableScope<int, int> Scope1(HT); |
16 | | // HT.insert(0, 0); |
17 | | // HT.insert(1, 1); |
18 | | // { |
19 | | // ScopedHashTableScope<int, int> Scope2(HT); |
20 | | // HT.insert(0, 42); |
21 | | // } |
22 | | // } |
23 | | // |
24 | | // Looking up the value for "0" in the Scope2 block will return 42. Looking |
25 | | // up the value for 0 before 42 is inserted or after Scope2 is popped will |
26 | | // return 0. |
27 | | // |
28 | | //===----------------------------------------------------------------------===// |
29 | | |
30 | | #ifndef LLVM_ADT_SCOPEDHASHTABLE_H |
31 | | #define LLVM_ADT_SCOPEDHASHTABLE_H |
32 | | |
33 | | #include "llvm/ADT/DenseMap.h" |
34 | | #include "llvm/ADT/DenseMapInfo.h" |
35 | | #include "llvm/Support/Allocator.h" |
36 | | #include <cassert> |
37 | | #include <new> |
38 | | |
39 | | namespace llvm { |
40 | | |
41 | | template <typename K, typename V, typename KInfo = DenseMapInfo<K>, |
42 | | typename AllocatorTy = MallocAllocator> |
43 | | class ScopedHashTable; |
44 | | |
45 | | template <typename K, typename V> |
46 | | class ScopedHashTableVal { |
47 | | ScopedHashTableVal *NextInScope; |
48 | | ScopedHashTableVal *NextForKey; |
49 | | K Key; |
50 | | V Val; |
51 | | |
52 | 27.0M | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::ScopedHashTableVal(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&) Line | Count | Source | 52 | 1.10k | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::ScopedHashTableVal(llvm::MachineInstr* const&, unsigned int const&) Line | Count | Source | 52 | 6.86M | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::ScopedHashTableVal((anonymous namespace)::SimpleValue const&, llvm::Value* const&) Line | Count | Source | 52 | 15.0M | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::ScopedHashTableVal(llvm::MemoryLocation const&, unsigned int const&) Line | Count | Source | 52 | 946 | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::ScopedHashTableVal(llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&) Line | Count | Source | 52 | 5.15M | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::ScopedHashTableVal((anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&) Line | Count | Source | 52 | 46.2k | ScopedHashTableVal(const K &key, const V &val) : Key(key), Val(val) {} |
|
53 | | |
54 | | public: |
55 | 27.0M | const K &getKey() const { return Key; } llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getKey() const Line | Count | Source | 55 | 1.10k | const K &getKey() const { return Key; } |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getKey() const Line | Count | Source | 55 | 6.86M | const K &getKey() const { return Key; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getKey() const Line | Count | Source | 55 | 46.2k | const K &getKey() const { return Key; } |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::getKey() const Line | Count | Source | 55 | 946 | const K &getKey() const { return Key; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getKey() const Line | Count | Source | 55 | 5.15M | const K &getKey() const { return Key; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getKey() const Line | Count | Source | 55 | 15.0M | const K &getKey() const { return Key; } |
|
56 | | const V &getValue() const { return Val; } |
57 | 2.41M | V &getValue() { return Val; } llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getValue() Line | Count | Source | 57 | 90 | V &getValue() { return Val; } |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getValue() Line | Count | Source | 57 | 429k | V &getValue() { return Val; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getValue() Line | Count | Source | 57 | 836k | V &getValue() { return Val; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getValue() Line | Count | Source | 57 | 1.14M | V &getValue() { return Val; } |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::getValue() Line | Count | Source | 57 | 36 | V &getValue() { return Val; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getValue() Line | Count | Source | 57 | 2.02k | V &getValue() { return Val; } |
|
58 | | |
59 | 30.9M | ScopedHashTableVal *getNextForKey() { return NextForKey; } llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getNextForKey() Line | Count | Source | 59 | 1.14k | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getNextForKey() Line | Count | Source | 59 | 7.30M | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getNextForKey() Line | Count | Source | 59 | 48.1k | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::getNextForKey() Line | Count | Source | 59 | 946 | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getNextForKey() Line | Count | Source | 59 | 6.10M | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getNextForKey() Line | Count | Source | 59 | 17.4M | ScopedHashTableVal *getNextForKey() { return NextForKey; } |
|
60 | | const ScopedHashTableVal *getNextForKey() const { return NextForKey; } |
61 | 27.0M | ScopedHashTableVal *getNextInScope() { return NextInScope; } llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::getNextInScope() Line | Count | Source | 61 | 1.10k | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::getNextInScope() Line | Count | Source | 61 | 6.86M | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::getNextInScope() Line | Count | Source | 61 | 46.2k | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::getNextInScope() Line | Count | Source | 61 | 946 | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::getNextInScope() Line | Count | Source | 61 | 5.15M | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::getNextInScope() Line | Count | Source | 61 | 15.0M | ScopedHashTableVal *getNextInScope() { return NextInScope; } |
|
62 | | |
63 | | template <typename AllocatorTy> |
64 | | static ScopedHashTableVal *Create(ScopedHashTableVal *nextInScope, |
65 | | ScopedHashTableVal *nextForKey, |
66 | | const K &key, const V &val, |
67 | 27.0M | AllocatorTy &Allocator) { |
68 | 27.0M | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); |
69 | 27.0M | // Set up the value. |
70 | 27.0M | new (New) ScopedHashTableVal(key, val); |
71 | 27.0M | New->NextInScope = nextInScope; |
72 | 27.0M | New->NextForKey = nextForKey; |
73 | 27.0M | return New; |
74 | 27.0M | } llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >* llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >(llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*, llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul>&) Line | Count | Source | 67 | 1.10k | AllocatorTy &Allocator) { | 68 | 1.10k | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 1.10k | // Set up the value. | 70 | 1.10k | new (New) ScopedHashTableVal(key, val); | 71 | 1.10k | New->NextInScope = nextInScope; | 72 | 1.10k | New->NextForKey = nextForKey; | 73 | 1.10k | return New; | 74 | 1.10k | } |
llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>* llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >(llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*, llvm::MachineInstr* const&, unsigned int const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul>&) Line | Count | Source | 67 | 6.86M | AllocatorTy &Allocator) { | 68 | 6.86M | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 6.86M | // Set up the value. | 70 | 6.86M | new (New) ScopedHashTableVal(key, val); | 71 | 6.86M | New->NextInScope = nextInScope; | 72 | 6.86M | New->NextForKey = nextForKey; | 73 | 6.86M | return New; | 74 | 6.86M | } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>* llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >(llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*, (anonymous namespace)::SimpleValue const&, llvm::Value* const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul>&) Line | Count | Source | 67 | 15.0M | AllocatorTy &Allocator) { | 68 | 15.0M | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 15.0M | // Set up the value. | 70 | 15.0M | new (New) ScopedHashTableVal(key, val); | 71 | 15.0M | New->NextInScope = nextInScope; | 72 | 15.0M | New->NextForKey = nextForKey; | 73 | 15.0M | return New; | 74 | 15.0M | } |
llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>* llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >(llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>*, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>*, llvm::MemoryLocation const&, unsigned int const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul>&) Line | Count | Source | 67 | 946 | AllocatorTy &Allocator) { | 68 | 946 | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 946 | // Set up the value. | 70 | 946 | new (New) ScopedHashTableVal(key, val); | 71 | 946 | New->NextInScope = nextInScope; | 72 | 946 | New->NextForKey = nextForKey; | 73 | 946 | return New; | 74 | 946 | } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>* llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::Create<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >(llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*, llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul>&) Line | Count | Source | 67 | 5.15M | AllocatorTy &Allocator) { | 68 | 5.15M | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 5.15M | // Set up the value. | 70 | 5.15M | new (New) ScopedHashTableVal(key, val); | 71 | 5.15M | New->NextInScope = nextInScope; | 72 | 5.15M | New->NextForKey = nextForKey; | 73 | 5.15M | return New; | 74 | 5.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >* llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::Create<llvm::MallocAllocator>(llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*, llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*, (anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&, llvm::MallocAllocator&) Line | Count | Source | 67 | 46.2k | AllocatorTy &Allocator) { | 68 | 46.2k | ScopedHashTableVal *New = Allocator.template Allocate<ScopedHashTableVal>(); | 69 | 46.2k | // Set up the value. | 70 | 46.2k | new (New) ScopedHashTableVal(key, val); | 71 | 46.2k | New->NextInScope = nextInScope; | 72 | 46.2k | New->NextForKey = nextForKey; | 73 | 46.2k | return New; | 74 | 46.2k | } |
|
75 | | |
76 | 27.0M | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { |
77 | 27.0M | // Free memory referenced by the item. |
78 | 27.0M | this->~ScopedHashTableVal(); |
79 | 27.0M | Allocator.Deallocate(this); |
80 | 27.0M | } void llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul>&) Line | Count | Source | 76 | 1.10k | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 1.10k | // Free memory referenced by the item. | 78 | 1.10k | this->~ScopedHashTableVal(); | 79 | 1.10k | Allocator.Deallocate(this); | 80 | 1.10k | } |
void llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul>&) Line | Count | Source | 76 | 6.86M | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 6.86M | // Free memory referenced by the item. | 78 | 6.86M | this->~ScopedHashTableVal(); | 79 | 6.86M | Allocator.Deallocate(this); | 80 | 6.86M | } |
EarlyCSE.cpp:void llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >::Destroy<llvm::MallocAllocator>(llvm::MallocAllocator&) Line | Count | Source | 76 | 46.2k | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 46.2k | // Free memory referenced by the item. | 78 | 46.2k | this->~ScopedHashTableVal(); | 79 | 46.2k | Allocator.Deallocate(this); | 80 | 46.2k | } |
void llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul>&) Line | Count | Source | 76 | 946 | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 946 | // Free memory referenced by the item. | 78 | 946 | this->~ScopedHashTableVal(); | 79 | 946 | Allocator.Deallocate(this); | 80 | 946 | } |
EarlyCSE.cpp:void llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul>&) Line | Count | Source | 76 | 5.15M | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 5.15M | // Free memory referenced by the item. | 78 | 5.15M | this->~ScopedHashTableVal(); | 79 | 5.15M | Allocator.Deallocate(this); | 80 | 5.15M | } |
EarlyCSE.cpp:void llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>::Destroy<llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >(llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul>&) Line | Count | Source | 76 | 15.0M | template <typename AllocatorTy> void Destroy(AllocatorTy &Allocator) { | 77 | 15.0M | // Free memory referenced by the item. | 78 | 15.0M | this->~ScopedHashTableVal(); | 79 | 15.0M | Allocator.Deallocate(this); | 80 | 15.0M | } |
|
81 | | }; |
82 | | |
83 | | template <typename K, typename V, typename KInfo = DenseMapInfo<K>, |
84 | | typename AllocatorTy = MallocAllocator> |
85 | | class ScopedHashTableScope { |
86 | | /// HT - The hashtable that we are active for. |
87 | | ScopedHashTable<K, V, KInfo, AllocatorTy> &HT; |
88 | | |
89 | | /// PrevScope - This is the scope that we are shadowing in HT. |
90 | | ScopedHashTableScope *PrevScope; |
91 | | |
92 | | /// LastValInScope - This is the last value that was inserted for this scope |
93 | | /// or null if none have been inserted yet. |
94 | | ScopedHashTableVal<K, V> *LastValInScope; |
95 | | |
96 | | public: |
97 | | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, AllocatorTy> &HT); |
98 | | ScopedHashTableScope(ScopedHashTableScope &) = delete; |
99 | | ScopedHashTableScope &operator=(ScopedHashTableScope &) = delete; |
100 | | ~ScopedHashTableScope(); |
101 | | |
102 | | ScopedHashTableScope *getParentScope() { return PrevScope; } |
103 | | const ScopedHashTableScope *getParentScope() const { return PrevScope; } |
104 | | |
105 | | private: |
106 | | friend class ScopedHashTable<K, V, KInfo, AllocatorTy>; |
107 | | |
108 | 27.0M | ScopedHashTableVal<K, V> *getLastValInScope() { |
109 | 27.0M | return LastValInScope; |
110 | 27.0M | } llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::getLastValInScope() Line | Count | Source | 108 | 1.10k | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 1.10k | return LastValInScope; | 110 | 1.10k | } |
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::getLastValInScope() Line | Count | Source | 108 | 6.86M | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 6.86M | return LastValInScope; | 110 | 6.86M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::getLastValInScope() Line | Count | Source | 108 | 15.0M | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 15.0M | return LastValInScope; | 110 | 15.0M | } |
llvm::ScopedHashTableScope<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::getLastValInScope() Line | Count | Source | 108 | 946 | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 946 | return LastValInScope; | 110 | 946 | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::getLastValInScope() Line | Count | Source | 108 | 5.15M | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 5.15M | return LastValInScope; | 110 | 5.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::getLastValInScope() Line | Count | Source | 108 | 46.2k | ScopedHashTableVal<K, V> *getLastValInScope() { | 109 | 46.2k | return LastValInScope; | 110 | 46.2k | } |
|
111 | | |
112 | 27.0M | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { |
113 | 27.0M | LastValInScope = Val; |
114 | 27.0M | } llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >*) Line | Count | Source | 112 | 1.10k | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 1.10k | LastValInScope = Val; | 114 | 1.10k | } |
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>*) Line | Count | Source | 112 | 6.86M | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 6.86M | LastValInScope = Val; | 114 | 6.86M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*) Line | Count | Source | 112 | 15.0M | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 15.0M | LastValInScope = Val; | 114 | 15.0M | } |
llvm::ScopedHashTableScope<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>*) Line | Count | Source | 112 | 946 | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 946 | LastValInScope = Val; | 114 | 946 | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::setLastValInScope(llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>*) Line | Count | Source | 112 | 5.15M | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 5.15M | LastValInScope = Val; | 114 | 5.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::setLastValInScope(llvm::ScopedHashTableVal<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int> >*) Line | Count | Source | 112 | 46.2k | void setLastValInScope(ScopedHashTableVal<K, V> *Val) { | 113 | 46.2k | LastValInScope = Val; | 114 | 46.2k | } |
|
115 | | }; |
116 | | |
117 | | template <typename K, typename V, typename KInfo = DenseMapInfo<K>> |
118 | | class ScopedHashTableIterator { |
119 | | ScopedHashTableVal<K, V> *Node; |
120 | | |
121 | | public: |
122 | | ScopedHashTableIterator(ScopedHashTableVal<K, V> *node) : Node(node) {} |
123 | | |
124 | | V &operator*() const { |
125 | | assert(Node && "Dereference end()"); |
126 | | return Node->getValue(); |
127 | | } |
128 | | V *operator->() const { |
129 | | return &Node->getValue(); |
130 | | } |
131 | | |
132 | | bool operator==(const ScopedHashTableIterator &RHS) const { |
133 | | return Node == RHS.Node; |
134 | | } |
135 | | bool operator!=(const ScopedHashTableIterator &RHS) const { |
136 | | return Node != RHS.Node; |
137 | | } |
138 | | |
139 | | inline ScopedHashTableIterator& operator++() { // Preincrement |
140 | | assert(Node && "incrementing past end()"); |
141 | | Node = Node->getNextForKey(); |
142 | | return *this; |
143 | | } |
144 | | ScopedHashTableIterator operator++(int) { // Postincrement |
145 | | ScopedHashTableIterator tmp = *this; ++*this; return tmp; |
146 | | } |
147 | | }; |
148 | | |
149 | | template <typename K, typename V, typename KInfo, typename AllocatorTy> |
150 | | class ScopedHashTable { |
151 | | public: |
152 | | /// ScopeTy - This is a helpful typedef that allows clients to get easy access |
153 | | /// to the name of the scope for this hash table. |
154 | | using ScopeTy = ScopedHashTableScope<K, V, KInfo, AllocatorTy>; |
155 | | using size_type = unsigned; |
156 | | |
157 | | private: |
158 | | friend class ScopedHashTableScope<K, V, KInfo, AllocatorTy>; |
159 | | |
160 | | using ValTy = ScopedHashTableVal<K, V>; |
161 | | |
162 | | DenseMap<K, ValTy*, KInfo> TopLevelMap; |
163 | | ScopeTy *CurScope = nullptr; |
164 | | |
165 | | AllocatorTy Allocator; |
166 | | |
167 | | public: |
168 | 4.64M | ScopedHashTable() = default; llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::ScopedHashTable() Line | Count | Source | 168 | 2.09k | ScopedHashTable() = default; |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::ScopedHashTable() Line | Count | Source | 168 | 36.8k | ScopedHashTable() = default; |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::ScopedHashTable() Line | Count | Source | 168 | 1.15M | ScopedHashTable() = default; |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::ScopedHashTable() Line | Count | Source | 168 | 1.15M | ScopedHashTable() = default; |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::ScopedHashTable() Line | Count | Source | 168 | 1.15M | ScopedHashTable() = default; |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::ScopedHashTable() Line | Count | Source | 168 | 1.15M | ScopedHashTable() = default; |
|
169 | | ScopedHashTable(AllocatorTy A) : Allocator(A) {} |
170 | | ScopedHashTable(const ScopedHashTable &) = delete; |
171 | | ScopedHashTable &operator=(const ScopedHashTable &) = delete; |
172 | | |
173 | 4.64M | ~ScopedHashTable() { |
174 | 4.64M | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); |
175 | 4.64M | } llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::~ScopedHashTable() Line | Count | Source | 173 | 2.08k | ~ScopedHashTable() { | 174 | 2.08k | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 2.08k | } |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::~ScopedHashTable() Line | Count | Source | 173 | 36.7k | ~ScopedHashTable() { | 174 | 36.7k | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 36.7k | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::~ScopedHashTable() Line | Count | Source | 173 | 1.15M | ~ScopedHashTable() { | 174 | 1.15M | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 1.15M | } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::~ScopedHashTable() Line | Count | Source | 173 | 1.15M | ~ScopedHashTable() { | 174 | 1.15M | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 1.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::~ScopedHashTable() Line | Count | Source | 173 | 1.15M | ~ScopedHashTable() { | 174 | 1.15M | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 1.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::~ScopedHashTable() Line | Count | Source | 173 | 1.15M | ~ScopedHashTable() { | 174 | 1.15M | assert(!CurScope && TopLevelMap.empty() && "Scope imbalance!"); | 175 | 1.15M | } |
|
176 | | |
177 | | /// Access to the allocator. |
178 | 27.0M | AllocatorTy &getAllocator() { return Allocator; } llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::getAllocator() Line | Count | Source | 178 | 1.10k | AllocatorTy &getAllocator() { return Allocator; } |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::getAllocator() Line | Count | Source | 178 | 6.86M | AllocatorTy &getAllocator() { return Allocator; } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::getAllocator() Line | Count | Source | 178 | 46.2k | AllocatorTy &getAllocator() { return Allocator; } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::getAllocator() Line | Count | Source | 178 | 946 | AllocatorTy &getAllocator() { return Allocator; } |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::getAllocator() Line | Count | Source | 178 | 5.15M | AllocatorTy &getAllocator() { return Allocator; } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::getAllocator() Line | Count | Source | 178 | 15.0M | AllocatorTy &getAllocator() { return Allocator; } |
|
179 | | const AllocatorTy &getAllocator() const { return Allocator; } |
180 | | |
181 | | /// Return 1 if the specified key is in the table, 0 otherwise. |
182 | 8.35M | size_type count(const K &Key) const { |
183 | 8.35M | return TopLevelMap.count(Key); |
184 | 8.35M | } llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::count(llvm::MachineInstr* const&) const Line | Count | Source | 182 | 7.69M | size_type count(const K &Key) const { | 183 | 7.69M | return TopLevelMap.count(Key); | 184 | 7.69M | } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::count(llvm::MemoryLocation const&) const Line | Count | Source | 182 | 651k | size_type count(const K &Key) const { | 183 | 651k | return TopLevelMap.count(Key); | 184 | 651k | } |
|
185 | | |
186 | 19.2M | V lookup(const K &Key) const { |
187 | 19.2M | auto I = TopLevelMap.find(Key); |
188 | 19.2M | if (I != TopLevelMap.end()) |
189 | 2.41M | return I->second->getValue(); |
190 | 16.8M | |
191 | 16.8M | return V(); |
192 | 16.8M | } llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::lookup(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&) const Line | Count | Source | 186 | 2.50k | V lookup(const K &Key) const { | 187 | 2.50k | auto I = TopLevelMap.find(Key); | 188 | 2.50k | if (I != TopLevelMap.end()) | 189 | 90 | return I->second->getValue(); | 190 | 2.41k | | 191 | 2.41k | return V(); | 192 | 2.41k | } |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::lookup(llvm::MachineInstr* const&) const Line | Count | Source | 186 | 429k | V lookup(const K &Key) const { | 187 | 429k | auto I = TopLevelMap.find(Key); | 188 | 429k | if (I != TopLevelMap.end()) | 189 | 429k | return I->second->getValue(); | 190 | 0 | | 191 | 0 | return V(); | 192 | 0 | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::lookup((anonymous namespace)::SimpleValue const&) const Line | Count | Source | 186 | 13.4M | V lookup(const K &Key) const { | 187 | 13.4M | auto I = TopLevelMap.find(Key); | 188 | 13.4M | if (I != TopLevelMap.end()) | 189 | 836k | return I->second->getValue(); | 190 | 12.5M | | 191 | 12.5M | return V(); | 192 | 12.5M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::lookup(llvm::Value* const&) const Line | Count | Source | 186 | 5.34M | V lookup(const K &Key) const { | 187 | 5.34M | auto I = TopLevelMap.find(Key); | 188 | 5.34M | if (I != TopLevelMap.end()) | 189 | 1.14M | return I->second->getValue(); | 190 | 4.19M | | 191 | 4.19M | return V(); | 192 | 4.19M | } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::lookup(llvm::MemoryLocation const&) const Line | Count | Source | 186 | 36 | V lookup(const K &Key) const { | 187 | 36 | auto I = TopLevelMap.find(Key); | 188 | 36 | if (I != TopLevelMap.end()) | 189 | 36 | return I->second->getValue(); | 190 | 0 | | 191 | 0 | return V(); | 192 | 0 | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::lookup((anonymous namespace)::CallValue const&) const Line | Count | Source | 186 | 46.3k | V lookup(const K &Key) const { | 187 | 46.3k | auto I = TopLevelMap.find(Key); | 188 | 46.3k | if (I != TopLevelMap.end()) | 189 | 2.02k | return I->second->getValue(); | 190 | 44.3k | | 191 | 44.3k | return V(); | 192 | 44.3k | } |
|
193 | | |
194 | 27.0M | void insert(const K &Key, const V &Val) { |
195 | 27.0M | insertIntoScope(CurScope, Key, Val); |
196 | 27.0M | } llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::insert(llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&) Line | Count | Source | 194 | 1.10k | void insert(const K &Key, const V &Val) { | 195 | 1.10k | insertIntoScope(CurScope, Key, Val); | 196 | 1.10k | } |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::insert(llvm::MachineInstr* const&, unsigned int const&) Line | Count | Source | 194 | 6.86M | void insert(const K &Key, const V &Val) { | 195 | 6.86M | insertIntoScope(CurScope, Key, Val); | 196 | 6.86M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::insert((anonymous namespace)::SimpleValue const&, llvm::Value* const&) Line | Count | Source | 194 | 15.0M | void insert(const K &Key, const V &Val) { | 195 | 15.0M | insertIntoScope(CurScope, Key, Val); | 196 | 15.0M | } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::insert(llvm::MemoryLocation const&, unsigned int const&) Line | Count | Source | 194 | 946 | void insert(const K &Key, const V &Val) { | 195 | 946 | insertIntoScope(CurScope, Key, Val); | 196 | 946 | } |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::insert(llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&) Line | Count | Source | 194 | 5.15M | void insert(const K &Key, const V &Val) { | 195 | 5.15M | insertIntoScope(CurScope, Key, Val); | 196 | 5.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::insert((anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&) Line | Count | Source | 194 | 46.2k | void insert(const K &Key, const V &Val) { | 195 | 46.2k | insertIntoScope(CurScope, Key, Val); | 196 | 46.2k | } |
|
197 | | |
198 | | using iterator = ScopedHashTableIterator<K, V, KInfo>; |
199 | | |
200 | | iterator end() { return iterator(0); } |
201 | | |
202 | | iterator begin(const K &Key) { |
203 | | typename DenseMap<K, ValTy*, KInfo>::iterator I = |
204 | | TopLevelMap.find(Key); |
205 | | if (I == TopLevelMap.end()) return end(); |
206 | | return iterator(I->second); |
207 | | } |
208 | | |
209 | | ScopeTy *getCurScope() { return CurScope; } |
210 | | const ScopeTy *getCurScope() const { return CurScope; } |
211 | | |
212 | | /// insertIntoScope - This inserts the specified key/value at the specified |
213 | | /// (possibly not the current) scope. While it is ok to insert into a scope |
214 | | /// that isn't the current one, it isn't ok to insert *underneath* an existing |
215 | | /// value of the specified key. |
216 | 27.0M | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { |
217 | 27.0M | assert(S && "No scope active!"); |
218 | 27.0M | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; |
219 | 27.0M | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, |
220 | 27.0M | Allocator); |
221 | 27.0M | S->setLastValInScope(KeyEntry); |
222 | 27.0M | } llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >*, llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> const&, std::__1::pair<unsigned int, unsigned int> const&) Line | Count | Source | 216 | 1.10k | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 1.10k | assert(S && "No scope active!"); | 218 | 1.10k | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 1.10k | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 1.10k | Allocator); | 221 | 1.10k | S->setLastValInScope(KeyEntry); | 222 | 1.10k | } |
llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >*, llvm::MachineInstr* const&, unsigned int const&) Line | Count | Source | 216 | 6.86M | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 6.86M | assert(S && "No scope active!"); | 218 | 6.86M | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 6.86M | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 6.86M | Allocator); | 221 | 6.86M | S->setLastValInScope(KeyEntry); | 222 | 6.86M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >*, (anonymous namespace)::SimpleValue const&, llvm::Value* const&) Line | Count | Source | 216 | 15.0M | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 15.0M | assert(S && "No scope active!"); | 218 | 15.0M | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 15.0M | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 15.0M | Allocator); | 221 | 15.0M | S->setLastValInScope(KeyEntry); | 222 | 15.0M | } |
llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >*, llvm::MemoryLocation const&, unsigned int const&) Line | Count | Source | 216 | 946 | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 946 | assert(S && "No scope active!"); | 218 | 946 | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 946 | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 946 | Allocator); | 221 | 946 | S->setLastValInScope(KeyEntry); | 222 | 946 | } |
EarlyCSE.cpp:llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::insertIntoScope(llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >*, llvm::Value* const&, (anonymous namespace)::EarlyCSE::LoadValue const&) Line | Count | Source | 216 | 5.15M | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 5.15M | assert(S && "No scope active!"); | 218 | 5.15M | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 5.15M | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 5.15M | Allocator); | 221 | 5.15M | S->setLastValInScope(KeyEntry); | 222 | 5.15M | } |
EarlyCSE.cpp:llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::insertIntoScope(llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>*, (anonymous namespace)::CallValue const&, std::__1::pair<llvm::Instruction*, unsigned int> const&) Line | Count | Source | 216 | 46.2k | void insertIntoScope(ScopeTy *S, const K &Key, const V &Val) { | 217 | 46.2k | assert(S && "No scope active!"); | 218 | 46.2k | ScopedHashTableVal<K, V> *&KeyEntry = TopLevelMap[Key]; | 219 | 46.2k | KeyEntry = ValTy::Create(S->getLastValInScope(), KeyEntry, Key, Val, | 220 | 46.2k | Allocator); | 221 | 46.2k | S->setLastValInScope(KeyEntry); | 222 | 46.2k | } |
|
223 | | }; |
224 | | |
225 | | /// ScopedHashTableScope ctor - Install this as the current scope for the hash |
226 | | /// table. |
227 | | template <typename K, typename V, typename KInfo, typename Allocator> |
228 | | ScopedHashTableScope<K, V, KInfo, Allocator>:: |
229 | 23.7M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { |
230 | 23.7M | PrevScope = HT.CurScope; |
231 | 23.7M | HT.CurScope = this; |
232 | 23.7M | LastValInScope = nullptr; |
233 | 23.7M | } llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >&) Line | Count | Source | 229 | 14.7k | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 14.7k | PrevScope = HT.CurScope; | 231 | 14.7k | HT.CurScope = this; | 232 | 14.7k | LastValInScope = nullptr; | 233 | 14.7k | } |
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >&) Line | Count | Source | 229 | 2.62M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 2.62M | PrevScope = HT.CurScope; | 231 | 2.62M | HT.CurScope = this; | 232 | 2.62M | LastValInScope = nullptr; | 233 | 2.62M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >&) Line | Count | Source | 229 | 5.28M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 5.28M | PrevScope = HT.CurScope; | 231 | 5.28M | HT.CurScope = this; | 232 | 5.28M | LastValInScope = nullptr; | 233 | 5.28M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >&) Line | Count | Source | 229 | 5.28M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 5.28M | PrevScope = HT.CurScope; | 231 | 5.28M | HT.CurScope = this; | 232 | 5.28M | LastValInScope = nullptr; | 233 | 5.28M | } |
llvm::ScopedHashTableScope<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::ScopedHashTableScope(llvm::ScopedHashTable<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >&) Line | Count | Source | 229 | 5.28M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 5.28M | PrevScope = HT.CurScope; | 231 | 5.28M | HT.CurScope = this; | 232 | 5.28M | LastValInScope = nullptr; | 233 | 5.28M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::ScopedHashTableScope(llvm::ScopedHashTable<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>&) Line | Count | Source | 229 | 5.28M | ScopedHashTableScope(ScopedHashTable<K, V, KInfo, Allocator> &ht) : HT(ht) { | 230 | 5.28M | PrevScope = HT.CurScope; | 231 | 5.28M | HT.CurScope = this; | 232 | 5.28M | LastValInScope = nullptr; | 233 | 5.28M | } |
|
234 | | |
235 | | template <typename K, typename V, typename KInfo, typename Allocator> |
236 | 23.7M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { |
237 | 23.7M | assert(HT.CurScope == this && "Scope imbalance!"); |
238 | 23.7M | HT.CurScope = PrevScope; |
239 | 23.7M | |
240 | 23.7M | // Pop and delete all values corresponding to this scope. |
241 | 50.8M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { |
242 | 27.0M | // Pop this value out of the TopLevelMap. |
243 | 27.0M | if (!ThisEntry->getNextForKey()) { |
244 | 23.2M | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && |
245 | 23.2M | "Scope imbalance!"); |
246 | 23.2M | HT.TopLevelMap.erase(ThisEntry->getKey()); |
247 | 23.2M | } else { |
248 | 3.85M | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; |
249 | 3.85M | assert(KeyEntry == ThisEntry && "Scope imbalance!"); |
250 | 3.85M | KeyEntry = ThisEntry->getNextForKey(); |
251 | 3.85M | } |
252 | 27.0M | |
253 | 27.0M | // Pop this value out of the scope. |
254 | 27.0M | LastValInScope = ThisEntry->getNextInScope(); |
255 | 27.0M | |
256 | 27.0M | // Delete this entry. |
257 | 27.0M | ThisEntry->Destroy(HT.getAllocator()); |
258 | 27.0M | } |
259 | 23.7M | } llvm::ScopedHashTableScope<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int>, llvm::DenseMapInfo<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*> >, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::PointerUnion<llvm::Value const*, llvm::PseudoSourceValue const*>, std::__1::pair<unsigned int, unsigned int> >, 32ul, 8ul> >::~ScopedHashTableScope() Line | Count | Source | 236 | 14.7k | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 14.7k | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 14.7k | HT.CurScope = PrevScope; | 239 | 14.7k | | 240 | 14.7k | // Pop and delete all values corresponding to this scope. | 241 | 15.9k | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 1.10k | // Pop this value out of the TopLevelMap. | 243 | 1.10k | if (!ThisEntry->getNextForKey()) { | 244 | 1.05k | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 1.05k | "Scope imbalance!"); | 246 | 1.05k | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 1.05k | } else { | 248 | 44 | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 44 | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 44 | KeyEntry = ThisEntry->getNextForKey(); | 251 | 44 | } | 252 | 1.10k | | 253 | 1.10k | // Pop this value out of the scope. | 254 | 1.10k | LastValInScope = ThisEntry->getNextInScope(); | 255 | 1.10k | | 256 | 1.10k | // Delete this entry. | 257 | 1.10k | ThisEntry->Destroy(HT.getAllocator()); | 258 | 1.10k | } | 259 | 14.7k | } |
llvm::ScopedHashTableScope<llvm::MachineInstr*, unsigned int, llvm::MachineInstrExpressionTrait, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MachineInstr*, unsigned int>, 32ul, 8ul> >::~ScopedHashTableScope() Line | Count | Source | 236 | 2.62M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 2.62M | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 2.62M | HT.CurScope = PrevScope; | 239 | 2.62M | | 240 | 2.62M | // Pop and delete all values corresponding to this scope. | 241 | 9.48M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 6.86M | // Pop this value out of the TopLevelMap. | 243 | 6.86M | if (!ThisEntry->getNextForKey()) { | 244 | 6.42M | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 6.42M | "Scope imbalance!"); | 246 | 6.42M | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 6.42M | } else { | 248 | 439k | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 439k | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 439k | KeyEntry = ThisEntry->getNextForKey(); | 251 | 439k | } | 252 | 6.86M | | 253 | 6.86M | // Pop this value out of the scope. | 254 | 6.86M | LastValInScope = ThisEntry->getNextInScope(); | 255 | 6.86M | | 256 | 6.86M | // Delete this entry. | 257 | 6.86M | ThisEntry->Destroy(HT.getAllocator()); | 258 | 6.86M | } | 259 | 2.62M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::CallValue, std::__1::pair<llvm::Instruction*, unsigned int>, llvm::DenseMapInfo<(anonymous namespace)::CallValue>, llvm::MallocAllocator>::~ScopedHashTableScope() Line | Count | Source | 236 | 5.28M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 5.28M | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 5.28M | HT.CurScope = PrevScope; | 239 | 5.28M | | 240 | 5.28M | // Pop and delete all values corresponding to this scope. | 241 | 5.33M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 46.2k | // Pop this value out of the TopLevelMap. | 243 | 46.2k | if (!ThisEntry->getNextForKey()) { | 244 | 44.3k | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 44.3k | "Scope imbalance!"); | 246 | 44.3k | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 44.3k | } else { | 248 | 1.92k | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 1.92k | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 1.92k | KeyEntry = ThisEntry->getNextForKey(); | 251 | 1.92k | } | 252 | 46.2k | | 253 | 46.2k | // Pop this value out of the scope. | 254 | 46.2k | LastValInScope = ThisEntry->getNextInScope(); | 255 | 46.2k | | 256 | 46.2k | // Delete this entry. | 257 | 46.2k | ThisEntry->Destroy(HT.getAllocator()); | 258 | 46.2k | } | 259 | 5.28M | } |
llvm::ScopedHashTableScope<llvm::MemoryLocation, unsigned int, llvm::DenseMapInfo<llvm::MemoryLocation>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::MemoryLocation, unsigned int>, 64ul, 8ul> >::~ScopedHashTableScope() Line | Count | Source | 236 | 5.28M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 5.28M | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 5.28M | HT.CurScope = PrevScope; | 239 | 5.28M | | 240 | 5.28M | // Pop and delete all values corresponding to this scope. | 241 | 5.28M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 946 | // Pop this value out of the TopLevelMap. | 243 | 946 | if (!ThisEntry->getNextForKey()) { | 244 | 946 | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 946 | "Scope imbalance!"); | 246 | 946 | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 946 | } else { | 248 | 0 | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 0 | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 0 | KeyEntry = ThisEntry->getNextForKey(); | 251 | 0 | } | 252 | 946 | | 253 | 946 | // Pop this value out of the scope. | 254 | 946 | LastValInScope = ThisEntry->getNextInScope(); | 255 | 946 | | 256 | 946 | // Delete this entry. | 257 | 946 | ThisEntry->Destroy(HT.getAllocator()); | 258 | 946 | } | 259 | 5.28M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue, llvm::DenseMapInfo<llvm::Value*>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<llvm::Value*, (anonymous namespace)::EarlyCSE::LoadValue>, 48ul, 8ul> >::~ScopedHashTableScope() Line | Count | Source | 236 | 5.28M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 5.28M | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 5.28M | HT.CurScope = PrevScope; | 239 | 5.28M | | 240 | 5.28M | // Pop and delete all values corresponding to this scope. | 241 | 10.4M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 5.15M | // Pop this value out of the TopLevelMap. | 243 | 5.15M | if (!ThisEntry->getNextForKey()) { | 244 | 4.19M | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 4.19M | "Scope imbalance!"); | 246 | 4.19M | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 4.19M | } else { | 248 | 955k | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 955k | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 955k | KeyEntry = ThisEntry->getNextForKey(); | 251 | 955k | } | 252 | 5.15M | | 253 | 5.15M | // Pop this value out of the scope. | 254 | 5.15M | LastValInScope = ThisEntry->getNextInScope(); | 255 | 5.15M | | 256 | 5.15M | // Delete this entry. | 257 | 5.15M | ThisEntry->Destroy(HT.getAllocator()); | 258 | 5.15M | } | 259 | 5.28M | } |
EarlyCSE.cpp:llvm::ScopedHashTableScope<(anonymous namespace)::SimpleValue, llvm::Value*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::RecyclingAllocator<llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>, 32ul, 8ul> >::~ScopedHashTableScope() Line | Count | Source | 236 | 5.28M | ScopedHashTableScope<K, V, KInfo, Allocator>::~ScopedHashTableScope() { | 237 | 5.28M | assert(HT.CurScope == this && "Scope imbalance!"); | 238 | 5.28M | HT.CurScope = PrevScope; | 239 | 5.28M | | 240 | 5.28M | // Pop and delete all values corresponding to this scope. | 241 | 20.3M | while (ScopedHashTableVal<K, V> *ThisEntry = LastValInScope) { | 242 | 15.0M | // Pop this value out of the TopLevelMap. | 243 | 15.0M | if (!ThisEntry->getNextForKey()) { | 244 | 12.5M | assert(HT.TopLevelMap[ThisEntry->getKey()] == ThisEntry && | 245 | 12.5M | "Scope imbalance!"); | 246 | 12.5M | HT.TopLevelMap.erase(ThisEntry->getKey()); | 247 | 12.5M | } else { | 248 | 2.45M | ScopedHashTableVal<K, V> *&KeyEntry = HT.TopLevelMap[ThisEntry->getKey()]; | 249 | 2.45M | assert(KeyEntry == ThisEntry && "Scope imbalance!"); | 250 | 2.45M | KeyEntry = ThisEntry->getNextForKey(); | 251 | 2.45M | } | 252 | 15.0M | | 253 | 15.0M | // Pop this value out of the scope. | 254 | 15.0M | LastValInScope = ThisEntry->getNextInScope(); | 255 | 15.0M | | 256 | 15.0M | // Delete this entry. | 257 | 15.0M | ThisEntry->Destroy(HT.getAllocator()); | 258 | 15.0M | } | 259 | 5.28M | } |
|
260 | | |
261 | | } // end namespace llvm |
262 | | |
263 | | #endif // LLVM_ADT_SCOPEDHASHTABLE_H |