You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request for scalar replacement of aggregates in RyuJIT. RyuJIT currently does not optimize value types very well, and this will hopefully fix this.
@DemiMarie - as @pgavlin mentions, this is called "struct promotion" in RyuJIT, and it is limited in what it will do. Some of the fundamental constraints are:
The struct must not be address-taken (and it is currently somewhat conservative about what it considers to be address-taking, which could be improved).
It must have no overlapping fields.
Some of the heuristic or implementation-limited constraints are:
It must have only primitive fields.
It must not be an argument or a return value that is passed in registers.
It can't be larger than 32 bytes.
It can't have more than 4 fields.
We expect to make improvements in this area relatively soon, but if there are specific scenarios you're interested (especially if you have some code, ideally in the form of a benchmark, that demonstrates it) we'd love to hear about it.
Activity
pgavlin commentedon Aug 15, 2016
cc @CarolEidt @dotnet/jit-contrib
RyuJIT does perform some limited SROA, but the terminology is different: RyuJIT refers to this optimization as "struct promotion".
DemiMarie commentedon Aug 18, 2016
I was thinking of full SROA, at least where that would be beneficial.
On Aug 15, 2016 3:16 PM, "Pat Gavlin" notifications@github.com wrote:
CarolEidt commentedon Aug 18, 2016
@DemiMarie - as @pgavlin mentions, this is called "struct promotion" in RyuJIT, and it is limited in what it will do. Some of the fundamental constraints are:
Some of the heuristic or implementation-limited constraints are:
We expect to make improvements in this area relatively soon, but if there are specific scenarios you're interested (especially if you have some code, ideally in the form of a benchmark, that demonstrates it) we'd love to hear about it.
If you're interested in the work that I'm currently doing to improve code generation for structs (aka value types), see https://github.com/dotnet/coreclr/blob/master/Documentation/design-docs/first-class-structs.md
[-]Scalar replacement of aggrigates[/-][+]Scalar replacement of aggregates[/+]BruceForstall commentedon Sep 20, 2019
Given that we already have struct promotion, and various documents and issues discussing improvements, I'm going to close this.