Closed lorentey closed 2 years ago
If necessary, I think we'll be able to work around this by hiding 128-bit atomics behind force-optimized opaque functions.
This is an LLVM regression that's being addressed by https://github.com/llvm/llvm-project/commit/3a00e58c2fca0c20d3792c897ef1ea54b6a168a0.
For the Swift 5.5 toolchain, we can work around this issue by switching to loading double-wide atomics using compare-exchange in debug builds on arm64.
The llvm version in the latest builds of Swift 5.5 generates broken code for double-wide atomic loads on arm64 when compiled without optimizations, indefinitely pegging the CPU at 100% the first time such an operation is executed.
Information
Checklist
main
branch of this package.Steps to Reproduce
Run the tests on an arm64 machine with optimizations disabled.
Expected behavior
The tests finish successfully.
Actual behavior
The issue boils down to bad codegen:
Note the extra
str
to stack in the middle of the ldaxp/stlxp transaction; IIUC, this makes stlxp fail unconditionally.