https://github.com/SchrodingerZhu approved this pull request. The approach is fine to me. Just notice that, sometimes inline atomics are not used because the compiler is permissive about target features. https://github.com/llvm/llvm-project/pull/96791