Skip to content

Let the stride of a type be at least one and remove the strideof_nonzero builtin #4774

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

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

eeckstein
Copy link
Contributor

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

…types like the empty tuple.

This affects the computed stride for fixed-sized types in IRGen as well as the stored stride in value witness tables.
The reason is to let comparisons and difference operations work for pointers to zero-sized types.
(Currently this is achieved by using Builtin.strideof_nonzero in MemoryLayout.stride, but this requires a std::max(1, stride) operation after loading the stride)
Because now the stride of all types is at least one, anyway.
@eeckstein
Copy link
Contributor Author

@swift-ci Please test

@eeckstein eeckstein merged commit fa86118 into swiftlang:master Sep 14, 2016
@jrose-apple
Copy link
Contributor

This is causing failures for me in a non-clean build in Reflection/typeref_lowering.swift. Is there a missing dependency somewhere, maybe? (cc @bitjammer)

@eeckstein eeckstein deleted the stride-1 branch April 17, 2021 15:00
kateinoigakukun added a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants