aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/ConstantFold.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-02 00:28:52 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-02 00:28:52 +0000
commitcae5754619433aed7be74abbf1c0551a82d369cb (patch)
tree77599913d2e900d4774e81cce3333f31f25c9fa6 /lib/VMCore/ConstantFold.cpp
parent34da0ac28f7bfe737f92d3a098697a6ebc09a25e (diff)
Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r--lib/VMCore/ConstantFold.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 97f760ff8a..0d27a880eb 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -783,15 +783,15 @@ static FCmpInst::Predicate evaluateFCmpRelation(const Constant *V1,
Constant *C2 = const_cast<Constant*>(V2);
R = dyn_cast<ConstantInt>(
ConstantExpr::getFCmp(FCmpInst::FCMP_OEQ, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return FCmpInst::FCMP_OEQ;
R = dyn_cast<ConstantInt>(
ConstantExpr::getFCmp(FCmpInst::FCMP_OLT, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return FCmpInst::FCMP_OLT;
R = dyn_cast<ConstantInt>(
ConstantExpr::getFCmp(FCmpInst::FCMP_OGT, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return FCmpInst::FCMP_OGT;
// Nothing more we can do
@@ -850,15 +850,15 @@ static ICmpInst::Predicate evaluateICmpRelation(const Constant *V1,
Constant *C2 = const_cast<Constant*>(V2);
ICmpInst::Predicate pred = ICmpInst::ICMP_EQ;
R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return pred;
pred = isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT;
R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return pred;
pred = isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT;
R = dyn_cast<ConstantInt>(ConstantExpr::getICmp(pred, C1, C2));
- if (R && !R->isNullValue())
+ if (R && !R->isZero())
return pred;
// If we couldn't figure it out, bail.