This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Fix "Constant pool entry out of range!" in Thumb1 mode
ClosedPublic

Authored by apazos on Mar 20 2018, 3:00 PM.

Details

Summary

This patch fixes PR36658, "Constant pool entry out of range!" in Thumb1 mode.

In ARMConstantIslands::optimizeThumb2JumpTables() in Thumb1 mode, adjustBBOffsetsAfter() is not calculating postOffset correctly by properly accounting for the padding that is required for the constant pool that immediately follows the jump table branch instruction.

Diff Detail

Repository
rL LLVM

Event Timeline

apazos created this revision.Mar 20 2018, 3:00 PM

Is this a candidate for 6.0.1?

chrib added a subscriber: chrib.Mar 21 2018, 12:45 AM

This bug was uncovered when running SPEC workload in Thumb1 mode.
Thumb1 mode does not seem to get widely tested.
There are other issues we want to fix in Thumb1 mode, for example, modelling TBB/TBH as pseudoinstructions of size 2 does not seem correct (should be 8 and 10).
But that will be done in a separate future patch.
We need to fix post offset computation first.
Tim, do you agree with the fix and do you want to make it a candidate for 6.0.1?

t.p.northover accepted this revision.Mar 23 2018, 6:30 AM

Looks like it's clearly an improvement, and very low risk so it'd just as well go into 6.0 if there's time.

This revision is now accepted and ready to land.Mar 23 2018, 6:30 AM
This revision was automatically updated to reflect the committed changes.