[ARM] Reorganise and simplify thumb-1 load/store selection
authorJohn Brawn <john.brawn@arm.com>
Thu, 13 Aug 2015 10:48:22 +0000 (10:48 +0000)
committerJohn Brawn <john.brawn@arm.com>
Thu, 13 Aug 2015 10:48:22 +0000 (10:48 +0000)
commit4d88daed013941dc52e7ddc6ee13fc94e3b0189e
treeffe16726d663c96699073192407bc36c99852b43
parent8d26d44905de0eb2b521601c83b6e540a156d94d
[ARM] Reorganise and simplify thumb-1 load/store selection

Other than PC-relative loads/store the patterns that match the various
load/store addressing modes have the same complexity, so the order that they
are matched is the order that they appear in the .td file.

Rearrange the instruction definitions in ARMInstrThumb.td, and make use of
AddedComplexity for PC-relative loads, so that the instruction matching order
is the order that results in the simplest selection logic. This also makes
register-offset load/store be selected when it should, as previously it was
only selected for too-large immediate offsets.

Differential Revision: http://reviews.llvm.org/D11800

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244882 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelDAGToDAG.cpp
lib/Target/ARM/ARMInstrThumb.td
test/CodeGen/ARM/load.ll