Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline instrumentation register allocation #59

Open
ndrewh opened this issue Jan 18, 2025 · 0 comments
Open

feat: inline instrumentation register allocation #59

ndrewh opened this issue Jan 18, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request inline inline instrumentation compiler perf Improves performance (often only in edge cases)
Milestone

Comments

@ndrewh
Copy link
Owner

ndrewh commented Jan 18, 2025

Right now we just spill all values into a (fixed-size) scratch region. Instrumentation that requires more values than fit in the scratch region will just abort right now.

For now: we can just do a linear scan to determine live ranges, and then reserve the appropriate number of registers (max variables live at a single point) with drreg. This should allow us to remove the scratch region. We may still run out of registers, but we can abort until someone finds a use case for that much computation.

Ideally, we would assign registers based on the final destination: if a value needs to end up in RAX eventually we should try to reserve that register (shouldn't we always reserve these?) for that value.

This should greatly improve performance since we can avoid spilling to stack in many cases.

@ndrewh ndrewh added enhancement New feature or request inline inline instrumentation compiler perf Improves performance (often only in edge cases) labels Jan 18, 2025
@ndrewh ndrewh added this to the 0.5 milestone Jan 18, 2025
@ndrewh ndrewh self-assigned this Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request inline inline instrumentation compiler perf Improves performance (often only in edge cases)
Projects
None yet
Development

No branches or pull requests

1 participant