https://github.com/arsenm approved this pull request. The generic bits lgtm. The systemZ handling is a hack, and we'd still be better off getting rid of ATOMIC_LOAD and following how GlobalISel does this https://github.com/llvm/llvm-project/pull/75879