diff options
author | Eric Anholt <[email protected]> | 2016-07-27 17:26:59 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-08-03 10:25:08 -0700 |
commit | 9128acfb5781c43abd3ffe3ef74ee1d32138f6bc (patch) | |
tree | ff5020804fbb030f17cba1045acaac862567200a | |
parent | 36b9eb82c1077af4e30182e13e77e6890ad30105 (diff) |
nir: Allow opt_peephole_select to work on empty blocks.
nir_opt_peephole_select has the job of removing IF statements with no side
effects. However, if the IF statement's successor didn't have any
instructions in it, we were skipping it, which occurred in mupen64 on vc4
with glsl_to_nir enabled:
instructions in affected programs: 6134 -> 4120 (-32.83%)
total uniforms in shared programs: 38268 -> 38219 (-0.13%)
No changes on Haswell shader-db.
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/compiler/nir/nir_opt_peephole_select.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/compiler/nir/nir_opt_peephole_select.c b/src/compiler/nir/nir_opt_peephole_select.c index 7fcc71ea9d7..633e9f486c0 100644 --- a/src/compiler/nir/nir_opt_peephole_select.c +++ b/src/compiler/nir/nir_opt_peephole_select.c @@ -127,13 +127,6 @@ block_check_for_allowed_instrs(nir_block *block) static bool nir_opt_peephole_select_block(nir_block *block, void *mem_ctx) { - /* If the block is empty, then it certainly doesn't have any phi nodes, - * so we can skip it. This also ensures that we do an early skip on the - * end block of the function which isn't actually attached to the CFG. - */ - if (exec_list_is_empty(&block->instr_list)) - return false; - if (nir_cf_node_is_first(&block->cf_node)) return false; |