Give the longer name to the instruction that will probably be eliminated later
authorChris Lattner <sabre@nondot.org>
Thu, 9 May 2002 20:11:23 +0000 (20:11 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 9 May 2002 20:11:23 +0000 (20:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2581 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/Reassociate.cpp

index 6eb275c8fdbdba437310d9063675e089c3f507eb..cb7f47b9884fa238fd919ae327b8e30e2f082a23 100644 (file)
@@ -169,9 +169,10 @@ bool Reassociate::ReassociateBB(BasicBlock *BB) {
       //
       Instruction *New = BinaryOperator::create(Instruction::Add,
                                                 Inst->getOperand(0), Inst,
-                                                Inst->getName()+".add");
+                                                Inst->getName());
       // Everyone now refers to the add instruction...
       Inst->replaceAllUsesWith(New);
+      Inst->setName(Inst->getOperand(1)->getName()+".neg");
       New->setOperand(1, Inst);        // Except for the add inst itself!
 
       BI = BB->getInstList().insert(BI+1, New)-1;  // Add to the basic block...