[LLVMdev] Converting back to SSA form

John Criswell jtcriswel at gmail.com
Tue Sep 23 08:01:38 PDT 2014


On 9/23/14, 10:52 AM, Rahman Lavaee wrote:
> Hi,
>
> I'm wondering how I can convert "register allocated" code back to SSA 
> form. I realized from MachineRegisterInfo.h that a function leaves SSA 
> form only once and cannot be taken back to it.

Are you wanting to put MachineInstr's into SSA form?  If you want to do 
that, you'll need to implement the SSA construction algorithm yourself 
so that it works on MachineInstrs.  Also, such a pass will need to work 
with virtual registers as you'll need an unlimited supply of temporary 
variables.  In essence, you'll be undoing register allocation.

Can you describe why you want to put MachineInstrs into SSA form?  I 
suspect that putting MachineIntrs back into SSA form is not what you 
want to do.

Regards,

John Criswell




More information about the llvm-dev mailing list