This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Support ldr.w in pseudo instruction ldr rd, =immediate
ClosedPublic

Authored by peter.smith on Sep 12 2016, 10:34 AM.

Details

Summary

The changes to allow ldr rd, =immediate to be transformed into a MOV
http://reviews.llvm.org/D20153
http://reviews.llvm.org/D20154
http://reviews.llvm.org/D20155
caused a regression from LLVM 3.8 as they have no support for the ldr.w rd, =immediate form in Thumb 2 whereas 3.8 did. In ARM the .w is silently ignored by the parser so this problem is restricted to Thumb2.

This patch adds support for ldr.w rd, =immediate for Thumb 2. I've followed the form of the t2LDRpcrel family and added a t2InstAlias for the .w form. This will cause the parser to add an extra operand ".w" that the ARMAsmParser.cpp code has to account for.

Fixes PR30352

Diff Detail

Event Timeline

peter.smith retitled this revision from to [ARM] Support ldr.w in pseudo instruction ldr rd, =immediate.
peter.smith updated this object.
peter.smith added a subscriber: llvm-commits.
rengolin accepted this revision.Sep 12 2016, 10:54 AM
rengolin edited edge metadata.

Two small comments, but otherwise, LGTM.

Feel free to commit with those two changes.

Thanks for the fast turn-around! I'll make sure this gets backported to 3.9.1.

--renato

test/MC/ARM/ldr-pseudo-wide.s
19

shouldn't you also check that the .Ltmp symbol has a .word with the right value?

28

you don't need to check on the caret.

This revision is now accepted and ready to land.Sep 12 2016, 10:54 AM

Made suggested changes and committed under r281319. My apologies I forgot to put PR30352 or the review in the commit message.

peter.smith closed this revision.Sep 19 2016, 8:08 AM

Has been committed for a week and hasn't broken anything that I know of so closing out this review.