Always-inline SwissTable iterator advancement methods. Annotate HashSetIteratorBase::increment(), HashSetIteratorBase::skip_empty_or_deleted(), raw_hash_set::iterator::operator++() (prefix), and raw_hash_set::const_iterator::operator++() (prefix) in raw_hash_set.h with ABSL_ATTRIBUTE_ALWAYS_INLINE. Flattening prefix operator++(), increment(), and skip_empty_or_deleted() during AlwaysInlinerPass exposes the per-step control-byte scan loop alongside iterator initialization to early SimplifyCFGPass and JumpThreadingPass. On x86-64 this eliminates the duplicate empty/deleted skip loop emitted before the iteration loop and folds the separate kSentinel check into condition flags from a single `cmpb $-0x1, 0x1(%rax)`, shrinking the full-slot inner loop body from 9 to 7 instructions. PiperOrigin-RevId: 1014901929
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index cc85cd1..265919c 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h
@@ -1906,7 +1906,7 @@ } template <size_t kSlotSize> - void increment() { + ABSL_ATTRIBUTE_ALWAYS_INLINE void increment() { assert_is_full("operator++"); ++ctrl_; slot_ = static_cast<char*>(slot_) + kSlotSize; @@ -1917,7 +1917,7 @@ // Fixes up `ctrl_` to point to a full or sentinel by advancing `ctrl_` and // `slot_` until they reach one. template <size_t kSlotSize> - void skip_empty_or_deleted() { + ABSL_ATTRIBUTE_ALWAYS_INLINE void skip_empty_or_deleted() { while (IsEmptyOrDeleted(*ctrl_)) { ++ctrl_; slot_ = static_cast<char*>(slot_) + kSlotSize; @@ -2894,7 +2894,7 @@ } // PRECONDITION: not an end() iterator. - iterator& operator++() { + ABSL_ATTRIBUTE_ALWAYS_INLINE iterator& operator++() { this->increment<sizeof(slot_type)>(); return *this; } @@ -2946,7 +2946,7 @@ reference operator*() const { return *inner_; } pointer operator->() const { return inner_.operator->(); } - const_iterator& operator++() { + ABSL_ATTRIBUTE_ALWAYS_INLINE const_iterator& operator++() { ++inner_; return *this; }