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

Reid Spencer reid at x10sys.com
Wed Dec 6 12:40:12 PST 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.560 -> 1.561
---
Log message:

Update ConstantIntegral Max/Min tests for new interface.


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

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


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.560 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.561
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.560	Wed Dec  6 11:46:32 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Dec  6 14:39:57 2006
@@ -2889,7 +2889,7 @@
   if (Inside) {
     if (Lo == Hi)  // Trivially false.
       return new SetCondInst(Instruction::SetNE, V, V);
-    if (cast<ConstantIntegral>(Lo)->isMinValue())
+    if (cast<ConstantIntegral>(Lo)->isMinValue(Lo->getType()->isSigned()))
       return new SetCondInst(Instruction::SetLT, V, Hi);
 
     Constant *AddCST = ConstantExpr::getNeg(Lo);
@@ -2909,7 +2909,7 @@
   Hi = SubOne(cast<ConstantInt>(Hi));
 
   // V < 0 || V >= Hi ->'V > Hi-1'
-  if (cast<ConstantIntegral>(Lo)->isMinValue())
+  if (cast<ConstantIntegral>(Lo)->isMinValue(Lo->getType()->isSigned()))
     return new SetCondInst(Instruction::SetGT, V, Hi);
 
   // Emit X-Lo > Hi-Lo-1
@@ -4165,7 +4165,7 @@
   // can be folded into the comparison.
   if (ConstantInt *CI = dyn_cast<ConstantInt>(Op1)) {
     // Check to see if we are comparing against the minimum or maximum value...
-    if (CI->isMinValue()) {
+    if (CI->isMinValue(CI->getType()->isSigned())) {
       if (I.getOpcode() == Instruction::SetLT)       // A < MIN -> FALSE
         return ReplaceInstUsesWith(I, ConstantBool::getFalse());
       if (I.getOpcode() == Instruction::SetGE)       // A >= MIN -> TRUE
@@ -4175,7 +4175,7 @@
       if (I.getOpcode() == Instruction::SetGT)       // A > MIN -> A != MIN
         return BinaryOperator::createSetNE(Op0, Op1);
 
-    } else if (CI->isMaxValue()) {
+    } else if (CI->isMaxValue(CI->getType()->isSigned())) {
       if (I.getOpcode() == Instruction::SetGT)       // A > MAX -> FALSE
         return ReplaceInstUsesWith(I, ConstantBool::getFalse());
       if (I.getOpcode() == Instruction::SetLE)       // A <= MAX -> TRUE






More information about the llvm-commits mailing list