diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-05-17 19:00:05 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-05-17 19:00:05 +0000 |
commit | 08de1e476c8404cf49ea37e4268b5ca7b90e0795 (patch) | |
tree | a50e9bc1928ac0458c71dc95437b6723e67ffebc /lib/VMCore/ConstantFold.cpp | |
parent | b5783106c469b9ec286e7c193e25a9e2f4e80368 (diff) | |
download | external_llvm-08de1e476c8404cf49ea37e4268b5ca7b90e0795.zip external_llvm-08de1e476c8404cf49ea37e4268b5ca7b90e0795.tar.gz external_llvm-08de1e476c8404cf49ea37e4268b5ca7b90e0795.tar.bz2 |
Revert constant-folding change that will miscompile in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 07df0bf..0913c48 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -1029,29 +1029,6 @@ static ICmpInst::Predicate evaluateICmpRelation(const Constant *V1, } break; - case Instruction::PtrToInt: - case Instruction::IntToPtr: - // inttoptr(x1) != inttoptr(x2) iff x1 != x2 - if (const ConstantExpr *CE2 = dyn_cast<ConstantExpr>(V2)) - if (CE1->getOpcode() == CE2->getOpcode()) { - Constant *Op1 = const_cast<Constant*>(CE1Op0); - Constant *Op2 = CE2->getOperand(0); - if (Op1->getType() == Op2->getType()) { - ConstantInt *R = 0; - - ICmpInst::Predicate pred = ICmpInst::ICMP_EQ; - R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, Op1, Op2)); - if (R && !R->isZero()) - return pred; - - pred = ICmpInst::ICMP_NE; - R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, Op1, Op2)); - if (R && !R->isZero()) - return pred; - } - } - break; - case Instruction::GetElementPtr: // Ok, since this is a getelementptr, we know that the constant has a // pointer type. Check the various cases. |