<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 17, 2014 at 4:52 PM, Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think we're missing a few things:<br>
<br>
* Phi node sources<br></blockquote><div><br></div><div>Added<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Parallel copy entries<br></blockquote><div><br></div><div>I don't think we're validating anything for parallel copies right now. It would be nice to, but there's no real good way to do so since they always get created and destroyed inside of the out-of-SSA pass. We do support printing them, but that's really only for debugging out-of-SSA and getting it to happen requires hacking up the out-of-SSA pass.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Whether you care enough to validate those is up to you. Otherwise<br>
<br>
Reviewed-by: Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>><br>
<div><div class="h5"><br>
<br>
On Tue, Dec 16, 2014 at 1:05 AM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> ---<br>
> src/glsl/nir/nir_validate.c | 13 +++++++++++++<br>
> 1 file changed, 13 insertions(+)<br>
><br>
> diff --git a/src/glsl/nir/nir_validate.c b/src/glsl/nir/nir_validate.c<br>
> index 200c85a..ae8deb8 100644<br>
> --- a/src/glsl/nir/nir_validate.c<br>
> +++ b/src/glsl/nir/nir_validate.c<br>
> @@ -452,6 +452,7 @@ validate_phi_src(nir_phi_instr *instr, nir_block *pred, validate_state *state)<br>
> {<br>
> state->instr = &instr->instr;<br>
><br>
> + exec_list_validate(&instr->srcs);<br>
> foreach_list_typed(nir_phi_src, src, node, &instr->srcs) {<br>
> if (src->pred == pred) {<br>
> validate_src(&src->src, state);<br>
> @@ -482,6 +483,7 @@ validate_block(nir_block *block, validate_state *state)<br>
><br>
> state->block = block;<br>
><br>
> + exec_list_validate(&block->instr_list);<br>
> nir_foreach_instr(block, instr) {<br>
> if (instr->type == nir_instr_type_phi) {<br>
> assert(instr == nir_block_first_instr(block) ||<br>
> @@ -548,10 +550,12 @@ validate_if(nir_if *if_stmt, validate_state *state)<br>
> nir_cf_node *old_parent = state->parent_node;<br>
> state->parent_node = &if_stmt->cf_node;<br>
><br>
> + exec_list_validate(&if_stmt->then_list);<br>
> foreach_list_typed(nir_cf_node, cf_node, node, &if_stmt->then_list) {<br>
> validate_cf_node(cf_node, state);<br>
> }<br>
><br>
> + exec_list_validate(&if_stmt->else_list);<br>
> foreach_list_typed(nir_cf_node, cf_node, node, &if_stmt->else_list) {<br>
> validate_cf_node(cf_node, state);<br>
> }<br>
> @@ -579,6 +583,7 @@ validate_loop(nir_loop *loop, validate_state *state)<br>
> nir_cf_node *old_parent = state->parent_node;<br>
> state->parent_node = &loop->cf_node;<br>
><br>
> + exec_list_validate(&loop->body);<br>
> foreach_list_typed(nir_cf_node, cf_node, node, &loop->body) {<br>
> validate_cf_node(cf_node, state);<br>
> }<br>
> @@ -705,14 +710,17 @@ validate_function_impl(nir_function_impl *impl, validate_state *state)<br>
> state->impl = impl;<br>
> state->parent_node = &impl->cf_node;<br>
><br>
> + exec_list_validate(&impl->locals);<br>
> foreach_list_typed(nir_variable, var, node, &impl->locals) {<br>
> validate_var_decl(var, false, state);<br>
> }<br>
><br>
> + exec_list_validate(&impl->registers);<br>
> foreach_list_typed(nir_register, reg, node, &impl->registers) {<br>
> prevalidate_reg_decl(reg, false, state);<br>
> }<br>
><br>
> + exec_list_validate(&impl->body);<br>
> foreach_list_typed(nir_cf_node, node, node, &impl->body) {<br>
> validate_cf_node(node, state);<br>
> }<br>
> @@ -733,6 +741,7 @@ validate_function_overload(nir_function_overload *overload,<br>
> static void<br>
> validate_function(nir_function *func, validate_state *state)<br>
> {<br>
> + exec_list_validate(&func->overload_list);<br>
> foreach_list_typed(nir_function_overload, overload, node, &func->overload_list) {<br>
> assert(overload->function == func);<br>
> validate_function_overload(overload, state);<br>
> @@ -774,18 +783,22 @@ nir_validate_shader(nir_shader *shader)<br>
> validate_var_decl((nir_variable *) entry->data, true, &state);<br>
> }<br>
><br>
> + exec_list_validate(&shader->globals);<br>
> foreach_list_typed(nir_variable, var, node, &shader->globals) {<br>
> validate_var_decl(var, true, &state);<br>
> }<br>
><br>
> + exec_list_validate(&shader->system_values);<br>
> foreach_list_typed(nir_variable, var, node, &shader->system_values) {<br>
> validate_var_decl(var, true, &state);<br>
> }<br>
><br>
> + exec_list_validate(&shader->registers);<br>
> foreach_list_typed(nir_register, reg, node, &shader->registers) {<br>
> prevalidate_reg_decl(reg, true, &state);<br>
> }<br>
><br>
> + exec_list_validate(&shader->functions);<br>
> foreach_list_typed(nir_function, func, node, &shader->functions) {<br>
> validate_function(func, &state);<br>
> }<br>
> --<br>
> 2.2.0<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div></div>