[PATCH] D51678: ARM: fix Thumb2 CodeGen for ldrex with folded frame-index

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 6 14:44:57 PDT 2018


efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Target/ARM/ARMFrameLowering.cpp:1519
         case ARMII::AddrModeT2_i8s4:
+        case ARMII::AddrModeT2_ldrex:
           Limit = std::min(Limit, ((1U << 8) - 1) * 4);
----------------
t.p.northover wrote:
> efriedma wrote:
> > I'm not sure I understand why AddrModeT2_i12 needs special handling, but AddrModeT2_ldrex doesn't; I think they have a similar restriction that they only support positive offsets?
> The rewriteT2FrameIndex code has special cases to convert between i12 and i8 addressing-modes by switching between add/sub (see Thumb2InstrInfo.cpp:576). That means that even though the notional limit for something that's i12 is 12 bits, it may end up in an instruction with an 8-bit limit -- hence the case below.
> 
> There's no such toggle for an ldrex.
I guess it's fine, then.


Repository:
  rL LLVM

https://reviews.llvm.org/D51678





More information about the llvm-commits mailing list