diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2009-09-20 02:11:47 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2009-09-20 02:11:47 +0000 |
| commit | 595b3dfcbe0c3f6d8aab594a9c1997c3f38af381 (patch) | |
| tree | 6b4b506e6c319bca2def2790f85f7648fabe3254 | |
| parent | 5a3fa4ef33e20c25d922fac2b6c838fcfc5f16ff (diff) | |
| download | bcm5719-llvm-595b3dfcbe0c3f6d8aab594a9c1997c3f38af381.tar.gz bcm5719-llvm-595b3dfcbe0c3f6d8aab594a9c1997c3f38af381.zip | |
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.
llvm-svn: 82353
| -rw-r--r-- | llvm/lib/VMCore/ConstantFold.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index 3cd4a9f78b8..7bf4f094e80 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/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: |

