simplify some code, BreakUpSubtract always returns nonnull now.
authorChris Lattner <sabre@nondot.org>
Mon, 18 Feb 2008 02:18:25 +0000 (02:18 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Feb 2008 02:18:25 +0000 (02:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47251 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/Reassociate.cpp

index 3e2d38f76baeb628e4c370729b72f1e735bb50a1..47c767feb63921f90a408badbda9b847f707bfc3 100644 (file)
@@ -779,10 +779,8 @@ void Reassociate::ReassociateBB(BasicBlock *BB) {
     // see if we can convert it to X+-Y.
     if (BI->getOpcode() == Instruction::Sub) {
       if (ShouldBreakUpSubtract(BI)) {
-        if (Instruction *NI = BreakUpSubtract(BI)) {
-          MadeChange = true;
-          BI = NI;
-        }
+        BI = BreakUpSubtract(BI);
+        MadeChange = true;
       } else if (BinaryOperator::isNeg(BI)) {
         // Otherwise, this is a negation.  See if the operand is a multiply tree
         // and if this is not an inner node of a multiply tree.