<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 2:01 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"><div class="HOEnZb"><div class="h5">Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> writes:<br>
<br>
> On Mon, Jan 26, 2015 at 3:58 PM, 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>
>><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>
>> >> > +      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<br>
>> 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<br>
>> pleas<br>
>> > be a little more specific.<br>
>><br>
>> 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>
>><br>
><br>
> But I'm casting a bool to void *...<br>
<br>
</div></div>So the same thing: to go from something-that's-not-a-long, you cast<br>
through uintptr_t first.<br>
</blockquote></div><br></div><div class="gmail_extra">Yup, figured.  All that should be fixed in the v3 I just sent.  (It's accidentally named v2)<br></div><div class="gmail_extra">--Jason<br></div></div>