- llvm.amdgcn.endpgm is added to enable "abort" support.
The real effect of this intrinsic seems not changed if it's moved somewhere. For example,
if (a || b) endpgm();
if (a) endpgm(); else if (b) endpgm();
no matter a or b are divergent or not, it works the same as the original one as s_endpgm is a scalar instruction. Ofc, if we really doubt bad things may happen, I could add that for safety as we definitely will revise this later.