10 #ifndef INSTCOMBINE_WORKLIST_H
11 #define INSTCOMBINE_WORKLIST_H
13 #define DEBUG_TYPE "instcombine"
34 bool isEmpty()
const {
return Worklist.empty(); }
39 if (WorklistMap.insert(std::make_pair(I, Worklist.size())).second) {
40 DEBUG(
dbgs() <<
"IC: ADD: " << *I <<
'\n');
41 Worklist.push_back(I);
54 assert(Worklist.empty() &&
"Worklist must be empty to add initial group");
55 Worklist.reserve(NumEntries+16);
56 WorklistMap.resize(NumEntries);
57 DEBUG(
dbgs() <<
"IC: ADDING: " << NumEntries <<
" instrs to worklist\n");
58 for (
unsigned Idx = 0; NumEntries; --NumEntries) {
60 WorklistMap.insert(std::make_pair(I, Idx++));
61 Worklist.push_back(I);
68 if (It == WorklistMap.end())
return;
71 Worklist[It->second] = 0;
73 WorklistMap.erase(It);
89 Add(cast<Instruction>(*UI));
96 assert(WorklistMap.empty() &&
"Worklist empty, but map not?");
Instruction * RemoveOne()
void Remove(Instruction *I)
void AddUsersToWorkList(Instruction &I)
#define LLVM_LIBRARY_VISIBILITY
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
#define LLVM_DELETED_FUNCTION
void AddInitialGroup(Instruction *const *List, unsigned NumEntries)
LLVM Value Representation.