<div dir="ltr">Hi Tobi,<div><br></div><div>       I have one additional question about the RegionInfo::isRegion function. In the second case (i.e. Entry dominates Exit),  why is checking the following two conditions are equivalent to checking it's a refined region:</div>
<div><br></div><div>For any BB in DF(exit), 1)  BB should be in DF(entry) </div><div>                                   2)  BB reachable only from entry through a path passing exit.</div><div><br></div><div>       I.e., why is checking these two conditions is equivalent to ensure single-entry, single-exit in the sense of Refined Region.</div>
<div><br></div><div>Best Regards,</div><div>Paul </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 3:40 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:tobias@grosser.es" target="_blank">tobias@grosser.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 02/06/2014 09:14 PM, Paul Vario wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Tobias,<br>
<br>
          Thanks a lot for the detailed reply. I am working on several new<br>
optimizations for OpenCL kernels for a DSP architecture. The project itself<br>
has an NDA associated with it, so I cannot go into more details, but the<br>
source will be open to public after completion. One of the first steps is<br>
to serialize the work-items in a work-group (e.g., insert nested loops<br>
around REGIONs in between barriers). At this point, I thought I should<br>
implement a full-featured structural analysis, but some one in my team<br>
suggested to first explore what was already in the LLVM. That's what lead<br>
me to the RegionInfo class. If it's not much trouble, could you send the<br>
draft to my forum email? Also, are you aware of any plan on having the<br>
interval/structural analysis supported in LLVM. Thanks again.<br>
</blockquote>
<br></div>
Maybe this is interesting to you:<br>
<br>
lib/Transforms/Scalar/<u></u>StructurizeCFG.cpp<div class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
P.S. One thing I need to find out from reading the implementation is why a<br>
sequence of basic blocks do not get to form a region as a whole.<br>
</blockquote>
<br></div>
A sequence of basic blocks can form a region. The reason the RegionInfo does not form such reason is that there is no canonical way to form such regions. Hence, RegionInfo is only forming minimal regions, which can then be easily joined to larger reasons by connecting sequences of them (e.g. using the expandRegion()).<br>

<br>
Btw, depending how complex your transformations will be, you might also be interested in <a href="http://polly.llvm.org" target="_blank">polly.llvm.org</a> or other automatic transformation in the area of automatic GPU/accelerator code generation. Those won't be finished solutions, but the frameworks/algorithms that exist there may allow to develop optimizations for your hardware a lot faster.<br>

<br>
Tobi<br>
</blockquote></div><br></div>