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] Fix codegen of AArch64 thread pointer lookup in Cilk functions #204

Merged
merged 3 commits into from
Oct 22, 2023

Conversation

neboat
Copy link
Collaborator

@neboat neboat commented Oct 9, 2023

This change fixes a miscompilation of TLS accesses on non-macOS AArch64 systems, in which lookups of the thread pointer would be optimized across function calls where the executing thread might change across the call.

This change implements a conservative fix for this problem by marking that the thread-pointer lookup may have unmodeled side effects. As a result, this change may prevent some otherwise legal optimizations of the thread-pointer lookup. We can readdress this issue in the future if an attribute becomes available to model the effects of thread-pointer lookups more precisely.

@neboat neboat force-pushed the dev/16.x-aarch64-threadpointer branch from 32d3a6a to 09f245d Compare October 21, 2023 00:32
…e effects to prevent misoptimization in programs where the executing thread may change across a function call.

In principle, this change could be made more precise to enable some
optimizations of this operation, including removal of redundant reads
when there is no intervening function call.  But it is not clear what
attributes currently exist that could be attached to this operation to
model its behavior more precisely.
…memory, rather than having unmodeled side effects.
@neboat neboat force-pushed the dev/16.x-aarch64-threadpointer branch from 09f245d to db598df Compare October 21, 2023 10:05
@neboat neboat merged commit 6b7565c into OpenCilk:dev/16.x Oct 22, 2023
6 checks passed
@neboat neboat deleted the dev/16.x-aarch64-threadpointer branch January 13, 2024 14:43
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.

1 participant