OpenCilk / opencilk-project

Monorepo for the OpenCilk compiler. Forked from llvm/llvm-project and based on Tapir/LLVM.
Other
89 stars 29 forks source link

[AArch64] Fix codegen of AArch64 thread pointer lookup in Cilk functions #204

Closed neboat closed 10 months ago

neboat commented 11 months ago

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.