[polly] r244608 - Assign regions to all BBs from CodeGeneration

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 09:17:50 PDT 2015


On 08/11, Michael Kruse via llvm-commits wrote:
> Author: meinersbur
> 
> In order to have a valid region analysis, we assign all newly created blocks to the parent of the scop's region. This is correct for any pre-existing regions (including the scop's region and its parent), but does not discover any region inside the generated code. For Polly this is not necessary because we do not want to re-run Polly on its own generated code anyway.

> +  // CodeGeneration adds a lot of BBs without updating the RegionInfo
When I read this comment I am asking myself why we do not change this
fact, e.g. use the new SplitBlock function that updates the RI instead
of the old SplitBlock function that does not. I'm not certain but there
are probably only a very limited number of places new blocks are
generated and a linear search after codegen loocks like a bit
overkill...

> +  // We make all created BBs belong to the scop's parent region without any
> +  // nested structure to keep the RegionInfo verifier happy.
> +  void fixRegionInfo(Function *F, Region *ParentRegion) {
> +    for (BasicBlock &BB : *F) {
> +      if (RI->getRegionFor(&BB))
> +        continue;
> +
> +      RI->setRegionFor(&BB, ParentRegion);
> +    }
> +  }

Cheers,
  Johannes
-------------- 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/20150811/adc6497e/attachment.sig>


More information about the llvm-commits mailing list