Move prefetch_heap_block() from find() into find_large() (matching `find_or_prepare_insert_large()`). In `raw_hash_set::find()`, calling `prefetch_heap_block()` before `find_large()` duplicates the `control()` load and `prefetcht2` instruction at every call site where `find()` is inlined but `find_large()` is not. PiperOrigin-RevId: 1004962020
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index e717125..1c1d709 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h
@@ -3477,7 +3477,6 @@ iterator find(const key_arg<K>& key) ABSL_ATTRIBUTE_LIFETIME_BOUND { AssertOnFind(key); if (is_small()) return find_small(key); - prefetch_heap_block(); return find_large<FindLargeKey<key_arg<K>>>(key); } @@ -3643,6 +3642,7 @@ template <class K> iterator find_large(absl::type_identity_t<K> key) { static_assert(std::is_same_v<K, FindLargeKey<K>>); + prefetch_heap_block(); const size_t hash = hash_of(key); const size_t cap = common().capacity(); ABSL_ASSUME(cap > kMaxSmallCapacity);