Apply the same logic used to check if CMPXCHG nodes should be expanded at -O0: the register allocator may end up spilling some register in between the atomic load/store pairs, breaking the atomicity and possibly stalling the execution.
Fixes PR48017
"implement cmpxchg" doesn't seem right; should be "implement atomicrmw"? (Also "address being exchanged".)