[LLVMdev] Eliminate SSA Virtual registers

nizam at cse.iitm.ac.in nizam at cse.iitm.ac.in
Sat Feb 1 08:23:55 PST 2014


Hi Ben, 




That did help. I continue to notice the virtual register in the program. I use LLVM 3.4. The program i am looking at is a very simple one. Listed below 



int global_var; 
int *global_ptr; 


int32_t main(int32_t argc, char ** argv){ 
int p = 10; 
int k = 20; 
int *pp; 
char *c_pp; 


pp = &k; 
global_ptr = pp; 
pp = &p; 
global_ptr = &global_var; 
return 0; 
} 
BR/Nizam 






From: "Benjamin Kramer" <benny.kra at gmail.com> 
To: nizam at cse.iitm.ac.in 
Cc: "llvmdev" <llvmdev at cs.uiuc.edu> 
Sent: Saturday, February 1, 2014 9:57:00 PM 
Subject: Re: [LLVMdev] Eliminate SSA Virtual registers 


On 01.02.2014, at 16:47, nizam at cse.iitm.ac.in wrote: 

> Hi, 
> 
> is there a opt pass that replaces the SSA virtual registers to stack-variables? I want to eliminate the SSA virtual register from my IR. Kindly suggest 

Try the register to memory demotion pass. opt -reg2mem 

- Ben 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140201/6292de2f/attachment.html>


More information about the llvm-dev mailing list