From adb7c0de394b4de58a0ac79092932c28ddc3dcf1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 10 Apr 2004 22:33:34 +0000 Subject: Update the value numbering interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12824 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GCSE.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index 8ed8238..bbefe81 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; -- cgit v1.1