Update the value numbering interface.

llvm-svn: 12824
This commit is contained in:
Chris Lattner 2004-04-10 22:33:34 +00:00
parent ffdfe64ced
commit f16fe7206c
1 changed files with 4 additions and 1 deletions

View 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;