diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-12 02:00:05 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-12 02:00:05 +0000 |
| commit | 575db66e1b41e6f0cb753bb529998e999f547d48 (patch) | |
| tree | a8643bc19b6b1622504b606597bdb97e1ead3720 /llvm/lib/Transforms | |
| parent | 02c4339bded2f56493578f31cf08f8fb08e074db (diff) | |
| download | bcm5719-llvm-575db66e1b41e6f0cb753bb529998e999f547d48.tar.gz bcm5719-llvm-575db66e1b41e6f0cb753bb529998e999f547d48.zip | |
Remove check which is duplicated in
InstCombiner::visitSelectInstWithICmp.
llvm-svn: 75409
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 6aa65301260..2cf3fd7f2a9 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -9474,26 +9474,6 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { } if (ICmpInst *IC = dyn_cast<ICmpInst>(SI.getCondition())) { - - // (x <s 0) ? -1 : 0 -> ashr x, 31 - if (TrueValC->isAllOnesValue() && FalseValC->isZero()) - if (ConstantInt *CmpCst = dyn_cast<ConstantInt>(IC->getOperand(1))) { - if (IC->getPredicate() == ICmpInst::ICMP_SLT && CmpCst->isZero()) { - // The comparison constant and the result are not neccessarily the - // same width. Make an all-ones value by inserting a AShr. - Value *X = IC->getOperand(0); - uint32_t Bits = X->getType()->getScalarSizeInBits(); - Constant *ShAmt = Context->getConstantInt(X->getType(), Bits-1); - Instruction *SRA = BinaryOperator::Create(Instruction::AShr, X, - ShAmt, "ones"); - InsertNewInstBefore(SRA, SI); - - // Then cast to the appropriate width. - return CastInst::CreateIntegerCast(SRA, SI.getType(), true); - } - } - - // If one of the constants is zero (we know they can't both be) and we // have an icmp instruction with zero, and we have an 'and' with the // non-constant value, eliminate this whole mess. This corresponds to |

