Skip to content

JIT: add register value caching across all backends#2179

Draft
pguyot wants to merge 1 commit intoatomvm:mainfrom
pguyot:w10/add-register-value-caching
Draft

JIT: add register value caching across all backends#2179
pguyot wants to merge 1 commit intoatomvm:mainfrom
pguyot:w10/add-register-value-caching

Conversation

@pguyot
Copy link
Collaborator

@pguyot pguyot commented Mar 11, 2026

Add register value tracking (jit_regs) to all JIT backends (x86-64, aarch64, armv6m, riscv32). This enables optimization of redundant loads when a register already contains the needed value.

Factor out shared value_to_contents and vm_dest_to_contents helpers into jit_regs module. Add regs_to_mask/2 to replace per-backend duplicated regs_to_mask/1 functions. Add invalidate_volatile/2 for correct cache management after function calls.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Add register value tracking (jit_regs) to all JIT backends (x86-64,
aarch64, armv6m, riscv32). This enables optimization of redundant loads
when a register already contains the needed value.

Factor out shared value_to_contents and vm_dest_to_contents helpers into
jit_regs module. Add regs_to_mask/2 to replace per-backend duplicated
regs_to_mask/1 functions. Add invalidate_volatile/2 for correct cache
management after function calls.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot pguyot force-pushed the w10/add-register-value-caching branch from 5a24621 to 62680da Compare March 11, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant