[PATCH] D96980: [amdgpu] Revert agnostic SGPR spill.

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 07:11:03 PST 2021


ruiling added a comment.

In D96980#2587370 <https://reviews.llvm.org/D96980#2587370>, @critson wrote:

> Unfortunately I realized and have verified at least one problem with this and WQM.
> With WQM the assumption that the EXEC mask for restore of the SGPR is a subset of the spill EXEC mask is not true.
> Specifically an SGPR can be saved before entering WQM, then restored in WQM (so the readfirstlane will return junk).

Yes, that sounds a serious problem. But the issue may not be only specific to this scenario. We sometimes have to broadcast uniform value into VGPR because we only have the V_xxx instruction instead of S_xxx instruction, and later we may use v_readfirstlane to read the value back into SGPR for later scalar operations. If one operation happens before WQM while another in WQM, things may also be wrong. I am not quite sure whether this would happen in real-world case. But sounds possible to me.

> This could potentially be addressed by ensuring the exec mask mode matches between spills and restores in the WQM pass.
> (I can add this to WQM pass if needed, but will think a bit more on it first.)
>
> Note: this issue is not necessarily an immediate problem for graphics, because we try to avoid all spills (particular SGPR spills to memory).

I want to say that the issue this patch tries to solve is a blocking issue for us. That's why @sebastian-ne is also actively working to solve it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96980



More information about the llvm-commits mailing list