[llvm-dev] What is stack pointer adjustment on scheduling?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 16 11:08:01 PDT 2019

Hi Chaofan,

On Tue, 16 Apr 2019 at 16:27, Qiu Chaofan via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> What I'm not sure about is the 'stack pointer adjustment'. What is it?

I'm not certain, but my best guess is that it's referring to the
instructions most targets call "ADJCALLSTACKDOWN" and
"ADJCALLSTACKUP". They are defined within each target, and surround
any call sequence to tell the code allocating stack slots how much is
needed for that call's parameters. They're marked as using and
defining SP.

> And how does it prevents scheduling across calls?

Mechanically, it's through the call to TLI.isSchedulingBoundary, which
disallows any instruction that modifies SP. The reasoning is explained
a little more in the body of TargetInstrInfo::isSchedulingBoundary,
and makes it sound like simply opening that up without thought
wouldn't be a great idea.



More information about the llvm-dev mailing list