<div dir="ltr">Any particular data that suggests removing this #include is worthwhile?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 20, 2021 at 3:23 AM Simon Pilgrim via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Simon Pilgrim<br>
Date: 2021-04-20T11:21:39+01:00<br>
New Revision: 5ed8cea9a8166b81ade4a9352971ba061f9b6f65<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/5ed8cea9a8166b81ade4a9352971ba061f9b6f65" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/5ed8cea9a8166b81ade4a9352971ba061f9b6f65</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/5ed8cea9a8166b81ade4a9352971ba061f9b6f65.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/5ed8cea9a8166b81ade4a9352971ba061f9b6f65.diff</a><br>
<br>
LOG: [Support] APInt.h - remove <algorithm> include. NFCI.<br>
<br>
Replace std::min use which should allow us to avoid including the <algorithm> header in every include of APInt.h.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/include/llvm/ADT/APInt.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h<br>
index 0fca6bac43fd9..0cd4a0c9fc9f7 100644<br>
--- a/llvm/include/llvm/ADT/APInt.h<br>
+++ b/llvm/include/llvm/ADT/APInt.h<br>
@@ -17,7 +17,6 @@<br>
<br>
 #include "llvm/Support/Compiler.h"<br>
 #include "llvm/Support/MathExtras.h"<br>
-#include <algorithm><br>
 #include <cassert><br>
 #include <climits><br>
 #include <cstring><br>
@@ -1699,8 +1698,10 @@ class LLVM_NODISCARD APInt {<br>
   /// \returns BitWidth if the value is zero, otherwise returns the number of<br>
   /// zeros from the least significant bit to the first one bit.<br>
   unsigned countTrailingZeros() const {<br>
-    if (isSingleWord())<br>
-      return std::min(unsigned(llvm::countTrailingZeros(U.VAL)), BitWidth);<br>
+    if (isSingleWord()) {<br>
+      unsigned TrailingZeros = llvm::countTrailingZeros(U.VAL);<br>
+      return (TrailingZeros > BitWidth ? BitWidth : TrailingZeros);<br>
+    }<br>
     return countTrailingZerosSlowCase();<br>
   }<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>