aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index b150baf..af95aad 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -490,21 +490,8 @@ APInt APInt::operator-(const APInt& RHS) const {
}
bool APInt::EqualSlowCase(const APInt& RHS) const {
- // Get some facts about the number of bits used in the two operands.
- unsigned n1 = getActiveBits();
- unsigned n2 = RHS.getActiveBits();
-
- // If the number of bits isn't the same, they aren't equal
- if (n1 != n2)
- return false;
-
- // If the number of bits fits in a word, we only need to compare the low word.
- if (n1 <= APINT_BITS_PER_WORD)
- return pVal[0] == RHS.pVal[0];
-
- // Otherwise, compare everything
- for (int i = whichWord(n1 - 1); i >= 0; --i)
- if (pVal[i] != RHS.pVal[i])
+ for (unsigned I = 0, NumWords = getNumWords(); I < NumWords; ++I)
+ if (pVal[I] != RHS.pVal[I])
return false;
return true;
}