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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 18:44:28 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-vectorizers

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

We can now invoke hash_combine_range with a range.


---
Full diff: https://github.com/llvm/llvm-project/pull/143225.diff


2 Files Affected:

- (modified) llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h (+1-1) 
- (modified) llvm/lib/Support/Windows/Path.inc (+1-1) 


``````````diff
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(

``````````

</details>


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


More information about the llvm-commits mailing list