Oh, yes.<br>My algorithm extracts regions in a top-down manner.<br>I modified your RegionPass so that it only visits 2nd level regions.<br>Those regions are extracted into functions and the process <br>continues for the new functions.<br>

It's kind of messy since I've just played with LLVM. <br>I'll modify the algorithm so it can extract regions bottom-up.<br><font color="#888888">Vu</font><br><br><div class="gmail_quote">On Wed, Jan 26, 2011 at 10:10 PM, Tobias Grosser <span dir="ltr"><<a href="mailto:grosser@fim.uni-passau.de">grosser@fim.uni-passau.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On 01/27/2011 12:48 AM, Vu Le wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Tobias,<br>
If the PHI node at exit block of region R has multiple inputs from the R,<br>
I split the exit block into 2.<br>
The first block contains all PHI nodes whose input are all from the region.<br>
The second is the new exit node.<br>
<br>
All branches (outside R) to the old exit now point the new exit.<br>
All regions whose exit is the old exit are also updated with the new<br>
exit node.<br>
<br>
It works like a charm.<br>
</blockquote>
<br></div>
Great. Did you check with Andreas patch. I believe you also may need to update the entry nodes of all regions that started at the old node to the new node.<br>
<br>
Are you going to contribute your region extractor? It would be pretty useful for me.<br>
<br>
Cheers<br>
Tobi<br>
</blockquote></div><br>