-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[WIP] Alternative approach to issue 47202 #77370
Conversation
The debugger is not using empty variable live ranges. We are reporting them because they can get extended later if the variable becomes alive in the immediately next emitted instruction. If an empty live range is not getting extended, which we can realize after emitting all the code or creating a new live range for the same variable, we can remove it.
When the emitter moved to the next group but has not emitted any instruction, and the variable died and becomes alive again, we would like to extend its range.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Detailsnull
|
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.
I'm curious if all this logic can be done inside genSetScopeInfoUsingVariableRanges
instead. There is already some existing logic there that extends previous live ranges, can we add some logic that handles this case there too and avoid the complicated emitLocation
reasoning?
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
My guess is this is a little bit faster, but we can measure that with spmi in a new pr after this. Now we are deciding if we want to be faster and a little bit leaky in memory usage or be precise in memory usage but slower. What do you think? There are cases in which we cannot tell whether two emitLocation are close enough to extend before emitting code, and even after emitting code we can potentially remove instructions, so we cannot avoid checking for extension in genSetScopeInfoUsingVariableRanges. Having said that, computing emitLocation's offset in |
If we can centralize this kind of logic inside
We are already reporting the offset in |
Closing this PR as its alternative performs better. |
This PR is intended to measure spmi results. It is another approach to solve issue #47202, in which we don't ask the vm for more memory than what is necessary, but we do scan all variable live ranges before copying them to the vm memory.
The thing is empty variable live ranges are useless. We are reporting them because they can get extended later if the variable becomes alive in the immediately next emitted instruction. If an empty live range is not getting extended, which we can realize after emitting all the code or creating a new live range for the same variable, we can remove it.
Tested running
before and after this PR, checking the differences manually. Files are big and I wasn't able to get a nice diff that I could post here. I am open to any suggestions for more testing.