[llvm] [llvm] Call hash_combine_range with ranges (NFC) (PR #143225)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 18:43:54 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/143225

We can now invoke hash_combine_range with a range.


>From c6184f006b49953cbd29915f40e342562244a4b0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 6 Jun 2025 08:11:05 -0700
Subject: [PATCH] [llvm] Call hash_combine_range with ranges (NFC)

We can now invoke hash_combine_range with a range.
---
 .../llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h      | 2 +-
 llvm/lib/Support/Windows/Path.inc                               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
index 252b55163cb09..7765a4ab2ba98 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
@@ -27,7 +27,7 @@ template <> struct DenseMapInfo<SmallVector<sandboxir::Value *>> {
     return SmallVector<sandboxir::Value *>({(sandboxir::Value *)-2});
   }
   static unsigned getHashValue(const SmallVector<sandboxir::Value *> &Vec) {
-    return hash_combine_range(Vec.begin(), Vec.end());
+    return hash_combine_range(Vec);
   }
   static bool isEqual(const SmallVector<sandboxir::Value *> &Vec1,
                       const SmallVector<sandboxir::Value *> &Vec2) {
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index 0afd0141b525a..fdf9d540a6488 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -748,7 +748,7 @@ static std::error_code getStatus(HANDLE FileHandle, file_status &Result) {
     PathHash = (static_cast<uint64_t>(Info.nFileIndexHigh) << 32ULL) |
                static_cast<uint64_t>(Info.nFileIndexLow);
   } else {
-    PathHash = hash_combine_range(ntPath.begin(), ntPath.end());
+    PathHash = hash_combine_range(ntPath);
   }
 
   Result = file_status(



More information about the llvm-commits mailing list