[LLVMdev] Why variables get "optimized away" after the last use in unoptimized code?

Eric Christopher echristo at gmail.com
Sun Feb 2 22:03:48 PST 2014


This means that debug info would change code generation in order to
artificially lengthen the lifetimes of variables and is something that
is generally verboten when compiling for debug.

-eric

On Sun, Feb 2, 2014 at 1:57 AM, Yuri <yuri at rawbw.com> wrote:
> On 02/02/2014 01:48, David Chisnall wrote:
>>
>> In most calling conventions, this is a callee-save register.  After its
>> last use, the register allocator may reuse that register. On x86 and ARM,
>> the register that contains this is also (usually) the register used for
>
>
> But the rule "after the last use, the register allocator may reuse it" is
> also introduced by llvm, since register allocator is also llvm. So this
> means that the rule "preserve any values while in scope as much as possible"
> is probably a better one for debugging.
>
> Yuri
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list