aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-06-16 03:00:08 +0000
committerChris Lattner <sabre@nondot.org>2005-06-16 03:00:08 +0000
commit8d7089e1d543b16de1757c5e039b07456298d043 (patch)
tree7e516d2912791cd11f97d712c4c7a7b67e4d7db5
parentaa457ac2e77f88d5ee3a7016a7b235c533bdd621 (diff)
Fix PR571, removing code that does just the WRONG thing :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22225 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 046b434bd2..ef39589008 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3102,33 +3102,7 @@ Instruction *InstCombiner::visitSetCondInstWithCastAndCast(SetCondInst &SCI) {
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);
}