From: Daniel Berlin Date: Mon, 6 Mar 2017 18:42:39 +0000 (+0000) Subject: NewGVN: Remove DebugUnknownExprs, just mark the instructions as unused X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7849f87280d549f3829a2c2fe4cd911c421a0db;p=llvm NewGVN: Remove DebugUnknownExprs, just mark the instructions as unused git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297047 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index 5738cd69951..7750eabd72b 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -289,8 +289,6 @@ class NewGVN : public FunctionPass { // Deletion info. SmallPtrSet InstructionsToErase; - // The set of things we gave unknown expressions to due to debug counting. - SmallPtrSet DebugUnknownExprs; public: static char ID; // Pass identification, replacement for typeid. NewGVN() : FunctionPass(ID) { @@ -1718,7 +1716,6 @@ void NewGVN::cleanupTables() { DominatedInstRange.clear(); MemoryAccessToClass.clear(); PredicateToUsers.clear(); - DebugUnknownExprs.clear(); } std::pair NewGVN::assignDFSNumbers(BasicBlock *B, @@ -1815,9 +1812,8 @@ void NewGVN::valueNumberInstruction(Instruction *I) { 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 @@ -1934,7 +1930,7 @@ void NewGVN::verifyComparisons(Function &F) { if (!ReachableBlocks.count(&BB)) continue; for (auto &I : BB) { - if (InstructionsToErase.count(&I) || DebugUnknownExprs.count(&I)) + if (InstrDFS.lookup(&I) == 0) continue; if (isa(&I)) { auto *CurrentVal = ValueToClass.lookup(&I);