Skip to content
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

Scalar replacement of aggregates #6494

Closed
DemiMarie opened this issue Aug 13, 2016 · 4 comments
Closed

Scalar replacement of aggregates #6494

DemiMarie opened this issue Aug 13, 2016 · 4 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Milestone

Comments

@DemiMarie
Copy link

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.

category:cq
theme:promotion
skill-level:expert
cost:extra-large

@pgavlin
Copy link
Contributor

pgavlin commented 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
Copy link
Author

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:

cc @CarolEidt https://github.com/CarolEidt @dotnet/jit-contrib
https://github.com/orgs/dotnet/teams/jit-contrib

RyuJIT does perform some limited SROA, but the terminology is different:
RyuJIT refers to this optimization as "struct promotion".


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/dotnet/coreclr/issues/6733#issuecomment-239899991,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGGWB9F_-IU1o_sR79fUNltb12eugJBtks5qgLsRgaJpZM4JjumT
.

@CarolEidt
Copy link
Contributor

@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.

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

@CarolEidt CarolEidt changed the title Scalar replacement of aggrigates Scalar replacement of aggregates Aug 22, 2016
@BruceForstall
Copy link
Member

Given that we already have struct promotion, and various documents and issues discussing improvements, I'm going to close this.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI enhancement Product code improvement that does NOT require public API changes/additions optimization tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

5 participants