From 6db1495558913501f5083d4ba76cbee4a3daf5f2 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Sun, 12 Jul 2009 02:00:05 +0000 Subject: [PATCH] Remove check which is duplicated in InstCombiner::visitSelectInstWithICmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75409 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../Scalar/InstructionCombining.cpp | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 6aa65301260..2cf3fd7f2a9 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -9474,26 +9474,6 @@ Instruction *InstCombiner::visitSelectInst(SelectInst &SI) { } if (ICmpInst *IC = dyn_cast(SI.getCondition())) { - - // (x ashr x, 31 - if (TrueValC->isAllOnesValue() && FalseValC->isZero()) - if (ConstantInt *CmpCst = dyn_cast(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