[polly] r244606 - Revise the simplification of regions

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 01:10:03 PDT 2015


On 08/12, Tobias Grosser wrote:
> On 08/12/2015 10:02 AM, Michael Kruse wrote:
> >2015-08-12 9:53 GMT+02:00 Tobias Grosser <tobias at grosser.es>:
> >>>2015-08-12 9:19 GMT+02:00 Michael Kruse <llvm at meinersbur.de>:
> >>>However, I prefer your solution number 2). I am not that familiar with
> >>>non-affine regions, but could the contains-check be removed entirely?
> >>
> >>
> >>Are you talking about:
> >>
> >>+    if (!R.contains(OpBB))
> >>+      continue;
> >>
> >>It can be removed, but it does not give us anything. What it ensures is
> >>that we do not create IRAccesses for BasicBlocks outside of the scop's
> >>region, as we ignore them later on anyhow. The important point is that
> >>the following piece of code is executed for the PHI node:
> >>
> >>  if (!OnlyNonAffineSubRegionOperands) {
> >>      IRAccess ScalarAccess(IRAccess::READ, PHI, ZeroOffset, 1, true,
> >>                            /* IsPHI */ true);
> >>      Functions.push_back(std::make_pair(ScalarAccess, PHI));
> >>}
> >>
> >>Which it is as soon as we set OnlyNonAffineSubRegionOperands to false.
> >
> >Never mind. I was thinking about
> >OnlyNonAffineSubRegionOperands/Written being set independent of that
> >contains, but this is already the case.
> >
> >I am still wondering why OnlyNonAffineSubRegionOperands depends on:
> >
> >      if (NonAffineSubRegion && NonAffineSubRegion->contains(OpBB))
> >        continue;
> 
> Maybe Johannes can explain better, but my understanding is that NonAffineSubRegions
> are parts of the SCoP (e.g. loops) that are treated as a black-box. This means,
> that any control flow that remains just within the region does not need to be
> modeled. If you drop this line a couple of test cases will fail. You can have
> a look at these if you are interested.
Correct. Non-affine regions are black boxes we do not schedule, hence
there is no need in modeling anything that is going on __only__ in there
as it will be exactly copied like this into the new and optimized
version. This mainly saves compile (dependence analysis, etc.) time but
also allows to keep the original code structure which we usually destroy
by our phi and scalar demotion during code generation.

-- 

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/20150812/ff72cf5c/attachment.sig>


More information about the llvm-commits mailing list