summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2014-11-05 15:23:05 -0800
committerMatt Turner <[email protected]>2014-11-06 16:37:56 -0800
commit58a54091a96566a7e18c984b4587e0e1d1ee3e9d (patch)
tree31cefef9cb6a9198759d6e450fa5e72fc2ab917c /src
parentf0cfc4fca011b594393b0e39793cb8d8acdcde0e (diff)
i965/fs: Wire up control flow correctly in predicated break pass.
When the earlier block ended with control flow, we'd mistakenly remove some of its links to its children. The same happened with the later block. Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
index b7a1d7e7722..047c2c0b1cf 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_peephole_predicated_break.cpp
@@ -107,10 +107,14 @@ fs_visitor::opt_peephole_predicated_break()
}
endif_inst->remove(endif_block);
- earlier_block->children.make_empty();
- later_block->parents.make_empty();
+ if (!earlier_block->ends_with_control_flow()) {
+ earlier_block->children.make_empty();
+ earlier_block->add_successor(cfg->mem_ctx, jump_block);
+ }
- earlier_block->add_successor(cfg->mem_ctx, jump_block);
+ if (!later_block->starts_with_control_flow()) {
+ later_block->parents.make_empty();
+ }
jump_block->add_successor(cfg->mem_ctx, later_block);
if (earlier_block->can_combine_with(jump_block)) {