[ARM] Use sub for negative offset load/store in thumb1
authorDavid Green <david.green@arm.com>
Tue, 29 Jan 2019 10:40:31 +0000 (10:40 +0000)
committerDavid Green <david.green@arm.com>
Tue, 29 Jan 2019 10:40:31 +0000 (10:40 +0000)
commit54b011554715919de3f277e8dc1bf500f5b2b32c
tree2a6532946f6ca531a2ea80f449646a96dc408bab
parent0b7fce6d72f54c5c45aa98e1cee938b6c2b64303
[ARM] Use sub for negative offset load/store in thumb1

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.

Differential Revision: https://reviews.llvm.org/D57121

llvm-svn: 352475
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/lib/Target/ARM/ARMInstrThumb.td
llvm/test/CodeGen/ARM/load.ll