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

Chris Lattner lattner at cs.uiuc.edu
Sat Apr 10 20:40:02 PDT 2004


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.188 -> 1.189

---
Log message:

Fix a bug in my select transformation


---
Diffs of the changes:  (+2 -2)

Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.188 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.189
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.188	Sat Apr 10 17:21:27 2004
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sat Apr 10 20:39:19 2004
@@ -2224,10 +2224,10 @@
     } else if (SCI->getOperand(0) == FalseVal && SCI->getOperand(1) == TrueVal){
       // Transform (X == Y) ? Y : X  -> X
       if (SCI->getOpcode() == Instruction::SetEQ)
-        return ReplaceInstUsesWith(SI, TrueVal);
+        return ReplaceInstUsesWith(SI, FalseVal);
       // Transform (X != Y) ? Y : X  -> Y
       if (SCI->getOpcode() == Instruction::SetNE)
-        return ReplaceInstUsesWith(SI, FalseVal);
+        return ReplaceInstUsesWith(SI, TrueVal);
       // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
     }
   }





More information about the llvm-commits mailing list