Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTO] Remove extraneous ArrayRef (NFC) #90306

Merged
merged 1 commit into from
Apr 27, 2024

Conversation

kazutakahirata
Copy link
Contributor

We don't need to explicitly create these instances of ArrayRef because
Hasher::update takes ArrayRef, and ArrayRef can be implicitly
constructed from C arrays.

We don't need to explicitly create these instances of ArrayRef because
Hasher::update takes ArrayRef, and ArrayRef can be implicitly
constructed from C arrays.
@llvmbot llvmbot added the LTO Link time optimization (regular/full LTO or ThinLTO) label Apr 27, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 27, 2024

@llvm/pr-subscribers-lto

Author: Kazu Hirata (kazutakahirata)

Changes

We don't need to explicitly create these instances of ArrayRef because
Hasher::update takes ArrayRef, and ArrayRef can be implicitly
constructed from C arrays.


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

1 Files Affected:

  • (modified) llvm/lib/LTO/LTO.cpp (+2-2)
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 53060df7f503e0..21cad1de0ced57 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -114,12 +114,12 @@ void llvm::computeLTOCacheKey(
   auto AddUnsigned = [&](unsigned I) {
     uint8_t Data[4];
     support::endian::write32le(Data, I);
-    Hasher.update(ArrayRef<uint8_t>{Data, 4});
+    Hasher.update(Data);
   };
   auto AddUint64 = [&](uint64_t I) {
     uint8_t Data[8];
     support::endian::write64le(Data, I);
-    Hasher.update(ArrayRef<uint8_t>{Data, 8});
+    Hasher.update(Data);
   };
   AddString(Conf.CPU);
   // FIXME: Hash more of Options. For now all clients initialize Options from

@kazutakahirata kazutakahirata merged commit d6bf04f into llvm:main Apr 27, 2024
5 of 6 checks passed
@kazutakahirata kazutakahirata deleted the pr_cleanup_ArrayRef_LTO branch April 27, 2024 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTO Link time optimization (regular/full LTO or ThinLTO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants