ARM: fix Thumb2 CodeGen for ldrex with folded frame-index.
authorTim Northover <tnorthover@apple.com>
Fri, 7 Sep 2018 09:21:25 +0000 (09:21 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 7 Sep 2018 09:21:25 +0000 (09:21 +0000)
commitbb7d7b3d33e856e8a640d394954a29a59b32a3e6
treec2c2afadc9e44ad85496c41f6fb47b6753f07cf9
parentd49c32ce3f3f87ae7b04c168438a038a632db0c1
ARM: fix Thumb2 CodeGen for ldrex with folded frame-index.

Because t2LDREX (& t2STREX) were marked as AddrModeNone, but did allow a
FrameIndex operand, rewriteT2FrameIndex asserted. This gives them a
proper addressing-mode and tells the rewriter about it so that encodable
offsets are exploited and others are rejected.

Should fix PR38828.

llvm-svn: 341642
llvm/lib/Target/ARM/ARMFrameLowering.cpp
llvm/lib/Target/ARM/ARMInstrFormats.td
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
llvm/test/CodeGen/ARM/ldrex-frame-size.ll [new file with mode: 0644]
llvm/test/CodeGen/ARM/ldstrex.ll