[PATCH] D152626: Add support for probestack on ARM targets

Ryan Summers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 10 11:32:12 PDT 2023


ryan-summers created this revision.
ryan-summers added reviewers: serge-sans-paille, craig.topper.
Herald added subscribers: pengfei, JDevlieghere, hiraditya, kristof.beyls.
Herald added a project: All.
ryan-summers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

There is a desire to add support for probestack functionality on ARM (32-bit) targets for embedded applications, as the stack probe functionality can be used, along with a memory protection unit, to protect bare-metal applications from stack overflow issues (or to detect these issues so they can be acted upon).

See https://github.com/rust-embedded/wg/issues/460 for more information as to why this is useful

This diff provides the ability to use function annotations for the `probestack` and `probe-stack-size` to define the various probestack stubs and page protection size. This patch does not enable any of this functionality in clang, and is only targeting the LLVM library currently (as the final usecase for this patch is intended to be in rustc).

Implementation is largely based off the X86 implementation of stack probes. As such, I have tagged some of the reviewers from the original review (https://reviews.llvm.org/D68720) for this diff.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152626

Files:
  llvm/lib/Target/ARM/ARMFrameLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/test/CodeGen/ARM/stack-probe-size.ll
  llvm/test/CodeGen/ARM/stack-probe.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152626.530230.patch
Type: text/x-patch
Size: 8169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230610/37c16b6a/attachment.bin>


More information about the llvm-commits mailing list