Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/include/mlir/Dialect/Polynomial/IR/Polynomial.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class FloatPolynomial : public PolynomialBase<FloatPolynomial, FloatMonomial> {
// Make Polynomials hashable.
template <class D, typename T>
inline ::llvm::hash_code hash_value(const PolynomialBase<D, T> &arg) {
return ::llvm::hash_combine_range(arg.terms.begin(), arg.terms.end());
return ::llvm::hash_combine_range(arg.terms);
}

template <class D, typename T>
Expand Down
2 changes: 1 addition & 1 deletion mlir/include/mlir/IR/BlockSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ struct DenseMapInfo<mlir::SuccessorRange> {
return mlir::SuccessorRange(pointer, 0);
}
static unsigned getHashValue(mlir::SuccessorRange value) {
return llvm::hash_combine_range(value.begin(), value.end());
return llvm::hash_combine_range(value);
}
static bool isEqual(mlir::SuccessorRange lhs, mlir::SuccessorRange rhs) {
if (rhs.getBase() == getEmptyKey().getBase())
Expand Down
2 changes: 1 addition & 1 deletion mlir/include/mlir/IR/TypeRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class TypeRange : public llvm::detail::indexed_accessor_range_base<

/// Make TypeRange hashable.
inline ::llvm::hash_code hash_value(TypeRange arg) {
return ::llvm::hash_combine_range(arg.begin(), arg.end());
return ::llvm::hash_combine_range(arg);
}

/// Emit a type range to the given output stream.
Expand Down
17 changes: 7 additions & 10 deletions mlir/lib/Dialect/Quant/IR/TypeDetail.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ struct UniformQuantizedPerAxisTypeStorage : public QuantizedTypeStorage {
unsigned getHashValue() const {
int64_t *scalesCast = llvm::bit_cast<int64_t *>(scales.data());
ArrayRef<int64_t> scalesBits(scalesCast, scales.size());
return llvm::hash_combine(
flags, storageType, expressedType,
llvm::hash_combine_range(scalesBits.begin(), scalesBits.end()),
llvm::hash_combine_range(zeroPoints.begin(), zeroPoints.end()),
storageTypeMin, storageTypeMax);
return llvm::hash_combine(flags, storageType, expressedType,
llvm::hash_combine_range(scalesBits),
llvm::hash_combine_range(zeroPoints),
storageTypeMin, storageTypeMax);
}
};

Expand Down Expand Up @@ -318,11 +317,9 @@ struct UniformQuantizedSubChannelTypeStorage : public QuantizedTypeStorage {
}

// Hash the quantized dimensions and block sizes.
hash = llvm::hash_combine(
hash,
llvm::hash_combine_range(quantizedDimensions.begin(),
quantizedDimensions.end()),
llvm::hash_combine_range(blockSizes.begin(), blockSizes.end()));
hash = llvm::hash_combine(hash,
llvm::hash_combine_range(quantizedDimensions),
llvm::hash_combine_range(blockSizes));

return hash;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ static llvm::hash_code computeHash(SymbolOpInterface symbolOp) {
return attr.getName() != SymbolTable::getSymbolAttrName();
});

return llvm::hash_combine(
symbolOp->getName(),
llvm::hash_combine_range(range.begin(), range.end()));
return llvm::hash_combine(symbolOp->getName(),
llvm::hash_combine_range(range));
}

namespace mlir {
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ struct OffsetMapInfo {
static SmallVector<int64_t> getTombstoneKey() { return {int64_t(-2)}; }

static unsigned getHashValue(const SmallVector<int64_t> &v) {
return static_cast<unsigned>(llvm::hash_combine_range(v.begin(), v.end()));
return static_cast<unsigned>(llvm::hash_combine_range(v));
}

static bool isEqual(const SmallVector<int64_t> &lhs,
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Transforms/Utils/DialectConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct ValueVectorMapInfo {
static ValueVector getEmptyKey() { return ValueVector{Value()}; }
static ValueVector getTombstoneKey() { return ValueVector{Value(), Value()}; }
static ::llvm::hash_code getHashValue(const ValueVector &val) {
return ::llvm::hash_combine_range(val.begin(), val.end());
return ::llvm::hash_combine_range(val);
}
static bool isEqual(const ValueVector &LHS, const ValueVector &RHS) {
return LHS == RHS;
Expand Down
7 changes: 3 additions & 4 deletions mlir/unittests/IR/OpPropertiesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ inline llvm::hash_code computeHash(const TestProperties &prop) {
// We hash `b` which is a float using its underlying array of char:
unsigned char const *p = reinterpret_cast<unsigned char const *>(&prop.b);
ArrayRef<unsigned char> bBytes{p, sizeof(prop.b)};
return llvm::hash_combine(
prop.a, llvm::hash_combine_range(bBytes.begin(), bBytes.end()),
llvm::hash_combine_range(prop.array.begin(), prop.array.end()),
StringRef(*prop.label));
return llvm::hash_combine(prop.a, llvm::hash_combine_range(bBytes),
llvm::hash_combine_range(prop.array),
StringRef(*prop.label));
}

/// A custom operation for the purpose of showcasing how to use "properties".
Expand Down
Loading