[polly] r244606 - Revise the simplification of regions

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 01:07:02 PDT 2015


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.

Best,
Tobias



More information about the llvm-commits mailing list