<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 3:47 PM, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> writes:<br>
<br>
> From: Connor Abbott <<a href="mailto:connor.abbott@intel.com">connor.abbott@intel.com</a>><br>
><br>
> These include functions for adding and removing various bits of IR and<br>
> helpers for iterating over all the sources and destinations of an<br>
> instruction. This is similar to ir.cpp.<br>
<br>
</span><span class="">> +nir_function_overload *<br>
> +nir_function_overload_create(nir_function *func)<br>
> +{<br>
> +   void *mem_ctx = ralloc_parent(func);<br>
> +<br>
> +   nir_function_overload *overload = ralloc(mem_ctx, nir_function_overload);<br>
> +<br>
> +   overload->num_params = 0;<br>
> +   overload->params = NULL;<br>
> +   overload->return_type = glsl_void_type();<br>
> +<br>
> +   exec_list_push_tail(&func->overload_list, &overload->node);<br>
> +   overload->function = func;<br>
> +<br>
> +   return overload;<br>
> +}<br>
<br>
</span>Looks like overload->impl is left undefined.<br>
<span class=""><br>
> +nir_tex_instr *<br>
> +nir_tex_instr_create(void *mem_ctx, unsigned num_srcs)<br>
> +{<br>
> +   nir_tex_instr *instr = ralloc(mem_ctx, nir_tex_instr);<br>
> +   instr_init(&instr->instr, nir_instr_type_texture);<br>
> +<br>
> +   instr->num_srcs = num_srcs;<br>
> +   for (unsigned i = 0; i < num_srcs; i++)<br>
> +      src_init(&instr->src[i]);<br>
<br>
</span>Having to compute the num_srcs up front kind of sucked.  It seems<br>
important for the ALU ops, but if we're not mallocing less memory based<br>
on num_srcs, it would be nice to avoid.  Not necessary to change in the<br>
review process, though.<br>
<br>
Also, missing this line that other instruction allocators have:<br>
   dest_init(&instr->dest);<br>
<br>
<br>
I didn't review the details of CFG manipulation, but other than these<br>
little comments the rest is:<br></blockquote><div><br></div><div>I wouldn't worry too much about the CFG stuff.  Connor was careful when he wrote it and I've done quite a bit of digging there and have convinced myself that it's sane.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Reviewed-by: Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>><br>
</blockquote></div></div></div>