[ARM] Fix MVE ldst offset ranges
authorDavid Green <david.green@arm.com>
Tue, 3 Sep 2019 09:57:02 +0000 (09:57 +0000)
committerDavid Green <david.green@arm.com>
Tue, 3 Sep 2019 09:57:02 +0000 (09:57 +0000)
commit3e8d5f335da2557a5780c7f51e0cc93574731030
tree56e64bd68db61fd140e2d148dbc21e4f3a33da59
parent3be2df2418ee8b70c3051203b56ac422e8108a3f
[ARM] Fix MVE ldst offset ranges

We were using isShiftedInt<7, Shift>(RHSC) to detect the ranges of offsets to
fold into MVE loads/stores. The instructions actually take a 7 bit unsigned
integer which is either added or subtracted. So something more like
isShiftedUInt<7, Shift>(abs(RHSC)).

Instead I've changes this to use the isScaledConstantInRange method, same as in
SelectT2AddrModeImm7Offset used by pre/post inc, which seemed to already be
getting this correct.

Differential revision: https://reviews.llvm.org/D66997

llvm-svn: 370731
llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
llvm/test/CodeGen/Thumb2/mve-ldst-offset.ll
llvm/test/CodeGen/Thumb2/mve-loadstore.ll