Update the value numbering interface.
authorChris Lattner <sabre@nondot.org>
Sat, 10 Apr 2004 22:33:34 +0000 (22:33 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Apr 2004 22:33:34 +0000 (22:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12824 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GCSE.cpp

index 8ed8238806d53695ee6c69a2b51655c6ee3e1c65..bbefe8157f4acead1cf28a2a6f4be96edbec2e71 100644 (file)
@@ -160,11 +160,14 @@ void GCSE::ReplaceInstructionWith(Instruction *I, Value *V) {
     ++NumCallRemoved; // Keep track of calls eliminated
   ++NumInstRemoved;   // Keep track of number of insts eliminated
 
+  // Update value numbering
+  getAnalysis<ValueNumbering>().deleteInstruction(I);
+
   // If we are not replacing the instruction with a constant, we cannot do
   // anything special.
   if (!isa<Constant>(V)) {
     I->replaceAllUsesWith(V);
-
+    
     // Erase the instruction from the program.
     I->getParent()->getInstList().erase(I);
     return;