diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-09 07:10:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-09 07:10:58 +0000 |
commit | 6d6b4106985378a5b8714dc74b9d7a077eb2471b (patch) | |
tree | 612093f9a0c8be88f5e3124ca1888d7b4433d740 /lib/Transforms | |
parent | 2a99b482a62e3f1ac3fd716fba430ac32fedade4 (diff) |
Remove some old code that looks like a remanant from signed-types days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 0e1b8eb2e0..f59874b1a5 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -6765,29 +6765,6 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI, return &ICI; } } - } else { // Not a ICMP_EQ/ICMP_NE - // If the LHS is a cast from an integral value of the same size, - // then since we know the RHS is a constant, try to simlify. - if (CastInst *Cast = dyn_cast<CastInst>(LHSI)) { - Value *CastOp = Cast->getOperand(0); - const Type *SrcTy = CastOp->getType(); - uint32_t SrcTySize = SrcTy->getPrimitiveSizeInBits(); - if (SrcTy->isInteger() && - SrcTySize == Cast->getType()->getPrimitiveSizeInBits()) { - // If this is an unsigned comparison, try to make the comparison use - // smaller constant values. - if (ICI.getPredicate() == ICmpInst::ICMP_ULT && RHSV.isSignBit()) { - // X u< 128 => X s> -1 - return new ICmpInst(ICmpInst::ICMP_SGT, CastOp, - ConstantInt::get(APInt::getAllOnesValue(SrcTySize))); - } else if (ICI.getPredicate() == ICmpInst::ICMP_UGT && - RHSV == APInt::getSignedMaxValue(SrcTySize)) { - // X u> 127 => X s< 0 - return new ICmpInst(ICmpInst::ICMP_SLT, CastOp, - Constant::getNullValue(SrcTy)); - } - } - } } return 0; } |