forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AArch64: Enhance the effectiveness of the register cache
365224b introduced a cache to keep track of BEAM registers that had already been loaded into CPU registers. This commit further improves the effectiveness of the cache. Now 21,109 loads of BEAM registers are avoided, compared to 15,098 loads before this commit. (When loading all modules in OTP and the standard library of Elixir 16.0.0.) Of those load instructions, 8,975 instructions were no longer needed because the contents of the BEAM register was already present in the desired CPU register. Before this commit, only 1,861 load instructions were eliminated. The remaining load instructions are replaced with a `mov` instruction (from register to register), which is more efficient than a load instruction but does not reduce the code size. As an example, the following BEAM code: {test,is_nonempty_list,{f,3},[{y,0}]}. {get_hd,{y,0},{x,0}}. would be translated to native code like so: # is_nonempty_list_fS ldr x8, [x20] tbnz x8, 1, @label_3-1 # get_hd_Sd ldr x8, [x20] ldur x25, [x8, -1] That is, `{y,0}` would be loaded into a CPU register twice. The improved caching avoids reloading `{y,0}` in the `get_hd` instruction: # is_nonempty_list_fS ldr x8, [x20] tbnz x8, 1, @label_3-1 # get_hd_Sd # skipped fetching of BEAM register ldur x25, [x8, -1]
- Loading branch information
Showing
8 changed files
with
342 additions
and
183 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.