Page MenuHomePhabricator

[ARM] Make sure to save/restore LR when we use tBfar.
ClosedPublic

Authored by efriedma on Mar 15 2019, 4:01 PM.

Details

Summary

This change does two things. One, it ensures compilation will abort instead of miscompiling if ARMFrameLowering::determineCalleeSaves chooses not to save LR in a case where it's necessary. Two, it changes the way we estimate the size of a function to be more conservative in the presence of constant pool entries and jump tables.

EstimateFunctionSizeInBytes probably still isn't really conservative enough, but I'm not sure how we can come up with a reliable estimate before constant islands runs.

The testcase is a little on the large side... suggestions welcome on how to shrink it.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Mar 15 2019, 4:01 PM
olista01 accepted this revision.Mar 18 2019, 6:14 AM
olista01 added a subscriber: olista01.

LGTM with one nit .

lib/Target/ARM/ARMMachineFunctionInfo.h
64 ↗(On Diff #190919)

s/LRSpilledForFarJump/LRSpilled/

This revision is now accepted and ready to land.Mar 18 2019, 6:14 AM
This revision was automatically updated to reflect the committed changes.