summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-11-02 01:22:07 +0000
committerDave Airlie <[email protected]>2016-11-10 05:46:33 +1000
commitb16dff2d88302e5113598a818d2f92f8af02cd79 (patch)
treece7db783f52eb317f4a7ffea690e51c4a6c31a1c /src/compiler/nir/nir.h
parentdd77faeca2819fc78a72f71ca9b996c209378cde (diff)
nir: add conditional discard optimisation (v4)
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 <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r--src/compiler/nir/nir.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 92647632462..2a7713934bc 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -2531,6 +2531,8 @@ bool nir_opt_remove_phis(nir_shader *shader);
bool nir_opt_undef(nir_shader *shader);
+bool nir_opt_conditional_discard(nir_shader *shader);
+
void nir_sweep(nir_shader *shader);
nir_intrinsic_op nir_intrinsic_from_system_value(gl_system_value val);