[LLVMdev] Critical edges

Chris Lattner sabre at nondot.org
Mon Jul 3 15:20:34 PDT 2006


On Mon, 3 Jul 2006, Fernando Magno Quintao Pereira wrote:
>    when the phi-elimination pass is called (after local
> register allocation, for example), it seems to me that the control flow
> graph may have critical edges. Is it true?

Yes.

> If it is true, I would like to know more about the
> algorithm that you guys use to destroy phi-functions. Is there any
> reference? Why did not implement a machine function pass to

We use a trivial PHI elimination algorithm.  The code is extensively 
commented in CodeGen/PHIElimination.cpp, but basically it emits one copy 
in the def block and one copy for each input in the pred blocks.

> remove critical edges? I mean, I would like to implement something
> like this. Is there any problem that would make it hard?

This wouldn't be hard to implement, patches welcome!

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list