-
Notifications
You must be signed in to change notification settings - Fork 42
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
Support explicit stack slots #12
Comments
Sorry for the delay in thinking about this -- it's a worthwhile goal, I think! I'm definitely onboard with some sort of interface that allows the user to name explicit stack slot locations. It seems to me that this scheme is, more or less, defining virtual PRegs (in the general sense of "virtual", not specifically "VRegs", if that makes sense): we basically have a new class, or register file, and we allocate from its entries/slots like any other. Then these are used in the same way other ABI-specified registers are used for call args. Is that accurate? I had worried that supporting a more general explicitly-specified-stack-slot need would require a larger index (in general In Cranelift at least this will a really nice way to avoid the explicit load of stack-passed args in the prologue. Presumably your use-case is similar. (If there are more than 32 stack args of either class, we can still fall back on generally unconstrained vregs and explicit loads in the prologue.) I'm unsure whether it makes more sense to define actual As to where the bit comes from: ideally we buy ourselves more bits by implementing one of the ideas in #5. Possibly for prototyping this one could steal one more bit from the vreg index, though that is getting uncomfortably limited now and 2^19 (512K) seems pretty likely to hit some actual limits. So I think #5 is probably a prerequisite here. One unaddressed point above is how these slots appear in the I'm excited to see where this goes! |
This is useful for functions which take many arguments and return many values, some of which are in registers while the rest are in ABI-specified stack slots.
I think the best way to add support for fixed stack slots is to add an extra bit to
PReg
to add 32 integer stack slots and 32 float stack slots.Implementation-wise, a fixed stack slot is very similar to
Operand::Fixed
:Fixed
uses of the same vreg.PReg
.process_bundle
: we may need to split a bundle in case of conflicts or evict another conflicting bundle.Requirement::Stack
withRequirement::Fixed(preg)
whenpreg
refers to a fixed stack slot.The text was updated successfully, but these errors were encountered: