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
YJIT: Optimize local variables when EP == BP #10487
Conversation
This comment has been minimized.
This comment has been minimized.
913e817
to
fd54744
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @k0kubun ! This looks good. Nice work.
For completeness, could you measure memory usage on lobsters? Just asking because of the extra invariants we need to care care of, might be a useful data point.
Sure. With 25 itrs on lobsters, Before
After
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to think about how to optimize memory usage for storing invariants in the future, but this PR seems like a clear step in the right direction 👍
This seems causing recent hang ups at |
This PR optimizes local variable access in
getlocal
andsetlocal
fromREG_CFP->ep[offset]
(2 instructions) toREG_SP[offset]
(1 instruction) when EP == BP. When EP escapes, the block gets invalidated.Because local variable access is now based off of SP, this will allow us to handle local variables using
Opnd::Stack
and allocate registers for them in a future PR.Generated code
Before
After
Benchmark
This seems to improve the performance of the following benchmarks.