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

Chris Lattner lattner at cs.uiuc.edu
Wed Jun 15 20:00:20 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.350 -> 1.351
---
Log message:

Fix PR571: http://llvm.cs.uiuc.edu/PR571 , removing code that does just the WRONG thing :)


---
Diffs of the changes:  (+1 -27)

 InstructionCombining.cpp |   28 +---------------------------
 1 files changed, 1 insertion(+), 27 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.350 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.351
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.350	Wed Jun 15 20:52:07 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Jun 15 22:00:08 2005
@@ -3102,33 +3102,7 @@
     return 0;
   }
 
-  return 0; //The rest of this function is broken.  See bug 571
-
-  // Okay, we have the two reduced sized operands.  If we are doing a <,>
-  // comparison, make sure we perform the compare with the same signedness as
-  // the DestTy.  We don't have to do this if the comparison is !=/== or if the
-  // source is a bool.
-  if (isSignSrc != isSignDest && SrcTy != Type::BoolTy &&
-      SCI.getOpcode() != Instruction::SetEQ &&
-      SCI.getOpcode() != Instruction::SetNE) {
-    // Insert noop casts of the two operands to change the sign of the
-    // comparison.
-    const Type *NewSrcTy;
-    if (isSignDest)
-      NewSrcTy = SrcTy->getSignedVersion();
-    else 
-      NewSrcTy = SrcTy->getUnsignedVersion();
-    
-    // Insert the new casts.
-    LHSCIOp = InsertNewInstBefore(new CastInst(LHSCIOp, NewSrcTy,
-                                               LHSCIOp->getName()), SCI);
-    if (Constant *RHSC = dyn_cast<Constant>(RHSCIOp))
-      RHSCIOp = ConstantExpr::getCast(RHSC, NewSrcTy);
-    else
-      RHSCIOp = InsertNewInstBefore(new CastInst(RHSCIOp, NewSrcTy,
-                                                 RHSCIOp->getName()), SCI);
-  }
-
+  // Okay, just insert a compare of the reduced operands now!
   return BinaryOperator::create(SCI.getOpcode(), LHSCIOp, RHSCIOp);
 }
 






More information about the llvm-commits mailing list