// Deletion info.
SmallPtrSet<Instruction *, 8> InstructionsToErase;
- // The set of things we gave unknown expressions to due to debug counting.
- SmallPtrSet<Instruction *, 8> DebugUnknownExprs;
public:
static char ID; // Pass identification, replacement for typeid.
NewGVN() : FunctionPass(ID) {
DominatedInstRange.clear();
MemoryAccessToClass.clear();
PredicateToUsers.clear();
- DebugUnknownExprs.clear();
}
std::pair<unsigned, unsigned> NewGVN::assignDFSNumbers(BasicBlock *B,
if (DebugCounter::shouldExecute(VNCounter)) {
Symbolized = performSymbolicEvaluation(I);
} else {
- // Used to track which we marked unknown so we can skip verification of
- // comparisons.
- DebugUnknownExprs.insert(I);
+ // Mark the instruction as unused so we don't value number it again.
+ InstrDFS[I] = 0;
}
// If we couldn't come up with a symbolic expression, use the unknown
// expression
if (!ReachableBlocks.count(&BB))
continue;
for (auto &I : BB) {
- if (InstructionsToErase.count(&I) || DebugUnknownExprs.count(&I))
+ if (InstrDFS.lookup(&I) == 0)
continue;
if (isa<CmpInst>(&I)) {
auto *CurrentVal = ValueToClass.lookup(&I);