[ARM] Introduce i8neg and i8pos addressing modes
authorDavid Green <david.green@arm.com>
Thu, 2 Dec 2021 17:10:26 +0000 (17:10 +0000)
committerDavid Green <david.green@arm.com>
Thu, 2 Dec 2021 17:10:26 +0000 (17:10 +0000)
commitb8f1ccb0acf8dccdd3fb706465ec958763987bee
tree3104b1ff1f14f6c6a805ea4d14a4bdf4af180c94
parent2a2b3a3e3df7b89e18be9ffab1e08d7ca578cf57
[ARM] Introduce i8neg and i8pos addressing modes

Some instructions with i8 immediate ranges can only hold negative values
(like t2LDRHi8), only hold positive values (like t2STRT) or hold +/-
depending on the U bit (like the pre/post inc instructions. e.g
t2LDRH_POST). This patch splits the AddrModeT2_i8 into AddrModeT2_i8,
AddrModeT2_i8pos and AddrModeT2_i8neg to make this clear.

This allows us to get the offset ranges of t2LDRHi8 correct in the
load/store optimizer, fixing issues where we could end up creating
instructions with positive offsets (which may then be encoded as ldrht).

Differential Revision: https://reviews.llvm.org/D114638
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/ARMInstrFormats.td
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
llvm/test/CodeGen/ARM/machine-outliner-stack-fixup-thumb.mir
llvm/test/CodeGen/Thumb2/postinc-distribute.mir