-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: [experiment] Add an explicit IR representation for parameter definitions #92026
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsFor the hackathon I have been working on adding an explicit IR representation for parameters that are passed in registers. That is, lowering actually materializes IR to move the parameter register into its local home. The benefit is that this decouples multireg parameter support from promotion, and it can give a more natural way to handle structs with fields that don't cleanly map to the registers.
|
Overall my current impression is that it would be much simpler to create some new locals instead and communicate to LSRA that these should represent the parameter registers. Then we don't need to introduce a new kind of interval, and things like spilling falls out more or less naturally. On the other hand they will end up taking up slots in local table and tracking indices, and I'm not sure the approach scales to multireg returning calls where I was planning on trying a similar approach. |
cc @dotnet/jit-contrib |
For the hackathon I have been working on adding an explicit IR representation for parameters that are passed in registers. That is, lowering actually materializes IR to move the parameter register into its local home. The benefit is that this decouples multireg parameter support from promotion, and it can give a more natural way to handle structs with fields that don't cleanly map to the registers.
GT_GETPARAM_REG
node that represents the use of an incoming parameter register. It has similar semantics toLCL_VAR
in that it is used at its user, and it does not induce any defs. MultipleGT_GETPARAM_REG
uses for the same parameter is supported.GT_GETPARAM_REG
is only legal in the entry basic block.LclVarDsc::lvExplicitParamInit
. When a parameter local is marked at such it is not implicitly defined during prolog codegen and behaves essentially like a normal local.GT_GETPARAM_REG
. This allows physically promoted struct parameters to stay in registers without spills.LclVarDsc::lvExplicitParamInit
parameter and get the normal parameter def that the local would get.GT_GETPARAM_REG
nodes are translated to uses on these intervals. In this experiment these intervals do not support spilling, which puts constraints on what the entry BB is allowed to do with theseGT_GETPARAM_REG
nodes. Spilling support would require some new way to communicate to the backend that the parameter should be spilled during prolog generation.