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

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 05:22:34 PDT 2015


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150828/649d5b1a/attachment.sig>


More information about the llvm-commits mailing list