This is an archive of the discontinued LLVM Phabricator instance.

ARM: Align functions containing Thumb-2 jump tables to 4 bytes.
ClosedPublic

Authored by pcc on Apr 30 2015, 8:03 PM.

Details

Summary

Functions with jump tables need an alignment of 4 because they use the ADR
instruction, which aligns the PC to 4 bytes before adding an offset.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 24788.Apr 30 2015, 8:03 PM
pcc retitled this revision from to ARM: Align functions containing Thumb-2 jump tables to 4 bytes..
pcc updated this object.
pcc edited the test plan for this revision. (Show Details)
pcc added a reviewer: rengolin.
pcc added a subscriber: Unknown Object (MLST).
rengolin accepted this revision.May 1 2015, 8:58 AM
rengolin edited edge metadata.

With the comment, LGTM. Thanks!

test/CodeGen/ARM/thumb-alignment.ll
25 ↗(On Diff #24788)

Maybe add a check for ADR, to make sure you're not aligning for other reason (and to keep it clear why you're aligning to 4-bytes)?

This revision is now accepted and ready to land.May 1 2015, 8:58 AM
pcc added inline comments.May 1 2015, 11:08 AM
test/CodeGen/ARM/thumb-alignment.ll
25 ↗(On Diff #24788)

Done

This revision was automatically updated to reflect the committed changes.