<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 21, 2018 at 1:03 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thursday, May 31, 2018 10:06:47 PM PDT Jason Ekstrand wrote:<br>
[snip]<br>
<span class="">> @@ -529,57 +509,55 @@ static bool<br>
> load_from_deref_entry_value(<wbr>struct copy_prop_var_state *state,<br>
> struct copy_entry *entry,<br>
> nir_builder *b, nir_intrinsic_instr *intrin,<br>
> - nir_deref_var *src, struct value *value)<br>
> + nir_deref_instr *src, struct value *value)<br>
> {<br>
> *value = entry->src;<br>
> <br>
> - /* Walk the deref to get the two tails and also figure out if we need to<br>
> - * specialize any wildcards.<br>
> - */<br>
> - bool need_to_specialize_wildcards = false;<br>
> - nir_deref *entry_tail = &entry->dst->deref;<br>
> - nir_deref *src_tail = &src->deref;<br>
> - while (entry_tail->child && src_tail->child) {<br>
> - assert(src_tail->child->deref_<wbr>type == entry_tail->child->deref_type)<wbr>;<br>
> - if (src_tail->child->deref_type == nir_deref_type_array) {<br>
> - nir_deref_array *entry_arr = nir_deref_as_array(entry_tail-<wbr>>child);<br>
> - nir_deref_array *src_arr = nir_deref_as_array(src_tail-><wbr>child);<br>
> -<br>
<br>
</span>I think there might be a bug here...note this condition...<br>
<span class=""><br>
> - if (src_arr->deref_array_type != nir_deref_array_type_wildcard &&<br>
> - entry_arr->deref_array_type == nir_deref_array_type_wildcard)<br>
<br>
</span>Old: Source NOT wildcard, dest is wildcard.<br>
<span class=""><br>
> - need_to_specialize_wildcards = true;<br>
> - }<br>
> + b->cursor = nir_instr_remove(&intrin-><wbr>instr);<br>
> <br>
> - entry_tail = entry_tail->child;<br>
> - src_tail = src_tail->child;<br>
> + nir_deref_path entry_dst_path, src_path;<br>
> + nir_deref_path_init(&entry_<wbr>dst_path, entry->dst, state->mem_ctx);<br>
> + nir_deref_path_init(&src_path, src, state->mem_ctx);<br>
> +<br>
> + bool need_to_specialize_wildcards = false;<br>
> + nir_deref_instr **entry_p = &entry_dst_path.path[1];<br>
> + nir_deref_instr **src_p = &src_path.path[1];<br>
> + while (*entry_p && *src_p) {<br>
> + nir_deref_instr *entry_tail = *entry_p++;<br>
> + nir_deref_instr *src_tail = *src_p++;<br>
> +<br>
> + if (src_tail->deref_type == nir_deref_type_array &&<br>
> + entry_tail->deref_type == nir_deref_type_array_wildcard)<br>
<br>
</span>New: Source IS wildcard, dest is wildcard. I think you want != on the<br>
source condition to match the old behavior.<br>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't think there's a bug here. With the old mechanism, we had deref_type_array and then within that deref_array_type_direct, _indirect, and _wildcard. In the new scheme, we have deref_type_array and deref_type_array_wildcard. So deref_type == nir_deref_type_array in the new translates to deref_type == nir_deref_type_array && deref_array_type != nir_deref_array_type_wildcard. Does that make sense?<br></div></div>