[PATCH] [SROA] Fold a PHI node if all its incoming values are the same

Duncan Sands duncan.sands at gmail.com
Sat Jul 26 09:13:23 PDT 2014

Hi Chandler,

On 26/07/14 07:45, Chandler Carruth wrote:
> Yea, this looks nice. I have a bunch of nit-picky comments below... Nothing really significant.

SimplifyPHINode in InstructionSimplify has this logic already, only it correctly 
handles the case of phi(x, undef) where undef corresponds to a block not 
dominated by x.  In this case it is wrong to replace the phi by x.  I suggest 
you just use SimplifyPHINode.

Ciao, Duncan.

More information about the llvm-commits mailing list