AMDGPU: Refactor unsafe atomicrmw remark emission (#89379)

Defers some of the setup work until the remark is actually emitted. Move
big lambda into a helper function, and only use value capture of a
pointer. Prepare to have different messages.

GitOrigin-RevId: 90dfabc9e12466ce306b3168f47621598bbf900b
1 file changed