[LLVMdev] Update PHINode after extracting code

Vu Le vmle at ucdavis.edu
Thu Jan 27 11:27:24 PST 2011


Oh, yes.
My algorithm extracts regions in a top-down manner.
I modified your RegionPass so that it only visits 2nd level regions.
Those regions are extracted into functions and the process
continues for the new functions.
It's kind of messy since I've just played with LLVM.
I'll modify the algorithm so it can extract regions bottom-up.
Vu

On Wed, Jan 26, 2011 at 10:10 PM, Tobias Grosser
<grosser at fim.uni-passau.de>wrote:

> On 01/27/2011 12:48 AM, Vu Le wrote:
>
>> Hi Tobias,
>> If the PHI node at exit block of region R has multiple inputs from the R,
>> I split the exit block into 2.
>> The first block contains all PHI nodes whose input are all from the
>> region.
>> The second is the new exit node.
>>
>> All branches (outside R) to the old exit now point the new exit.
>> All regions whose exit is the old exit are also updated with the new
>> exit node.
>>
>> It works like a charm.
>>
>
> 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.
>
> Are you going to contribute your region extractor? It would be pretty
> useful for me.
>
> Cheers
> Tobi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110127/e98da7ef/attachment.html>


More information about the llvm-dev mailing list