[PATCH] D57121: [ARM] Use sub for negative offset load/store in thumb1

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 23 14:48:38 PST 2019


dmgreen created this revision.
dmgreen added reviewers: efriedma, t.p.northover, javed.absar.
Herald added a subscriber: kristof.beyls.

This attempts to optimise negative values used in load/store operands
a little. We currently try to selct them as rr, materialising the
negative constant using a MOV/MVN pair. This instead selects ri with
an immediate of 0, forcing the add node to become a simpler sub.

The ldrsb and ldrsh tests here are not really better, but not worse either.
It will depend upon whether the constant or the add havee multiple uses.
It appears to be fairly common for an address to be used, and stored
somewhere at the same time.


https://reviews.llvm.org/D57121

Files:
  lib/Target/ARM/ARMISelDAGToDAG.cpp
  test/CodeGen/ARM/load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57121.183184.patch
Type: text/x-patch
Size: 4594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190123/d0926323/attachment.bin>


More information about the llvm-commits mailing list