This is an archive of the discontinued LLVM Phabricator instance.

[ARM] ldr pc,=expression should be allowed in Thumb2
ClosedPublic

Authored by peter.smith on Jun 28 2017, 7:34 AM.

Details

Summary

This change allows the PC to be used as a destination register for the pseudo instruction LDR Rt,=expression . The pseudo instruction must not be transformed into a MOV, but it can use the Thumb2 LDR (literal) instruction to a constant pool entry. See (A7.7.43 from ARMv7M ARM ARM).

There are no changes required to ARMAsmParser.cpp as the use of PC or SP already inhibits the transformation to MOV.

Link to v7 ARM ARM that does not require registration: https://developer.arm.com/products/architecture/m-profile/docs/ddi0403/e/armv7-m-architecture-reference-manual

Diff Detail

Repository
rL LLVM

Event Timeline

peter.smith created this revision.Jun 28 2017, 7:34 AM
olista01 accepted this revision.Jul 10 2017, 9:40 AM

LGTM.

This revision is now accepted and ready to land.Jul 10 2017, 9:40 AM
This revision was automatically updated to reflect the committed changes.