[PATCH] D87674: [AMDGPU] Insert waitcnt after returning from call

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 10:02:25 PDT 2020


nhaehnle added a comment.

In D87674#2290434 <https://reviews.llvm.org/D87674#2290434>, @madhur13490 wrote:

> In D87674#2290419 <https://reviews.llvm.org/D87674#2290419>, @arsenm wrote:
>
>> In D87674#2290418 <https://reviews.llvm.org/D87674#2290418>, @madhur13490 wrote:
>>
>>> In D87674#2290396 <https://reviews.llvm.org/D87674#2290396>, @mareko wrote:
>>>
>>>> Yes, this commit is incorrect. It completely breaks code linking in Mesa OpenGL. s_waitcnt is required at the end of all global functions that return values.
>>>>
>>>> Please revert. @nhaehnle
>>>
>>> I don't understand why would it fail. This patch just moves s_waitcnt to the caller so they would be executed anyway. I think I am missing something. It would be helpful to root cause if we can isolate to a small test case.
>>
>> Shader returns aren't real returns and the "caller" doesn't wait
>
> I see. So how should this be implemented? May be we conditionalize this patch just for compute?

How waitcnt are handled is a function of the calling convention, so that's what should be tested for here. Calls to and returns from functions with a default calling convention can be handled in the new way, while other cases need to be left unchanged for now. The mistake was to believe that this could be delayed for later as a "fixme".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87674



More information about the llvm-commits mailing list