summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-09-02 21:34:12 -0700
committerKenneth Graunke <kenneth@whitecape.org>2014-09-05 09:52:29 -0700
commit88d673bde685b07cf68829f54c5d5d4e28ba7c4e (patch)
treea57aae0a22eb33ef518d3edc6e044535dcde7b8b /src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
parent3e248e0418370373ac5bcee4b0a88b501b5b22a9 (diff)
downloadexternal_mesa3d-88d673bde685b07cf68829f54c5d5d4e28ba7c4e.zip
external_mesa3d-88d673bde685b07cf68829f54c5d5d4e28ba7c4e.tar.gz
external_mesa3d-88d673bde685b07cf68829f54c5d5d4e28ba7c4e.tar.bz2
i965: Update if_block/else_block in the dead control flow pass.
I think this bug crept in only recently. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
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.cpp7
1 files changed, 7 insertions, 0 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 56884e6..7a302da 100644
--- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
+++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp
@@ -103,6 +103,13 @@ dead_control_flow_eliminate(backend_visitor *v)
if (earlier_block && earlier_block->can_combine_with(later_block)) {
earlier_block->combine_with(later_block);
+ foreach_block (block, v->cfg) {
+ if (block->if_block == later_block)
+ block->if_block = earlier_block;
+ if (block->else_block == later_block)
+ block->else_block = earlier_block;
+ }
+
/* If ENDIF was in its own block, then we've now deleted it and
* merged the two surrounding blocks, the latter of which the
* __next block pointer was pointing to.