9#ifndef LLVM_CODEGEN_GLOBALISEL_GISELWORKLIST_H
10#define LLVM_CODEGEN_GLOBALISEL_GISELWORKLIST_H
31#if LLVM_ENABLE_ABI_BREAKING_CHECKS
32 bool Finalized =
true;
40 unsigned size()
const {
return WorklistMap.
size(); }
52#if LLVM_ENABLE_ABI_BREAKING_CHECKS
62 assert(WorklistMap.
empty() &&
"Expecting empty worklistmap");
63 if (Worklist.
size() >
N)
65 for (
unsigned i = 0; i < Worklist.
size(); ++i)
66 if (!WorklistMap.
try_emplace(Worklist[i], i).second)
68#if LLVM_ENABLE_ABI_BREAKING_CHECKS
75#if LLVM_ENABLE_ABI_BREAKING_CHECKS
76 assert(Finalized &&
"GISelWorkList used without finalizing");
84#if LLVM_ENABLE_ABI_BREAKING_CHECKS
85 assert(Finalized &&
"GISelWorkList used without finalizing");
87 auto It = WorklistMap.
find(
I);
88 if (It == WorklistMap.
end())
92 Worklist[It->second] =
nullptr;
94 WorklistMap.
erase(It);
103#if LLVM_ENABLE_ABI_BREAKING_CHECKS
104 assert(Finalized &&
"GISelWorkList used without finalizing");
110 assert(
I &&
"Pop back on empty worklist");
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
bool erase(const KeyT &Val)
void reserve(size_type NumEntries)
Grow the densemap so that it can contain at least NumEntries items before resizing again.
void insert(MachineInstr *I)
Add the specified instruction to the worklist if it isn't already in it.
MachineInstr * pop_back_val()
void deferred_insert(MachineInstr *I)
void remove(const MachineInstr *I)
Remove I from the worklist if it exists.
Representation of each machine instruction.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.