Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Emit stackalloc block initializer for byte-sized enums#66251

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jcouv merged 3 commits intodotnet:mainfromalrz:stackalloc-enum
Jan 10, 2023

Conversation

alrz
Copy link
Member

@alrzalrz commentedJan 4, 2023

No description provided.

@alrzalrz requested a review froma team as acode ownerJanuary 4, 2023 23:36
@ghostghost added Area-Compilers CommunityThe pull request was submitted by a contributor who is not a Microsoft employee. labelsJan 4, 2023
@jcouvjcouv self-assigned thisJan 5, 2023
Copy link
Member

@jcouvjcouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM Thanks (iteration 1)

@jcouv
Copy link
Member

@dotnet/roslyn-compiler for second review. Thanks

@@ -47,7 +47,7 @@ private void EmitStackAllocInitializers(TypeSymbol type, BoundArrayInitializatio
EmitElementStackAllocInitializers(elementType, initExprs, includeConstants: false);
}
}
else if (elementType.SpecialType.SizeInBytes() == 1)
else if (elementType.EnumUnderlyingTypeOrSelf().SpecialType.SizeInBytes() == 1)
Copy link
Member

@jcouvjcouvJan 5, 2023
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not related to this PR: we could also lift the 1 byte restriction as was done in theCreateSpan PR. Somehow I didn't realize until now.
One second thought, it's less beneficial here. We'd still need to copy the data, so maybe the savings aren't as meaningful.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

#61414 doesn't do anything on stackalloc, unlike#57123 but I think that's not merged in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Right, I mean we can do something like#61414 but for stackalloc. I didn't realize we'd already done a demo branch with exactly that. Thanks for digging up#57123. I'll ping there to see whether we should make a real PR with that change.

alrz reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@jcouv, what became of this? Even just emitting it as a copy from the data section (which the JIT should be able to unroll in many cases) would likely be useful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@stephentoub It looks like the hackathon project didn't transfer into a committed project/PR. Thelast comment from Jared there is that this just needs keyboard time, but we support it in principle.
We're out of dev bandwidth for .NET 8 (ie. at least for one month) unless urgent. Let's discuss around that time. We could file an 17.9 issue (refresh, resolve conflicts and bring#57123 intomain) for tracking purpose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I opened#69325. Thanks.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stephentoubstephentoubstephentoub left review comments

@jcouvjcouvjcouv approved these changes

@333fred333fred333fred approved these changes

Assignees

@jcouvjcouv

Labels
Area-CompilersCommunityThe pull request was submitted by a contributor who is not a Microsoft employee.
Projects
None yet
Milestone
17.6 P1
Development

Successfully merging this pull request may close these issues.

5 participants
@alrz@jcouv@333fred@stephentoub@Cosifne

[8]ページ先頭

©2009-2025 Movatter.jp