On 23 March 2012 14:16, Jose Fonseca <span dir="ltr"><<a href="mailto:jfonseca@vmware.com">jfonseca@vmware.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">----- Original Message -----<br>
> On 03/23/2012 03:49 AM, Kenneth Graunke wrote:<br>
> > On 03/23/2012 12:03 AM, Jose Fonseca wrote:<br>
> > [snip]<br>
> >>> Ian,<br>
> >>><br>
> >>> The loop analysis code currently doesn't take calls into account<br>
> >>> whatsoever, which is clearly wrong. Any ideas on the best way to<br>
> >>> fix<br>
> >>> it?<br>
> >><br>
> >> I think that, before a loop is unrolled, any inner calls should be<br>
> >> inlined. I don't any correctness/performance reason to do any<br>
> >> differently.<br>
> >><br>
> >> Jose<br>
> ><br>
> > Yeah, I think "don't unroll if there are function calls" is the<br>
> > right<br>
> > answer. Inlining first would make unrolling happen in most cases.<br>
> > We can<br>
> > always improve on that later.<br>
><br>
> I don't think we have to go that far. I think:<br>
><br>
> 1. Mark any out or inout parameter as being assigned (in the loop).<br>
> 2. Mark any globals as being assigned.<br>
><br>
> That should put a bandaid on it.<br>
<br>
</div>Sounds a perfectly good bandaid.<br>
<br>
But I guess I still don't understand why we'd ever want to unroll a loop that contain function calls. If the call is not worth to inline, then what's the point of unrolling the loop?<br></blockquote><div><br>
Yeah, I agree. In any case, it's a moot point for now because Mesa currently inlines everything no matter what.<br><br>As for the bandaid, is there a benefit of doing it rather than the "proper fix" of disabling loop unrolling for loops containing function calls? In this case the proper fix seems easier, so I'm not sure why we're considering a bandaid.<br>
</div></div>