X86 Calls marked to clobber RSP. Intended?

Tim Northover t.p.northover at gmail.com
Wed Aug 13 05:20:40 PDT 2014


Hi Fred,

> Any thoughts? Does the RSP clobber make sense?

I suspect it's mostly academic from a purely codegen perspective since
%rsp is a reserved register and so only X86-specific code that knows
about it will touch it.

However, there is one edge-case I know about: if the function has
x86_stdcallcc calling convention (on 32-bit, see isCalleePop for more
details) then it's callee-cleans-stack. In that case %rsp *will* be
different after that call instruction.

Without that wrinkle, it's probably conservatively correct (it just
happens to always define %rsp to be its previous value), but not
necessarily helpful.

Cheers.

Tim.



More information about the llvm-commits mailing list