i965/cfg: Slightly rearrange dead_control_flow_eliminate

'git diff -w' is a bit more illustrative.  A couple declarations were
moved, the continue was removed, and the code was reindented.  This will
simplify future changes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
Ian Romanick
2016-02-24 18:52:05 -08:00
parent a0294c2cf3
commit 70cf0eb5c7

View File

@@ -41,15 +41,15 @@ dead_control_flow_eliminate(backend_shader *s)
bool progress = false; bool progress = false;
foreach_block_safe (block, s->cfg) { foreach_block_safe (block, s->cfg) {
bblock_t *if_block = NULL, *else_block = NULL, *endif_block = block; backend_instruction *const inst = block->start();
bool found = false;
/* ENDIF instructions, by definition, can only be found at the start of /* ENDIF instructions, by definition, can only be found at the start of
* basic blocks. * basic blocks.
*/ */
backend_instruction *endif_inst = endif_block->start(); if (inst->opcode == BRW_OPCODE_ENDIF) {
if (endif_inst->opcode != BRW_OPCODE_ENDIF) bool found = false;
continue; bblock_t *if_block = NULL, *else_block = NULL, *endif_block = block;
backend_instruction *endif_inst = inst;
backend_instruction *if_inst = NULL, *else_inst = NULL; backend_instruction *if_inst = NULL, *else_inst = NULL;
backend_instruction *prev_inst = endif_block->prev()->end(); backend_instruction *prev_inst = endif_block->prev()->end();
@@ -113,6 +113,7 @@ dead_control_flow_eliminate(backend_shader *s)
progress = true; progress = true;
} }
} }
}
if (progress) if (progress)
s->invalidate_live_intervals(); s->invalidate_live_intervals();