Page MenuHomePhabricator

[ARM] Fix handling of thumb1 out-of-range frame offsets
ClosedPublic

Authored by john.brawn on Mar 18 2015, 9:43 AM.

Details

Summary

LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its answer when the base register changes. Unfortunately this isn't true in thumb1, where SP-based loads allow a larger offset than non-SP-based loads, and this causes the base register reuse code to generate instructions that are unencodable, causing an assertion failure.

Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which ARMBaseRegisterInfo can then make use of to give the correct answer.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn updated this revision to Diff 22194.Mar 18 2015, 9:43 AM
john.brawn retitled this revision from to [ARM] Fix handling of thumb1 out-of-range frame offsets.
john.brawn updated this object.
john.brawn edited the test plan for this revision. (Show Details)
john.brawn set the repository for this revision to rL LLVM.
john.brawn added a subscriber: Unknown Object (MLST).
t.p.northover accepted this revision.Mar 20 2015, 7:15 AM
t.p.northover added a reviewer: t.p.northover.
t.p.northover added a subscriber: t.p.northover.

Hi John,

I think this looks fine.

Cheers.

Tim.

This revision is now accepted and ready to land.Mar 20 2015, 7:15 AM
This revision was automatically updated to reflect the committed changes.