Skip to content

Commit cb278a5

Browse files
committed
use hash_combine
1 parent b75bf1e commit cb278a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Monomial {
5858
// Prints polynomial to 'os'.
5959
void print(raw_ostream &os) const;
6060

61-
friend ::llvm::hash_code hash_value(const Monomial& arg);
61+
friend ::llvm::hash_code hash_value(const Monomial &arg);
6262

6363
public:
6464
APInt coefficient;
@@ -120,8 +120,9 @@ inline ::llvm::hash_code hash_value(Polynomial arg) {
120120
return ::llvm::hash_value(arg.terms);
121121
}
122122

123-
inline ::llvm::hash_code hash_value(const Monomial& arg) {
124-
return ::llvm::hash_value(arg.coefficient) ^ ::llvm::hash_value(arg.exponent);
123+
inline ::llvm::hash_code hash_value(const Monomial &arg) {
124+
return llvm::hash_combine(::llvm::hash_value(arg.coefficient),
125+
::llvm::hash_value(arg.exponent));
125126
}
126127

127128
inline raw_ostream &operator<<(raw_ostream &os, Polynomial polynomial) {

0 commit comments

Comments
 (0)