diff options
Diffstat (limited to 'lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r-- | lib/Transforms/Scalar/Reassociate.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/Reassociate.cpp b/lib/Transforms/Scalar/Reassociate.cpp index 6eb275c8fd..cb7f47b988 100644 --- a/lib/Transforms/Scalar/Reassociate.cpp +++ b/lib/Transforms/Scalar/Reassociate.cpp @@ -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... |