[LLVMdev] Update PHINode after extracting code

Tobias Grosser grosser at fim.uni-passau.de
Wed Jan 26 22:10:48 PST 2011


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



More information about the llvm-dev mailing list