[ARM] unwinding .pad instructions missing in execute-only prologue
authorKeith Walker <keith.walker@arm.com>
Thu, 26 Mar 2020 09:40:28 +0000 (09:40 +0000)
committerKeith Walker <keith.walker@arm.com>
Tue, 7 Apr 2020 10:51:59 +0000 (11:51 +0100)
commit01dc10774eb87bc2f114a0e2d77083dbec62226b
treecafc26bc1c175ce85a068bb822b38bf453850659
parent08fab9ebecf72a682279d75489dc2460121cbeed
[ARM] unwinding .pad instructions missing in execute-only prologue

If the stack pointer is altered for local variables and we are generating
Thumb2 execute-only code the .pad directive is missing.

Usually the size of the adjustment is stored in a PC-relative location
and loaded into a register which is then added to the stack pointer.
However when we are generating execute-only code code the size of the
adjustment is instead generated using the MOVW/MOVT instruction pair.

As a by product of handling the execute-only case this also fixes an
existing issue that in the none execute-only case the .pad directive was
generated against the load of the constant to a register instruction,
instead of the instruction which adds the register to the stack pointer.

Differential Revision: https://reviews.llvm.org/D76849
llvm/lib/Target/ARM/ARMAsmPrinter.cpp
llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
llvm/lib/Target/ARM/ARMMachineFunctionInfo.h
llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
llvm/test/CodeGen/Thumb/emergency-spill-slot.ll
llvm/test/CodeGen/Thumb2/thumb2-execute-only-prologue.ll [new file with mode: 0644]