[llvm] r296847 - LiveDebugValues: Assume calls never clobber SP.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 09:48:24 PST 2017


> What do you mean here by "variables"? Local stack variables can certainly be passed to callees and the callees might modify them.

We are talking about variables that are stored in the caller's frame. Their contents may get modified if they are passed by reference, but their *location* (some frameindex) doesn't, and that is what we care about for the debug info here.

-- adrian
> On Mar 9, 2017, at 8:13 AM, Adrian Prantl via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
>> 
>> On Mar 9, 2017, at 7:07 AM, Hal Finkel <hfinkel at anl.gov> wrote:
>> 
>> 
>> 
>> On 03/06/2017 04:48 PM, Adrian Prantl via llvm-commits wrote:
>>> 
>>>> On Mar 6, 2017, at 2:33 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>>> 
>>>> 
>>>> 
>>>> On Thu, Mar 2, 2017 at 5:20 PM Adrian Prantl via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>>> Author: adrian
>>>> Date: Thu Mar  2 19:08:25 2017
>>>> New Revision: 296847
>>>> 
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=296847&view=rev
>>>> Log:
>>>> LiveDebugValues: Assume calls never clobber SP.
>>>> 
>>>> A call should never modify the stack pointer, but some backends are
>>>> not so sure about this and never list SP in the regmask.
>> 
>> I don't quite understand this statement. For callee-cleanup calling conventions (e.g. pascal, stdcall, etc. on Windows), the callee (and, thus, from the perspective of the caller, the call instruction), does modify the stack pointer. What am I missing?
> 
> That's a good point, thanks. I guess what we really want to know in LiveDebugValues is whether a function call (or rather the combination of instructions pushing the argument and the function call) clobbers any variables that are stored in the caller's frame, and that isn't the case (right?). I should at the very least improve the wording in the comment.



More information about the llvm-commits mailing list