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 BR/Nizam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140201/bdc3909a/attachment.html>
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 suggestTry 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>
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 suggestTry the register to memory demotion pass. opt -reg2mem - Ben
Here it is: http://llvm.org/docs/Passes.html#reg2mem-demote-all-values-to-stack-slots On Sat, Feb 1, 2014 at 7:47 PM, <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 > > BR/Nizam > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University