[PATCH] [ARM] Fix handling of thumb1 out-of-range frame offsets

John Brawn john.brawn at arm.com
Wed Mar 18 09:43:41 PDT 2015


LocalStackSlotPass assumes that isFrameOffsetLegal doesn't change its answer when the base register changes. Unfortunately this isn't true in thumb1, where SP-based loads allow a larger offset than non-SP-based loads, and this causes the base register reuse code to generate instructions that are unencodable, causing an assertion failure.

Solve this by adding a BaseReg parameter to isFrameOffsetLegal, which ARMBaseRegisterInfo can then make use of to give the correct answer.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8419

Files:
  include/llvm/Target/TargetRegisterInfo.h
  lib/CodeGen/LocalStackSlotAllocation.cpp
  lib/Target/AArch64/AArch64RegisterInfo.cpp
  lib/Target/AArch64/AArch64RegisterInfo.h
  lib/Target/ARM/ARMBaseRegisterInfo.cpp
  lib/Target/ARM/ARMBaseRegisterInfo.h
  lib/Target/PowerPC/PPCRegisterInfo.cpp
  lib/Target/PowerPC/PPCRegisterInfo.h
  test/CodeGen/Thumb/stack-access.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8419.22194.patch
Type: text/x-patch
Size: 10632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150318/79b3d35c/attachment.bin>


More information about the llvm-commits mailing list