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

[SR-3727] Determine the layout algorithm for payloaded enums #46312

Closed
ematejska mannequin opened this issue Jan 25, 2017 · 3 comments
Closed

[SR-3727] Determine the layout algorithm for payloaded enums #46312

ematejska mannequin opened this issue Jan 25, 2017 · 3 comments
Labels
affects ABI Flag: Affects ABI task

Comments

@ematejska
Copy link
Mannequin

ematejska mannequin commented Jan 25, 2017

Previous ID SR-3727
Radar rdar://problem/31411198
Original Reporter @ematejska
Type Task
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s
Labels Task, AffectsABI
Assignee None
Priority Medium

md5: fe502935ae3aee66b438641e4a3b8d0a

relates to:

  • SR-5267 Optional layout is inefficient

Issue Description:

Ahead of ABI Stability, determine the layout algorithm for multi-payload enums. The algorithm should try to rearrange payloads so as to coalesce cases and save space. This rearrangement can also improve performance and code size. For example, if ARC-ed payload components reside in the same location, operations like copy can be done directly on the values without extensive switching.

@jckarter
Copy link
Member

Single-payload enum layout deserves some consideration too. It'd be nice if extra inhabitants were always distributed in such a way that we could figure out the tag of an enum loading only one word; sometimes the tag information is scattered between extra tag bits at the back of the value and extra inhabitants which are biased toward the front of the value.

@bob-wilson
Copy link

@swift-ci create

@bob-wilson
Copy link

The only change that we're going to make for the stable ABI is to look for extra inhabitants in any field of a fixed-layout struct (#18630 Other enum layout changes might be possible in the future if we add a mechanism to version the layouts.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects ABI Flag: Affects ABI task
Projects
None yet
Development

No branches or pull requests

2 participants