aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-09-20 02:11:47 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-09-20 02:11:47 +0000
commita80e9598caa568bfd56a6eb90cf4207c4752915d (patch)
tree9a8c8faddca63df27ca56294de35d41e489ec9fd
parent8a7a05814c70d84eace161d3eed07f5b5cfdd8d6 (diff)
Delete dead code. sext and zext can not turn integers into pointers. Further,
the optimization described in the comment is only valid with target data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82353 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/ConstantFold.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 3cd4a9f78b..7bf4f094e8 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -1248,21 +1248,6 @@ static ICmpInst::Predicate evaluateICmpRelation(LLVMContext &Context,
Constant::getNullValue(CE1Op0->getType()),
sgnd);
}
-
- // If the dest type is a pointer type, and the RHS is a constantexpr cast
- // from the same type as the src of the LHS, evaluate the inputs. This is
- // important for things like "icmp eq (cast 4 to int*), (cast 5 to int*)",
- // which happens a lot in compilers with tagged integers.
- if (ConstantExpr *CE2 = dyn_cast<ConstantExpr>(V2))
- if (CE2->isCast() && isa<PointerType>(CE1->getType()) &&
- CE1->getOperand(0)->getType() == CE2->getOperand(0)->getType() &&
- CE1->getOperand(0)->getType()->isInteger()) {
- bool sgnd = isSigned;
- if (CE1->getOpcode() == Instruction::ZExt) isSigned = false;
- if (CE1->getOpcode() == Instruction::SExt) isSigned = true;
- return evaluateICmpRelation(Context, CE1->getOperand(0),
- CE2->getOperand(0), sgnd);
- }
break;
case Instruction::GetElementPtr: