From: Chris Lattner Date: Sat, 10 Apr 2004 22:33:34 +0000 (+0000) Subject: Update the value numbering interface. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=adb7c0de394b4de58a0ac79092932c28ddc3dcf1;p=oota-llvm.git Update the value numbering interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12824 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index 8ed8238806d..bbefe8157f4 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/lib/Transforms/Scalar/GCSE.cpp @@ -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().deleteInstruction(I); + // If we are not replacing the instruction with a constant, we cannot do // anything special. if (!isa(V)) { I->replaceAllUsesWith(V); - + // Erase the instruction from the program. I->getParent()->getInstList().erase(I); return;