feat: inline instrumentation register allocation #59
Labels
enhancement
New feature or request
inline
inline instrumentation compiler
perf
Improves performance (often only in edge cases)
Milestone
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.
The text was updated successfully, but these errors were encountered: