diff --git a/llvm/include/llvm/ADT/CachedHashString.h b/llvm/include/llvm/ADT/CachedHashString.h index c3688cb69783..c86726e95d31 100644 --- a/llvm/include/llvm/ADT/CachedHashString.h +++ b/llvm/include/llvm/ADT/CachedHashString.h @@ -61,7 +61,8 @@ template <> struct DenseMapInfo { } static bool isEqual(const CachedHashStringRef &LHS, const CachedHashStringRef &RHS) { - return DenseMapInfo::isEqual(LHS.val(), RHS.val()); + return LHS.hash() == RHS.hash() && + DenseMapInfo::isEqual(LHS.val(), RHS.val()); } };