<div dir="ltr">Hi,<div><br></div><div>@Johannes</div><div>Thanks for pointing out the issue and explanation.</div><div><br></div><div>@Tobias</div><div>I'll try to implement your suggested algorithm over the weekend. </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 28, 2015 at 5:52 PM, Johannes Doerfert <span dir="ltr"><<a href="mailto:doerfert@cs.uni-saarland.de" target="_blank">doerfert@cs.uni-saarland.de</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">On 08/28, Tobias Grosser wrote:<br>
> On 08/28/2015 02:15 PM, Johannes Doerfert wrote:<br>
> >On 08/28, Tobias Grosser wrote:<br>
> >>>>What about the following:<br>
> >>>><br>
> >>>>Algorithm:<br>
> >>>><br>
> >>>>   loopNum = 0;<br>
> >>>><br>
> >>>>   entryNodeLoop = LI->getLoopFor(R->getEntry)<br>
> >>>><br>
> >>>>   if loop in R<br>
> >>>>     children = loop->getParent()->children<br>
> >>>>   else if loop not in R:<br>
> >>>>     children = loop->children<br>
> >>>>   else // no loop at all<br>
> >>>>     children = LI->getoutermostloops<br>
> >>>><br>
> >>>>   for child in children<br>
> >>>>     if (R->contains(child)) {<br>
> >>>>       loopNum++;<br>
> >>>>       if (child->subloops > 0)<br>
> >>>>         loopNum++;<br>
> >>>><br>
> >>>>       if (loopNum >= 2)<br>
> >>>>         return true;<br>
> >>>>     }<br>
> >>>>   return false;<br>
> >>><br>
> >>>I am not convinced that the loops we see and count should be in any kind<br>
> >>>related to the entry block of the region. What about code like this:<br>
> >>><br>
> >>>   if (...)<br>
> >>>     LoopNest<br>
> >>><br>
> >>>can't that be a region? Even if not, I think there is some kind of code<br>
> >>>with many loops but none of them contains the entry block. Do you<br>
> >>>disagree?<br>
> >><br>
> >>That will be the second or the third case of the code above. The second in<br>
> >>case the scop is part of a larger loop and the third case if no loop surrounds<br>
> >>the scop.<br>
> >OK, got it now.<br>
> ><br>
> >Some special handling if entryNodeLoop is a toplevel loop but other than<br>
> >that it should work.<br>
><br>
> Why does the toplevel loop require special treatment? Only if there is no<br>
> surrounding loop aka. entryNodeLoop is nullptr the special handling as<br>
> visible in the else seems needed.<br>
</div></div>if loop->getParent() is null in the first case we have to do the same as<br>
for the last one.<br>
<span class="im HOEnZb"><br>
--<br>
<br>
Johannes Doerfert<br>
Researcher / PhD Student<br>
<br>
Compiler Design Lab (Prof. Hack)<br>
Saarland University, Computer Science<br>
Building E1.3, Room 4.31<br>
<br>
Tel. +49 (0)681 302-57521 : <a href="mailto:doerfert@cs.uni-saarland.de">doerfert@cs.uni-saarland.de</a><br>
Fax. +49 (0)681 302-3065  : <a href="http://www.cdl.uni-saarland.de/people/doerfert" rel="noreferrer" target="_blank">http://www.cdl.uni-saarland.de/people/doerfert</a><br>
<br>
</span><div class="HOEnZb"><div class="h5">--<br>
You received this message because you are subscribed to the Google Groups "Polly Development" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:polly-dev%2Bunsubscribe@googlegroups.com">polly-dev+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/d/optout" rel="noreferrer" target="_blank">https://groups.google.com/d/optout</a>.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:small"><span style="color:rgb(84,141,212);font-family:arial,helvetica,sans-serif">Regards</span><br></div><div style="font-size:small"><div><div dir="ltr"><font color="#000000 " size="2" face="arial, helvetica, sans-serif"><div><font color="#548dd4">Pratik Bhatu<br></font><div><font color="#548dd4">Bachelors of Technology, 4th Year</font></div><div><font color="#548dd4">Computer Science and Engineering</font></div><div><font color="#548dd4">IIT Hyderabad</font></div><div><font color="#548dd4">+91 961 905 6833</font></div></div></font></div></div></div></div></div></div></div>
</div>