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

aarch64: Implement TLSDESC for TLS GD accesses #7201

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

afonso360
Copy link
Contributor

👋 Hey,

This PR replaces the current TLS GD sequence with Thead-Local Storage Descriptors (TLSDESC). TLSDESC is a improved TLS GD model that switches to a custom calling convention that preserves most registers, preventing clobbering and restoring around the regular __tls_get_addr call.

Furthermore, TLSDESC supports a number of relaxations that actually avoid the function call entirely in some situations. These relaxations are not allowed to change the code sequence size, so there is no danger of changing the label offsets after being resolved by cranelift.

I've tested this with cg_clif's testsuite. Using both lld and the gnu linker.

Closes: #6778

@afonso360 afonso360 added the cranelift:area:aarch64 Issues related to AArch64 backend. label Oct 9, 2023
@afonso360 afonso360 requested a review from a team as a code owner October 9, 2023 21:42
@afonso360 afonso360 requested review from fitzgen and removed request for a team October 9, 2023 21:42
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:module labels Oct 9, 2023
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

👍

@alexcrichton alexcrichton added this pull request to the merge queue Oct 10, 2023
Merged via the queue into bytecodealliance:main with commit ccaf2bf Oct 10, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:module cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cranelift: cranelift-object produces AArch64 object files not supported by lld
2 participants