summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_conditional_discard.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: add conditional discard optimisation (v4)Dave Airlie2016-11-091-0/+125
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. v2: handle if (a) discard_if(b) (nha) cleanup and drop pointless loop (Matt) make sure there are no dependent phis (Eric) v3: make sure only one instruction in the then block. v4: remove sneaky tabs, add cursor init (Eric) Reviewed-by: Eric Anholt <eric@anholt.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit b16dff2d88302e5113598a818d2f92f8af02cd79)