<p dir="ltr">Two questions: Does it fix the bug? And did you ever figure out what was going on there?</p>
<div class="gmail_quote">On Nov 11, 2014 6:58 AM, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Both patches are Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com" target="_blank">jason.ekstrand@intel.com</a>></p>
<div class="gmail_quote">On Nov 10, 2014 11:37 PM, "Matt Turner" <<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I used these in the SEL peephole, but they require extra tracking and<br>
fix ups. The SEL peephole can pretty easily find the blocks it needs<br>
without these.<br>
---<br>
src/mesa/drivers/dri/i965/brw_cfg.cpp | 15 +--------------<br>
src/mesa/drivers/dri/i965/brw_cfg.h | 8 --------<br>
src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp | 8 --------<br>
3 files changed, 1 insertion(+), 30 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp<br>
index bb49a0a..02149e2 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_cfg.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp<br>
@@ -51,8 +51,7 @@ link(void *mem_ctx, bblock_t *block)<br>
}<br>
<br>
bblock_t::bblock_t(cfg_t *cfg) :<br>
- cfg(cfg), start_ip(0), end_ip(0), num(0),<br>
- if_block(NULL), else_block(NULL)<br>
+ cfg(cfg), start_ip(0), end_ip(0), num(0)<br>
{<br>
instructions.make_empty();<br>
parents.make_empty();<br>
@@ -136,7 +135,6 @@ bblock_t::combine_with(bblock_t *that)<br>
}<br>
<br>
this->end_ip = that->end_ip;<br>
- this->else_block = that->else_block;<br>
this->instructions.append_list(&that->instructions);<br>
<br>
this->cfg->remove_block(that);<br>
@@ -238,17 +236,6 @@ cfg_t::cfg_t(exec_list *instructions)<br>
assert(cur_if->end()->opcode == BRW_OPCODE_IF);<br>
assert(!cur_else || cur_else->end()->opcode == BRW_OPCODE_ELSE);<br>
<br>
- cur_if->if_block = cur_if;<br>
- cur_if->else_block = cur_else;<br>
-<br>
- if (cur_else) {<br>
- cur_else->if_block = cur_if;<br>
- cur_else->else_block = cur_else;<br>
- }<br>
-<br>
- cur->if_block = cur_if;<br>
- cur->else_block = cur_else;<br>
-<br>
/* Pop the stack so we're in the previous if/else/endif */<br>
cur_if = pop_stack(&if_stack);<br>
cur_else = pop_stack(&else_stack);<br>
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h<br>
index 388d29e..48bca9f 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_cfg.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h<br>
@@ -89,14 +89,6 @@ struct bblock_t {<br>
struct exec_list parents;<br>
struct exec_list children;<br>
int num;<br>
-<br>
- /* If the current basic block ends in an IF or ELSE instruction, these will<br>
- * point to the basic blocks containing the other associated instruction.<br>
- *<br>
- * Otherwise they are NULL.<br>
- */<br>
- struct bblock_t *if_block;<br>
- struct bblock_t *else_block;<br>
};<br>
<br>
static inline struct backend_instruction *<br>
diff --git a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
index 4c9d7b9..03f838d 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
+++ b/src/mesa/drivers/dri/i965/brw_dead_control_flow.cpp<br>
@@ -85,7 +85,6 @@ dead_control_flow_eliminate(backend_visitor *v)<br>
}<br>
<br>
if (else_inst) {<br>
- else_block->if_block->else_block = NULL;<br>
else_inst->remove(else_block);<br>
}<br>
<br>
@@ -102,13 +101,6 @@ dead_control_flow_eliminate(backend_visitor *v)<br>
if (earlier_block && earlier_block->can_combine_with(later_block)) {<br>
earlier_block->combine_with(later_block);<br>
<br>
- foreach_block (block, v->cfg) {<br>
- if (block->if_block == later_block)<br>
- block->if_block = earlier_block;<br>
- if (block->else_block == later_block)<br>
- block->else_block = earlier_block;<br>
- }<br>
-<br>
/* If ENDIF was in its own block, then we've now deleted it and<br>
* merged the two surrounding blocks, the latter of which the<br>
* __next block pointer was pointing to.<br>
--<br>
2.0.4<br>
<br>
</blockquote></div>
</blockquote></div>