I believe the origin issue in PR31864 has been addressed by https://reviews.llvm.org/D59566.
As discussed in https://github.com/llvm/llvm-project/issues/53840, ATOMIC_LLONG_LOCK_FREE == 2 sometimes is not consistent with std::atomic<long long>::is_always_lock_free, since the macro takes long long's ABI alignment into account. https://reviews.llvm.org/D28213 proposed we should not rely on ABI alignment of types, thus we have consistent ATOMIC_LLONG_LOCK_FREE and std::atomic<long long>::is_always_lock_free on x86's old cpu. Currently, I plan to move on to remove the workaround which should have been addressed and don't want to break current tests.
We shouldn't need to check __atomic_always_lock_free at all, we're only trying to test std::atomic<T>::is_always_lock_free.