10 #ifndef LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINEWORKLIST_H 11 #define LLVM_TRANSFORMS_INSTCOMBINE_INSTCOMBINEWORKLIST_H 21 #define DEBUG_TYPE "instcombine" 42 if (WorklistMap.
insert(std::make_pair(I, Worklist.
size())).second) {
57 assert(Worklist.
empty() &&
"Worklist must be empty to add initial group");
61 <<
" instrs to worklist\n");
64 WorklistMap.
insert(std::make_pair(
I, Idx++));
72 if (It == WorklistMap.
end())
return;
75 Worklist[It->second] =
nullptr;
77 WorklistMap.
erase(It);
92 Add(cast<Instruction>(U));
99 assert(WorklistMap.
empty() &&
"Worklist empty, but map not?");
Instruction * RemoveOne()
This class represents lattice values for constants.
void push_back(const T &Elt)
void Remove(Instruction *I)
void Add(Instruction *I)
Add - Add the specified instruction to the worklist if it isn't already in it.
void reserve(size_type N)
InstCombineWorklist()=default
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
InstCombineWorklist & operator=(InstCombineWorklist &&)=default
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
iterator find(const_arg_type_t< KeyT > Val)
bool erase(const KeyT &Val)
void AddUsersToWorkList(Instruction &I)
AddUsersToWorkList - When an instruction is simplified, add all users of the instruction to the work ...
size_t size() const
size - Get the array size.
void AddInitialGroup(ArrayRef< Instruction *> List)
AddInitialGroup - Add the specified batch of stuff in reverse order.
void reserve(size_type NumEntries)
Grow the densemap so that it can contain at least NumEntries items before resizing again...
InstCombineWorklist - This is the worklist management logic for InstCombine.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
LLVM_NODISCARD T pop_back_val()
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
iterator_range< user_iterator > users()
LLVM_NODISCARD bool empty() const
LLVM_NODISCARD bool empty() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
void Zap()
Zap - check that the worklist is empty and nuke the backing store for the map if it is large...