[Mesa-dev] [PATCH 2/3] nir: add conditional discard optimisation

Eric Anholt eric at anholt.net
Wed Nov 2 15:44:11 UTC 2016


Dave Airlie <airlied at gmail.com> writes:

> From: Dave Airlie <airlied at redhat.com>
>
> This is ported from GLSL and converts
>
> if (cond)
> 	discard;
>
> into
> discard_if(cond);
>
> This removes a block, but also is needed by radv
> to workaround a bug in the LLVM backend.

I think this is missing "also make sure that after our if statement,
phis aren't using our then/else blocks to effectively do conditional
selects based on the if condition." (which I ran into when trying to
remove "dead" control flow)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161102/5e82b6a0/attachment.sig>


More information about the mesa-dev mailing list