diff options
author | Ian Romanick <[email protected]> | 2016-02-24 19:29:57 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2016-02-26 16:51:27 -0800 |
commit | 2513a20240e77a9a0a453d9789c64a656852c929 (patch) | |
tree | 9f81b42d9dab572fb441d37e1570fbcbe2b17a58 | |
parent | 69bb063ec22453cdf1b7b363b1c7db47697b586f (diff) |
i965/cfg: Don't handle fully empty if/else/endif
This will now never occur. The empty if-else part would have already
been removed leaving an empty if-endif part.
No shader-db changes.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp index b42e6a3a5ce..856357239a4 100644 --- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp +++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp @@ -33,8 +33,7 @@ * * - if/endif * . else in else/endif - * - if/else/endif - * - else in if/else + * - then in if/else/endif */ bool dead_control_flow_eliminate(backend_shader *s) @@ -44,7 +43,7 @@ dead_control_flow_eliminate(backend_shader *s) foreach_block_safe (block, s->cfg) { bblock_t *prev_block = block->prev(); backend_instruction *const inst = block->start(); - backend_instruction *prev_inst = prev_block->end(); + backend_instruction *const prev_inst = prev_block->end(); /* ENDIF instructions, by definition, can only be found at the start of * basic blocks. @@ -60,19 +59,14 @@ dead_control_flow_eliminate(backend_shader *s) else_block = endif_block->prev(); found = true; - if (else_block->start_ip == else_block->end_ip) { - prev_block = prev_block->prev(); - prev_inst = prev_block->end(); - } + /* Don't remove the ENDIF if we didn't find a dead IF. */ + endif_inst = NULL; } if (prev_inst->opcode == BRW_OPCODE_IF) { if_inst = prev_inst; if_block = prev_block; found = true; - } else { - /* Don't remove the ENDIF if we didn't find a dead IF. */ - endif_inst = NULL; } if (found) { |