diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-03-24 03:57:24 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-03-24 03:57:24 +0000 |
commit | 2bd9514e8c2f7472ceed1b127d55169d7aff3c30 (patch) | |
tree | 35f4b907c0a6d39540b263ef5073b580bf715401 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | 38ded5a37fa57d52e61ef3938e64a88f581d9cf9 (diff) | |
download | bcm5719-llvm-2bd9514e8c2f7472ceed1b127d55169d7aff3c30.tar.gz bcm5719-llvm-2bd9514e8c2f7472ceed1b127d55169d7aff3c30.zip |
[ValueTracking] Convert more places to use setHighBits/setLowBits/setSignBit. NFCI
llvm-svn: 298683
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 9f260b21ca8..21c1595f094 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -971,7 +971,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, LeadZ = std::min(BitWidth, LeadZ + BitWidth - RHSUnknownLeadingOnes - 1); - KnownZero = APInt::getHighBitsSet(BitWidth, LeadZ); + KnownZero.setHighBits(LeadZ); break; } case Instruction::Select: { @@ -1233,7 +1233,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, Align = Q.DL.getABITypeAlignment(AI->getAllocatedType()); if (Align > 0) - KnownZero = APInt::getLowBitsSet(BitWidth, countTrailingZeros(Align)); + KnownZero.setLowBits(countTrailingZeros(Align)); break; } case Instruction::GetElementPtr: { @@ -1280,7 +1280,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, } } - KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ); + KnownZero.setLowBits(TrailZ); break; } case Instruction::PHI: { @@ -1321,9 +1321,8 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, APInt KnownZero3(KnownZero), KnownOne3(KnownOne); computeKnownBits(L, KnownZero3, KnownOne3, Depth + 1, Q); - KnownZero = APInt::getLowBitsSet( - BitWidth, std::min(KnownZero2.countTrailingOnes(), - KnownZero3.countTrailingOnes())); + KnownZero.setLowBits(std::min(KnownZero2.countTrailingOnes(), + KnownZero3.countTrailingOnes())); if (DontImproveNonNegativePhiBits) break; @@ -1343,7 +1342,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, if (KnownZero2.isNegative() && KnownZero3.isNegative()) KnownZero.setSignBit(); else if (KnownOne2.isNegative() && KnownOne3.isNegative()) - KnownOne.setBit(BitWidth - 1); + KnownOne.setSignBit(); } // (sub nsw non-negative, negative) --> non-negative |