diff options
Diffstat (limited to 'llvm/lib/Analysis/DemandedBits.cpp')
-rw-r--r-- | llvm/lib/Analysis/DemandedBits.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/DemandedBits.cpp b/llvm/lib/Analysis/DemandedBits.cpp index ca6d58f..117b12f 100644 --- a/llvm/lib/Analysis/DemandedBits.cpp +++ b/llvm/lib/Analysis/DemandedBits.cpp @@ -362,7 +362,7 @@ void DemandedBits::performAnalysis() { if (Instruction *J = dyn_cast<Instruction>(OI)) { Type *T = J->getType(); if (T->isIntOrIntVectorTy()) - AliveBits[J] = APInt::getAllOnesValue(T->getScalarSizeInBits()); + AliveBits[J] = APInt::getAllOnes(T->getScalarSizeInBits()); else Visited.insert(J); Worklist.insert(J); @@ -407,7 +407,7 @@ void DemandedBits::performAnalysis() { Type *T = OI->getType(); if (T->isIntOrIntVectorTy()) { unsigned BitWidth = T->getScalarSizeInBits(); - APInt AB = APInt::getAllOnesValue(BitWidth); + APInt AB = APInt::getAllOnes(BitWidth); if (InputIsKnownDead) { AB = APInt(BitWidth, 0); } else { @@ -417,7 +417,7 @@ void DemandedBits::performAnalysis() { Known, Known2, KnownBitsComputed); // Keep track of uses which have no demanded bits. - if (AB.isNullValue()) + if (AB.isZero()) DeadUses.insert(&OI); else DeadUses.erase(&OI); @@ -448,8 +448,7 @@ APInt DemandedBits::getDemandedBits(Instruction *I) { return Found->second; const DataLayout &DL = I->getModule()->getDataLayout(); - return APInt::getAllOnesValue( - DL.getTypeSizeInBits(I->getType()->getScalarType())); + return APInt::getAllOnes(DL.getTypeSizeInBits(I->getType()->getScalarType())); } APInt DemandedBits::getDemandedBits(Use *U) { @@ -461,7 +460,7 @@ APInt DemandedBits::getDemandedBits(Use *U) { // We only track integer uses, everything else produces a mask with all bits // set if (!T->isIntOrIntVectorTy()) - return APInt::getAllOnesValue(BitWidth); + return APInt::getAllOnes(BitWidth); if (isUseDead(U)) return APInt(BitWidth, 0); @@ -469,7 +468,7 @@ APInt DemandedBits::getDemandedBits(Use *U) { performAnalysis(); APInt AOut = getDemandedBits(UserI); - APInt AB = APInt::getAllOnesValue(BitWidth); + APInt AB = APInt::getAllOnes(BitWidth); KnownBits Known, Known2; bool KnownBitsComputed = false; @@ -504,7 +503,7 @@ bool DemandedBits::isUseDead(Use *U) { // is dead. These uses might not be explicitly present in the DeadUses map. if (UserI->getType()->isIntOrIntVectorTy()) { auto Found = AliveBits.find(UserI); - if (Found != AliveBits.end() && Found->second.isNullValue()) + if (Found != AliveBits.end() && Found->second.isZero()) return true; } |