[PATCH] D156875: [ARM] Improve generation of thumb stack accesses

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 04:09:32 PDT 2023


john.brawn created this revision.
john.brawn added reviewers: stuij, olista01, pratlucas, chill.
Herald added subscribers: hiraditya, kristof.beyls, qcolombet.
Herald added a project: All.
john.brawn requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently when a stack access is out of range of an sp-relative ldr or str then we jump straight to generating the offset with a literal pool load or mov32 pseudo-instruction. This patch improves that in two ways:

- If the offset is within range of sp-relative add plus an ldr then use that.
- When we use the mov32 pseudo-instruction, if putting part of the offset into the ldr will simplify the expansion of the mov32 then do so.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156875

Files:
  llvm/lib/Target/ARM/ThumbRegisterInfo.cpp
  llvm/test/CodeGen/ARM/execute-only-split-offset.ll
  llvm/test/CodeGen/ARM/large-stack.ll
  llvm/test/CodeGen/Thumb/emergency-spill-slot.ll
  llvm/test/CodeGen/Thumb/stack-access.ll
  llvm/test/CodeGen/Thumb/stack_guard_remat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156875.546399.patch
Type: text/x-patch
Size: 13026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230802/a646174e/attachment.bin>


More information about the llvm-commits mailing list