-
Notifications
You must be signed in to change notification settings - Fork 5k
RyuJIT: representation of spill/unspill in JIT IR #92207
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
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsCurrently, LSRA annotates a tree node with Could we change LSRA to instead generate actual IR nodes for the spills and unspills (e.g., a @dotnet/jit-contrib Comments?
|
I like the idea. It would be interesting to collect data on the number of spills/unspills we see (with/without minopts) to get an idea of how much additional IR it would introduce. Would the new nodes have their own codegen or would they be handled as part of the consuming node? For example,
which sounds very similar to this idea. It is not completely obvious to me what the IR nodes would end up looking like, especially for the multireg node cases. Do you have any examples of what you were thinking? There is also the question of how reg-optional uses would be represented, e.g. |
Definitely some more research is needed here. I would expect the new nodes would have their own codegen and would not be contained. GT_RELOAD is already used, but only in some situations where the GTF_SPILLED bit couldn't be used (IIUC). Thanks for pointing out the |
Currently, LSRA annotates a tree node with
GTF_SPILL
if it should be spilled by the code generator after it is evaluated, andGTF_SPILLED
if it must be reloaded before being used. This means that the actual generated set of loads and stores are not explicit in the IR as normal IR nodes. There ends up being a lot of special handling for SPILL/SPILLED flags, especially for multi-reg nodes.Could we change LSRA to instead generate actual IR nodes for the spills and unspills (e.g., a
GT_STORE_LCL_VAR
for a store)? Then, the spill/unspill concept would be isolated to the register allocator, we could get rid ofGTF_SPILL
/GTF_SPILLED
flags, as well as all the multi-reg spill cases, such asMultiRegSpillFlags
,GetRegSpillFlagByIdx
, etc. Presumably spills/unspills could then be subject to normal code motion optimizations (e.g., hoisting) (assuming we ever implemented post-LSRA optimizations).@dotnet/jit-contrib Comments?
The text was updated successfully, but these errors were encountered: