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

Yuri yuri at rawbw.com
Sun Feb 2 01:57:13 PST 2014


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



More information about the llvm-dev mailing list