diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-05-24 16:53:07 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-05-24 16:53:07 +0000 |
| commit | 8205a1a9b68119d3a8e87edac197bab6116579e3 (patch) | |
| tree | 945fad6620a42cbe0febf22a2cde04210ea23fbf /llvm/lib/Analysis/Lint.cpp | |
| parent | a2025eaaef419727f77fe7cfc2b6b1aea4fa0a8d (diff) | |
| download | bcm5719-llvm-8205a1a9b68119d3a8e87edac197bab6116579e3.tar.gz bcm5719-llvm-8205a1a9b68119d3a8e87edac197bab6116579e3.zip | |
[ValueTracking] Convert most of the calls to computeKnownBits to use the version that returns the KnownBits object.
This continues the changes started when computeSignBit was replaced with this new version of computeKnowBits.
Differential Revision: https://reviews.llvm.org/D33431
llvm-svn: 303773
Diffstat (limited to 'llvm/lib/Analysis/Lint.cpp')
| -rw-r--r-- | llvm/lib/Analysis/Lint.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp index 471ccb62970..e6391792bc2 100644 --- a/llvm/lib/Analysis/Lint.cpp +++ b/llvm/lib/Analysis/Lint.cpp @@ -534,9 +534,7 @@ static bool isZero(Value *V, const DataLayout &DL, DominatorTree *DT, VectorType *VecTy = dyn_cast<VectorType>(V->getType()); if (!VecTy) { - unsigned BitWidth = V->getType()->getIntegerBitWidth(); - KnownBits Known(BitWidth); - computeKnownBits(V, Known, DL, 0, AC, dyn_cast<Instruction>(V), DT); + KnownBits Known = computeKnownBits(V, DL, 0, AC, dyn_cast<Instruction>(V), DT); return Known.isZero(); } @@ -550,14 +548,12 @@ static bool isZero(Value *V, const DataLayout &DL, DominatorTree *DT, // For a vector, KnownZero will only be true if all values are zero, so check // this per component - unsigned BitWidth = VecTy->getElementType()->getIntegerBitWidth(); for (unsigned I = 0, N = VecTy->getNumElements(); I != N; ++I) { Constant *Elem = C->getAggregateElement(I); if (isa<UndefValue>(Elem)) return true; - KnownBits Known(BitWidth); - computeKnownBits(Elem, Known, DL); + KnownBits Known = computeKnownBits(Elem, DL); if (Known.isZero()) return true; } |

