summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-04-19 05:39:12 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-04-19 05:39:12 +0000
commit843f0767acd05baed952d39e77ea89b438430a4f (patch)
tree3000ab4d833f0688ba89ed8465df79bf3a8c4309 /lib
parent223d65b651621fcede1f9e64918e515bd0a27413 (diff)
downloadllvm-843f0767acd05baed952d39e77ea89b438430a4f.tar.gz
llvm-843f0767acd05baed952d39e77ea89b438430a4f.tar.bz2
llvm-843f0767acd05baed952d39e77ea89b438430a4f.tar.xz
Make use of ConstantInt::isZero instead of ConstantInt::isNullValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp2
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp8
-rw-r--r--lib/Transforms/Scalar/ScalarReplAggregates.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 5785d09ff6..1ca1a35b9f 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -620,7 +620,7 @@ BasicAliasAnalysis::CheckGEPInstructions(
if (NumGEP1Ops > MinOperands) {
for (unsigned i = FirstConstantOper; i != MaxOperands; ++i)
if (isa<ConstantInt>(GEP1Ops[i]) &&
- !cast<Constant>(GEP1Ops[i])->isNullValue()) {
+ !cast<ConstantInt>(GEP1Ops[i])->isZero()) {
// Yup, there's a constant in the tail. Set all variables to
// constants in the GEP instruction to make it suiteable for
// TargetData::getIndexedOffset.
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 7d8b8a4b7a..93a08a613e 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2224,7 +2224,7 @@ Instruction *InstCombiner::visitSub(BinaryOperator &I) {
// 0 - (X sdiv C) -> (X sdiv -C)
if (Op1I->getOpcode() == Instruction::SDiv)
if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0))
- if (CSI->isNullValue())
+ if (CSI->isZero())
if (Constant *DivRHS = dyn_cast<Constant>(Op1I->getOperand(1)))
return BinaryOperator::createSDiv(Op1I->getOperand(0),
ConstantExpr::getNeg(DivRHS));
@@ -2268,7 +2268,7 @@ static bool isSignBitCheck(ICmpInst::Predicate pred, ConstantInt *RHS) {
switch (pred) {
case ICmpInst::ICMP_SLT:
// True if LHS s< RHS and RHS == 0
- return RHS->isNullValue();
+ return RHS->isZero();
case ICmpInst::ICMP_SLE:
// True if LHS s<= RHS and RHS == -1
return RHS->isAllOnesValue();
@@ -2303,7 +2303,7 @@ Instruction *InstCombiner::visitMul(BinaryOperator &I) {
return BinaryOperator::createMul(SI->getOperand(0),
ConstantExpr::getShl(CI, ShOp));
- if (CI->isNullValue())
+ if (CI->isZero())
return ReplaceInstUsesWith(I, Op1); // X * 0 == 0
if (CI->equalsInt(1)) // X * 1 == X
return ReplaceInstUsesWith(I, Op0);
@@ -8131,7 +8131,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// input pointer, it just changes its type.
if (AllZeroIndices) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP.getOperand(i)))
- AllZeroIndices = CI->isNullValue();
+ AllZeroIndices = CI->isZero();
else
AllZeroIndices = false;
}
diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 057bc6f5c9..5bbb5aef03 100644
--- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -834,7 +834,7 @@ const Type *SROA::CanConvertToScalar(Value *V, bool &IsNotTrivial) {
} else if (GEP->getNumOperands() == 3 &&
isa<ConstantInt>(GEP->getOperand(1)) &&
isa<ConstantInt>(GEP->getOperand(2)) &&
- cast<Constant>(GEP->getOperand(1))->isNullValue()) {
+ cast<ConstantInt>(GEP->getOperand(1))->isZero()) {
// We are stepping into an element, e.g. a structure or an array:
// GEP Ptr, int 0, uint C
const Type *AggTy = PTy->getElementType();