[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Feb 27 21:41:07 PST 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.442 -> 1.443
---
Log message:

Simplify some code now that the RHS of a rem can't be 0


---
Diffs of the changes:  (+6 -8)

 InstructionCombining.cpp |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.442 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.443
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.442	Mon Feb 27 23:30:45 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Feb 27 23:40:55 2006
@@ -1867,14 +1867,12 @@
       if (isPowerOf2_64(C->getValue()))
         return BinaryOperator::createAnd(Op0, SubOne(C));
 
-    if (!RHS->isNullValue()) {
-      if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
-        if (Instruction *R = FoldOpIntoSelect(I, SI, this))
-          return R;
-      if (isa<PHINode>(Op0))
-        if (Instruction *NV = FoldOpIntoPhi(I))
-          return NV;
-    }
+    if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
+      if (Instruction *R = FoldOpIntoSelect(I, SI, this))
+        return R;
+    if (isa<PHINode>(Op0))
+      if (Instruction *NV = FoldOpIntoPhi(I))
+        return NV;
   }
 
   if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {






More information about the llvm-commits mailing list