This is an archive of the discontinued LLVM Phabricator instance.

[Thumb-1] Select post-increment load and store where possible
ClosedPublic

Authored by jmolloy on Jun 9 2016, 4:39 AM.

Details

Summary

Thumb-1 doesn't have post-inc or pre-inc load or store instructions. However the LDM/STM instructions with writeback can function as post-inc load/store:

ldm r0!, {r1}  @ load from r0 into r1 and increment r0 by 4

Obviously, this only works if the post increment is 4.

Diff Detail

Repository
rL LLVM

Event Timeline

jmolloy updated this revision to Diff 60157.Jun 9 2016, 4:39 AM
jmolloy retitled this revision from to [Thumb-1] Select post-increment load and store where possible.
jmolloy updated this object.
jmolloy set the repository for this revision to rL LLVM.
jmolloy added a subscriber: llvm-commits.
rengolin accepted this revision.Jun 9 2016, 5:03 AM
rengolin added a reviewer: rengolin.

LGTM, Thanks!

test/CodeGen/Thumb/ldm-stm-postinc.ll
3

Do we have a bug for that? :)

This revision is now accepted and ready to land.Jun 9 2016, 5:03 AM

FYI, this is not in yet.

jmolloy closed this revision.Jul 15 2016, 1:11 AM

Thanks Renato, committed in r275540.