[LLVMdev] Question in LLVM IR

bhavani krishnan bhavi63 at yahoo.com
Sun Nov 30 19:52:16 PST 2008

Thanks! How do I disable the optimizations??


--- On Mon, 12/1/08, Eli Friedman <eli.friedman at gmail.com> wrote:

> From: Eli Friedman <eli.friedman at gmail.com>
> Subject: Re: [LLVMdev] Question in LLVM IR
> To: bhavi63 at yahoo.com, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Date: Monday, December 1, 2008, 3:48 AM
> On Sun, Nov 30, 2008 at 7:38 PM, bhavani krishnan
> <bhavi63 at yahoo.com> wrote:
> > Hi all,
> >
> > I observed the nature of the LLVM IR and because of
> the SSA form, it does not preserve function local variable
> names (like it preserves function argument names). Is there
> any way to track these local variables?
> >
> > Basically what I am doing is interpreting the IR
> against an abstract machien where I need to store the value
> of each program variable at any instance. Here I would get
> values for registers but how do I map them back to original
> program variables?
> Basically, the loads/stores are getting killed by
> optimization;
> there's no real way to guarantee that the values are
> ever even
> calculated.  You could use debug information in theory, but
> doesn't properly support optimization with debug info
> at the moment.
> Another way would be to use clang, and add some sort of
> instrumentation to every store; this would keep the values,
> but
> interfere with optimizations.  The other approach is to
> just disable
> optimizations; then you can track the variables quite
> easily, but
> you're not really instrumenting the same program. 
> Overall, there
> really isn't a good solution to what you're trying
> to do.
> -Eli


More information about the llvm-dev mailing list