[Mesa-dev] [PATCH 1/2] nir: Add a nop intrinsic

Kenneth Graunke kenneth at whitecape.org
Mon Oct 3 23:12:13 UTC 2016


On Thursday, September 15, 2016 9:16:04 PM PDT Jason Ekstrand wrote:
> This intrinsic has no destination, no sources, no variables, and can be
> eliminated.  In other words, it does nothing and will always get deleted by
> dead code elimination.  However, it does provide a quick-and-easy way to
> temporarily tag a particular location in a NIR shader.
> 
> Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/compiler/nir/nir_intrinsics.h | 3 +++
>  1 file changed, 3 insertions(+)

These two are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

I understand that Connor may not be a fan of this code, but it's been
several weeks and we don't have a better proposal.  We need to unblock
RADV.

I agree with Connor that we shouldn't be relying on the details of how
the NIR control flow decides to split/join blocks...and inserting or
removing a control flow node does tend to split/join blocks all over
the place, making some set of your block pointers invalid.

I like the approach of adding a nop instruction to hold the current
position.  The nop will end up somewhere, and you can just resume from
wherever it is, and you don't have to assume anything about how NIR
decided to split/join blocks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161003/bd8b9f20/attachment.sig>


More information about the mesa-dev mailing list