[LLVMdev] Loop simplification

Andrew Clinton andrew at sidefx.com
Tue Feb 1 15:58:40 PST 2011


On 02/01/2011 06:43 PM, Frits van Bommel wrote:
> I don't think that's always possible.
> For example: if a phi in the successor has a phi in the predecessor as
> one of it's incoming values, then the predecessor cases have to be
> merged into the successor phi. However, if they share a predecessor
> but have different incoming values for it that can't be done.

You're right.  I think it's possible to avoid this (and all other?) 
failing cases by ensuring that the predecessor dominates the successor 
before trying to merge them.  If the dominance relationship is not true, 
it may not be possible to merge them.

Andrew



More information about the llvm-dev mailing list