[PATCH] D76881: [AMDGPU] Skip CFIInstructions in SIInsertWaitcnts

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 11:28:36 PDT 2020


scott.linder added a comment.

In D76881#1946539 <https://reviews.llvm.org/D76881#1946539>, @arsenm wrote:

> In D76881#1946435 <https://reviews.llvm.org/D76881#1946435>, @scott.linder wrote:
>
> > Right, but the placement of the meta instructions here can't affect change codegen, can it? Also, if we do need to skip the DEBUG_VALUEs it may also be that we would need to either update or drop them to avoid producing incorrect debug info. I'm not actually certain this is an issue though, but the situation I have in mind is if we pass an argument by-ref or on the stack, and in the callee we claim the value is in memory when the appropriate counts haven't been waited on yet.
>
>
> Doesn't the placement of CFI matter relative to the real instructions?


Yes, and same for DEBUG_VALUE, which is where my uncertainty comes up. For CFI we absolutely need the directives at the beginning of the block to precede any real instructions, because they apply "on entry". For example, we reference the ABI return address registers here, and we can't have these be defined incorrectly until after the initial s_waitcnt. Conversely for DEBUG_VALUEs it may be that we are constructing them assuming they can reference memory locations for arguments that are only valid after the initial s_waitcnt. So I think we need to handle the two cases distinctly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76881





More information about the llvm-commits mailing list