)]}'
{
  "commit": "f849bb9e0d289b94e2df4a77562760048bb0f8ea",
  "tree": "a8e44d45ec86f7af6fd12da19e7f2eec93a46f04",
  "parents": [
    "35cb2992a9281e5c6261f9706384f1b5fa163898"
  ],
  "author": {
    "name": "Vitaly Goldshteyn",
    "email": "goldvitaly@google.com",
    "time": "Sat Oct 17 01:30:25 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Tue Oct 20 13:48:55 2026 -0700"
  },
  "message": "Select the base pointer rather than the index in `SetCtrlNoSanitizeImpl`.\n\nInstead of computing a conditional index, select the base pointer and index it by `i` (`cloned_ctrl_base[i] \u003d h`).\n\nWhy this improves generated code:\n1. **Decouples `ctrl + cap + 1` from `i`**: With index selection, LLVM selects `cap + 1` vs `0` and must also compute `ctrl + i` into a temporary register (`leaq (%ctrl, %i), %tmp`) before the cloned store `movb %h, (%offset, %tmp)`, placing an extra `leaq` on the critical path of `i` and increasing register pressure. With pointer selection, `ctrl + cap + 1` is independent of `i`, so both stores index directly by `%i_reg` (`movb %h, (%ctrl, %i)` and `movb %h, (%cloned_ctrl_base, %i)`).\n2. **Eliminates `negq` and `xorl` in callers**:\n   - In `PrepareInsertLarge`, `-(cap + 1)` is already in `%r10` (`-1ULL \u003c\u003c shift`). Pointer selection computes `ctrl + cap + 1` via `movq %r8, %rbx; subq %r10, %rbx` off the `offset` (`%rcx`) dependency chain, eliminating `negq %r10`, `xorl %ebx, %ebx`, and `leaq (%r8, %rcx), %r10`.\n   - In `PrepareInsertLargeSlow`, `cap` is already in callee-saved `%r12` across `find_first_non_full_from_h1`, so `-(cap + 1)` no longer needs to be spilled to `-0x38(%rbp)` and reloaded/negated (`movq -0x38(%rbp), %r9; negq %r9; xorl %r10d, %r10d`), shrinking the stack frame from `subq $0x18, %rsp` to `pushq %rax` and simplifying `SetCtrl` to `leaq 0x1(%rbx, %r12), %r9; cmovaeq %rbx, %r9`.\n   - In loop-heavy functions (`DecodeAndInsertImpl`, `RehashOrGrowToNextCapacityAndPrepareInsert`, `ClearBackingArray`), LLVM hoists `ctrl + cap + 1` out of the loop (reusing `ctrl + cap` already computed for `slot_array`) and eliminates `leaq (%ctrl, %i)` inside the loop body.\n   - `InsertOldSooSlotAndInitializeControlBytes` shrinks enough to be inlined into `ResizeFullSooTable`, saving 101 bytes and 39 instructions across the pair.\n\nPiperOrigin-RevId: 1001371365\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "48477493833888316e07ac1f74f4cbb4b9a14777",
      "old_mode": 33188,
      "old_path": "absl/container/internal/raw_hash_set.cc",
      "new_id": "b477e603befc35ea81e3db14732718b8e66dc1e3",
      "new_mode": 33188,
      "new_path": "absl/container/internal/raw_hash_set.cc"
    }
  ]
}
