This is an archive of the discontinued LLVM Phabricator instance.

[ARM] unwinding .pad instructions missing in execute-only prologue
ClosedPublic

Authored by keith.walker.arm on Mar 26 2020, 7:30 AM.

Details

Summary

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.

Diff Detail

Event Timeline

momchil.velikov added a subscriber: llvm-commits.

ping.

Any feedback would be welcome on whether this was a suitable approach to fix this issue for Thumb2 execute-only code.

yroux added a subscriber: yroux.Apr 6 2020, 3:24 AM

I can't approve it, but it looks good to me.

ostannard accepted this revision.Apr 6 2020, 6:16 AM
ostannard added a subscriber: ostannard.

LGTM

This revision is now accepted and ready to land.Apr 6 2020, 6:16 AM
This revision was automatically updated to reflect the committed changes.