[llvm] r260910 - APInt: Further simplify APInt::EqualSlowCase as suggested by Duncan

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 12:06:20 PST 2016


Author: matze
Date: Mon Feb 15 14:06:19 2016
New Revision: 260910

URL: http://llvm.org/viewvc/llvm-project?rev=260910&view=rev
Log:
APInt: Further simplify APInt::EqualSlowCase as suggested by Duncan

Modified:
    llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=260910&r1=260909&r2=260910&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Mon Feb 15 14:06:19 2016
@@ -490,10 +490,7 @@ APInt APInt::operator-(const APInt& RHS)
 }
 
 bool APInt::EqualSlowCase(const APInt& RHS) const {
-  for (unsigned I = 0, NumWords = getNumWords(); I < NumWords; ++I)
-    if (pVal[I] != RHS.pVal[I])
-      return false;
-  return true;
+  return std::equal(pVal, pVal + getNumWords(), RHS.pVal);
 }
 
 bool APInt::EqualSlowCase(uint64_t Val) const {




More information about the llvm-commits mailing list