<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 3:58 PM, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><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>
> On Mon, Jan 26, 2015 at 11:21 AM, Eric Anholt <<a href="mailto:eric@anholt.net">eric@anholt.net</a>> wrote:<br>
><br>
>> Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> writes:<br>
</span><span class="">>> > + case nir_instr_type_phi: {<br>
>> > + nir_phi_instr *src_phi = nir_instr_as_phi(src_instr);<br>
>> > +<br>
>> > + /* Insert an entry and mark it as scalarizable for now. That<br>
>> way<br>
>> > + * we don't recurse forever and a cycle in the depencence graph<br>
>> > + * won't automatically make us fail to scalarize.<br>
>> > + */<br>
>> > + entry = _mesa_hash_table_insert(state->phi_table, src_phi,<br>
>> (void *)1);<br>
>><br>
>> I expect "(void *)1" will give compiler warnings generally. "(void<br>
>> *)(uintptr_t)1" is the usual workaround.<br>
>><br>
>> Useful comment, though!<br>
>><br>
>> > + bool scalarizable = should_lower_phi(src_phi, state);<br>
>> > + entry->data = (void *)scalarizable;<br>
>><br>
>> No need to cast to void *, since not C++.<br>
>><br>
><br>
> I'm confused. You want more casting above but less here? Could you pleas<br>
> be a little more specific.<br>
<br>
</span>Yes, you have to add the cast above to avoid a compiler warning about<br>
casting from a small int to a pointer, while casting to void * to assign<br>
to a void * is only a c++ism<br>
</blockquote></div><br></div><div class="gmail_extra">But I'm casting a bool to void *...<br></div></div>