aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-09-02 10:08:24 -0700
committerMatt Turner <[email protected]>2014-09-24 09:42:46 -0700
commitf0598d413bc8eb7ab02318f1db2dbd446a3c736c (patch)
treeb1883128adcd6e8a396f6c9a23ea5a6af8902725 /src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
parent7119712f4582b387323ecfaf0227ed070328d9e8 (diff)
i965/fs: Don't iterate between blocks with inst->next/prev.
When instruction lists are per-basic block, this won't work. Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp5
1 files changed, 3 insertions, 2 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 485ab91b4e6..fad1d423cee 100644
--- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
+++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
@@ -52,13 +52,14 @@ dead_control_flow_eliminate(backend_visitor *v)
continue;
backend_instruction *if_inst = NULL, *else_inst = NULL;
- backend_instruction *prev_inst = (backend_instruction *) endif_inst->prev;
+ backend_instruction *prev_inst = ((bblock_t *)endif_block->link.prev)->end;
if (prev_inst->opcode == BRW_OPCODE_ELSE) {
else_inst = prev_inst;
else_block = (bblock_t *)endif_block->link.prev;
found = true;
- prev_inst = (backend_instruction *) prev_inst->prev;
+ if (else_block->start_ip == else_block->end_ip)
+ prev_inst = ((bblock_t *)else_block->link.prev)->end;
}
if (prev_inst->opcode == BRW_OPCODE_IF) {