[PATCH] D90809: [amdgpu] Add `llvm.amdgcn.endpgm` support.

Stanislav Mekhanoshin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 14:08:42 PST 2020


rampitec accepted this revision.
rampitec added a comment.
This revision is now accepted and ready to land.

In D90809#2377221 <https://reviews.llvm.org/D90809#2377221>, @hliao wrote:

> In D90809#2377083 <https://reviews.llvm.org/D90809#2377083>, @rampitec wrote:
>
>> In D90809#2376994 <https://reviews.llvm.org/D90809#2376994>, @b-sumner wrote:
>>
>>> Should this also be IntrConvergent?
>>
>> Probably yes... This is control flow after all.
>
> The real effect of this intrinsic seems not changed if it's moved somewhere. For example,
>
> convert this
>
>   if (a || b)
>     endpgm();
>
> to
>
>   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.

It is probably OK to clone it, we shall insert skips around it anyway. LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90809/new/

https://reviews.llvm.org/D90809



More information about the cfe-commits mailing list