[PATCH] D51678: ARM: fix Thumb2 CodeGen for ldrex with folded frame-index
    Tim Northover via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Sep  6 14:40:04 PDT 2018
    
    
  
t.p.northover added inline comments.
================
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);
----------------
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.
Repository:
  rL LLVM
https://reviews.llvm.org/D51678
    
    
More information about the llvm-commits
mailing list