Skip to content

[5.3] SIL: fix memory behavior of global_addr for globals with non-fixed layout. #31231

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
Apr 23, 2020

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Apr 23, 2020

Global variables with resilient types might be allocated into a buffer and not statically in the data segment.
In this case, the global_addr depends on alloc_global being executed first.
Letting global_addr have a side effect ensures that this dependency is kept.
It prevents e.g. LICM to move a global_addr out of a loop while keeping the alloc_global inside the loop.

This is a cherry-pick of #31205 and #31228

rdar://problem/61602640

eeckstein and others added 2 commits April 23, 2020 10:37
…yout.

Global variables with resilient types might be allocated into a buffer and not statically in the data segment.
In this case, the global_addr depends on alloc_global being executed first.
We model this by letting global_addr have a side effect.
It prevents e.g. LICM to move a global_addr out of a loop while keeping the alloc_global inside the loop.

rdar://problem/61602640
Mark as executable test
@eeckstein eeckstein changed the title Fix global addr 5.3 [5.3] SIL: fix memory behavior of global_addr for globals with non-fixed layout. Apr 23, 2020
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit e8c3927 into swiftlang:release/5.3 Apr 23, 2020
@eeckstein eeckstein deleted the fix-global_addr-5.3 branch April 23, 2020 10:53
@eeckstein eeckstein added the r5.3 label Apr 24, 2020
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants