aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-12 02:00:05 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-12 02:00:05 +0000
commitcb66d3ee015a67b013209923c463ebd563e94135 (patch)
treeede87a24225a58abc4543862d3495db9d86bdf42 /lib/Transforms
parente4cde4751a7bb0742c1b627e0bf0d0e866fb3694 (diff)
downloadexternal_llvm-cb66d3ee015a67b013209923c463ebd563e94135.zip
external_llvm-cb66d3ee015a67b013209923c463ebd563e94135.tar.gz
external_llvm-cb66d3ee015a67b013209923c463ebd563e94135.tar.bz2
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 6aa6530..2cf3fd7 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<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