<div dir="ltr">Please include some details about why a patch is being reverted in the commit message. (& as I think Nico alluded to in the other review thread - if the issue is something as simple as a missing #include, usually we'd prefer to fix-forward in that situation - we all pitch in and fix whatever we come across when it's fairly clear what the fix should be)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 16, 2021 at 10:22 AM Stella Stamenova 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: Stella Stamenova<br>
Date: 2021-04-16T10:22:32-07:00<br>
New Revision: af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/af2a93fd6e9f9e037d2e2d67b879fe85d7e1cbed.diff</a><br>
<br>
LOG: Revert "[Support] Don't include <algorithm> in MathExtras.h"<br>
<br>
This reverts commit 6580d8a2b14d50b7e067dc86df6e5dd65703d147.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/include/llvm/Support/MathExtras.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h<br>
index 10d4260a7eb1..640b3a11ce6c 100644<br>
--- a/llvm/include/llvm/Support/MathExtras.h<br>
+++ b/llvm/include/llvm/Support/MathExtras.h<br>
@@ -14,6 +14,7 @@<br>
 #define LLVM_SUPPORT_MATHEXTRAS_H<br>
<br>
 #include "llvm/Support/Compiler.h"<br>
+#include <algorithm><br>
 #include <cassert><br>
 #include <climits><br>
 #include <cmath><br>
@@ -792,7 +793,7 @@ inline int64_t SignExtend64(uint64_t X, unsigned B) {<br>
 /// value of the result.<br>
 template <typename T><br>
 std::enable_if_t<std::is_unsigned<T>::value, T> AbsoluteDifference(T X, T Y) {<br>
-  return X > Y ? X - Y : Y - X;<br>
+  return std::max(X, Y) - std::min(X, Y);<br>
 }<br>
<br>
 /// Add two unsigned integers, X and Y, of type T.  Clamp the result to the<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>