We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cc4a02 commit af2a93fCopy full SHA for af2a93f
llvm/include/llvm/Support/MathExtras.h
@@ -14,6 +14,7 @@
14
#define LLVM_SUPPORT_MATHEXTRAS_H
15
16
#include "llvm/Support/Compiler.h"
17
+#include <algorithm>
18
#include <cassert>
19
#include <climits>
20
#include <cmath>
@@ -792,7 +793,7 @@ inline int64_t SignExtend64(uint64_t X, unsigned B) {
792
793
/// value of the result.
794
template <typename T>
795
std::enable_if_t<std::is_unsigned<T>::value, T> AbsoluteDifference(T X, T Y) {
- return X > Y ? X - Y : Y - X;
796
+ return std::max(X, Y) - std::min(X, Y);
797
}
798
799
/// Add two unsigned integers, X and Y, of type T. Clamp the result to the
0 commit comments