This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Reserve an emergency spill slot for fp16 addressing modes that need it
ClosedPublic

Authored by dmgreen on Sep 12 2019, 2:17 AM.

Details

Summary

Similar to D67327, but this time for the FP16 VLDR and VSTR instructions that use the AddrMode5FP16 addressing mode. We need to reserve an emergency spill slot for instructions that will be out of range to use sp directly. AddrMode5FP16 is 8 bits with a scale of 2.

Diff Detail

Repository
rL LLVM

Event Timeline

dmgreen created this revision.Sep 12 2019, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2019, 2:17 AM

I have almost this exact change in a WIP patch, but I didn't get around to posting it because I didn't have a testcase, and I ended up deciding to handle the Thumb1 estimation differently.

llvm/lib/Target/ARM/ARMFrameLowering.cpp
1566 ↗(On Diff #219860)

Can we make this "default" an "llvm_unreachable" so we don't accidentally miss addressing modes in the future, like this? (I think in that case, you'll also need to add explicit cases for debug info, AddrMode_i12, and t2ADDri?)

dmgreen updated this revision to Diff 220251.Sep 15 2019, 12:41 PM

Thanks. Good to know I'm not barking up the wrong tree.

This doesn't need the T1 addressing modes added then? Nothing seemed to fail in any of the unittests or the quick tests I ran on it, but they may have been fairly limited.

efriedma accepted this revision.Sep 16 2019, 6:01 PM

LGTM

We never call estimateRSStackSizeLimit on Thumb1; we just use a static estimate based on the range of tSTRspi, since in practice almost all functions will contain one.

llvm/lib/Target/ARM/ARMFrameLowering.cpp
1526 ↗(On Diff #220251)

Not that it's important, but it shouldn't really matter if ADDri etc. is out of range: we can use the destination as a scratch register.

This revision is now accepted and ready to land.Sep 16 2019, 6:01 PM
This revision was automatically updated to reflect the committed changes.