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

Emit GC.AllocateUninitializedArray for an initialized array creation expression #61011

Closed
alrz opened this issue Apr 28, 2022 · 1 comment
Closed
Assignees
Labels
Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code
Milestone

Comments

@alrz
Copy link
Member

alrz commented Apr 28, 2022

Right now a newarr immediately followed by the initialization (memberwise or block) is emitted which seem to be wasteful.

new[] { 1, 2, 3, 4 };
var t = GC.AllocateUninitializedArray<int>(4);
InitializeArray(t, ... );
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 28, 2022
@jcouv jcouv added the Code Gen Quality Room for improvement in the quality of the compiler's generated code label Apr 28, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 26, 2022
@jcouv jcouv added this to the 17.4 milestone Jun 26, 2022
@333fred
Copy link
Member

333fred commented Jul 22, 2022

Not a perf improvement. See #62864.

@333fred 333fred closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code
Projects
None yet
Development

No branches or pull requests

4 participants