[llvm-commits] [llvm] r55690 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Nick Lewycky nicholas at mxc.ca
Tue Sep 2 23:24:22 PDT 2008


Author: nicholas
Date: Wed Sep  3 01:24:21 2008
New Revision: 55690

URL: http://llvm.org/viewvc/llvm-project?rev=55690&view=rev
Log:
Don't apply this transform to vectors. Fixes PR2756.

Modified:
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=55690&r1=55689&r2=55690&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Sep  3 01:24:21 2008
@@ -2948,8 +2948,9 @@
     return common;
   
   if (Value *RHSNeg = dyn_castNegVal(Op1))
-    if (!isa<ConstantInt>(RHSNeg) || 
-        cast<ConstantInt>(RHSNeg)->getValue().isStrictlyPositive()) {
+    if (!isa<Constant>(RHSNeg) ||
+        (isa<ConstantInt>(RHSNeg) &&
+         cast<ConstantInt>(RHSNeg)->getValue().isStrictlyPositive())) {
       // X % -Y -> X % Y
       AddUsesToWorkList(I);
       I.setOperand(1, RHSNeg);
@@ -5495,7 +5496,7 @@
       if (Op0I->getOpcode() == Op1I->getOpcode() && Op0I->hasOneUse() &&
           Op1I->hasOneUse() && Op0I->getOperand(1) == Op1I->getOperand(1) &&
           I.isEquality()) {
-	switch (Op0I->getOpcode()) {
+        switch (Op0I->getOpcode()) {
         default: break;
         case Instruction::Add:
         case Instruction::Sub:





More information about the llvm-commits mailing list