[LLVMdev] Question about method CodeExtractor::severSplitPHINodes

Caldarale, Charles R Chuck.Caldarale at unisys.com
Sat Mar 2 21:14:22 PST 2013


> From: Wei Dang [mailto:jacdang at gmail.com] 
> Subject: Re: [LLVMdev] Question about method CodeExtractor::severSplitPHINodes

> Please excuse me if I'm not supposed to reply to all.

You should do reply-all, to make sure the list sees all of the thread.

> Are you saying all PHI nodes are required to include all its predecessor blocks 
> no matter they have input or not?

That's the way SSA works - each input to a block must be provided by all paths leading to the block.  That must be from each immediate predecessor or from a common predecessor of two or more immediate predecessors that do not mutate the value.

> What about successor blocks? Are they optional if they don't provide inputs?

The question doesn't make sense; we're only concerned with the predecessors here.  If you have a loop, some successor (possibly the block of interest) is also a predecessor and must conform to SSA usage.

> where should I look at to verify this, the mem2reg.cpp & PromoteMemToReg.cpp?

It's an inherent characteristic of SSA:
http://en.wikipedia.org/wiki/Static_single_assignment_form

(or any of numerous textbooks and papers).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.





More information about the llvm-dev mailing list