[polly] r246161 - Do not detect Scops with only one loop.

Bhatu via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 07:11:09 PDT 2015


Hi,

@Johannes
Thanks for pointing out the issue and explanation.

@Tobias
I'll try to implement your suggested algorithm over the weekend.

On Fri, Aug 28, 2015 at 5:52 PM, Johannes Doerfert <
doerfert at cs.uni-saarland.de> wrote:

> On 08/28, Tobias Grosser wrote:
> > On 08/28/2015 02:15 PM, Johannes Doerfert wrote:
> > >On 08/28, Tobias Grosser wrote:
> > >>>>What about the following:
> > >>>>
> > >>>>Algorithm:
> > >>>>
> > >>>>   loopNum = 0;
> > >>>>
> > >>>>   entryNodeLoop = LI->getLoopFor(R->getEntry)
> > >>>>
> > >>>>   if loop in R
> > >>>>     children = loop->getParent()->children
> > >>>>   else if loop not in R:
> > >>>>     children = loop->children
> > >>>>   else // no loop at all
> > >>>>     children = LI->getoutermostloops
> > >>>>
> > >>>>   for child in children
> > >>>>     if (R->contains(child)) {
> > >>>>       loopNum++;
> > >>>>       if (child->subloops > 0)
> > >>>>         loopNum++;
> > >>>>
> > >>>>       if (loopNum >= 2)
> > >>>>         return true;
> > >>>>     }
> > >>>>   return false;
> > >>>
> > >>>I am not convinced that the loops we see and count should be in any
> kind
> > >>>related to the entry block of the region. What about code like this:
> > >>>
> > >>>   if (...)
> > >>>     LoopNest
> > >>>
> > >>>can't that be a region? Even if not, I think there is some kind of
> code
> > >>>with many loops but none of them contains the entry block. Do you
> > >>>disagree?
> > >>
> > >>That will be the second or the third case of the code above. The
> second in
> > >>case the scop is part of a larger loop and the third case if no loop
> surrounds
> > >>the scop.
> > >OK, got it now.
> > >
> > >Some special handling if entryNodeLoop is a toplevel loop but other than
> > >that it should work.
> >
> > Why does the toplevel loop require special treatment? Only if there is no
> > surrounding loop aka. entryNodeLoop is nullptr the special handling as
> > visible in the else seems needed.
> if loop->getParent() is null in the first case we have to do the same as
> for the last one.
>
> --
>
> Johannes Doerfert
> Researcher / PhD Student
>
> Compiler Design Lab (Prof. Hack)
> Saarland University, Computer Science
> Building E1.3, Room 4.31
>
> Tel. +49 (0)681 302-57521 : doerfert at cs.uni-saarland.de
> Fax. +49 (0)681 302-3065  : http://www.cdl.uni-saarland.de/people/doerfert
>
> --
> You received this message because you are subscribed to the Google Groups
> "Polly Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to polly-dev+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
Pratik Bhatu
Bachelors of Technology, 4th Year
Computer Science and Engineering
IIT Hyderabad
+91 961 905 6833
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150828/7ee13816/attachment.html>


More information about the llvm-commits mailing list