Skip to content

hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b

@neildhar neildhar tagged this 15 Aug 07:17
Summary:
Original Author: [email protected]
Original Git: 6b69a06fc4a498ac467b590985515100c63313c3
Original Reviewed By: avp
Original Revision: D59072005

The register allocator has the ability to honour a memory limit that is
proportional to the product of the number of instructions and basic
blocks in the function being allocated. Unfortunately, functions that
hit this limit by definition have a lot of instructions Even in the
most degenerate case where every block has one instruction, you need
4000 instructions to hit the 10M limit.

This diff tries to improve the quality of generated code in cases where
most values are used within the basic block they are defined in. In such
cases, we currently make the register available after the end of the
block. With this diff, the registers become available after their last
use in the block.

This is useful for functions with extremely large basic blocks, where
the current approach would end up allocating a huge number of registers
since the registers cannot be used within the same block.

Closes #1448

Reviewed By: avp

Differential Revision: D60241766

fbshipit-source-id: 5196333862517cd546d675cf8fe005eb1ed5a790
Assets 2
Loading