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