[PATCH] D112811: [ARM] implement LOAD_STACK_GUARD for remaining targets

Ard Biesheuvel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 05:34:21 PDT 2021


ardb created this revision.
ardb added reviewers: rengolin, kees, peter.smith, nathanchance, nickdesaulniers.
Herald added subscribers: mstorsjo, hiraditya, kristof.beyls, dschuff.
ardb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently, LOAD_STACK_GUARD on ARM is only implemented for Mach-O targets, and
other targets rely on the generic support which may result in spilling of the
stack canary value or address, or may cause it to be kept in a callee save
register across function calls, which means they essentially get spilled as
well, only by the callee when it wants to free up this register.

So let's implement LOAD_STACK GUARD for other targets as well. This ensures
that the load of the stack canary is rematerialized fully in the epilogue.

This code was split off from

  D112768: [ARM] implement support for TLS register based stack protector

for which it is a prerequisite.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112811

Files:
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMInstrInfo.cpp
  llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
  llvm/test/CodeGen/ARM/ssp-data-layout.ll
  llvm/test/CodeGen/ARM/stack-guard-reassign.ll
  llvm/test/CodeGen/ARM/struct_byval.ll
  llvm/test/CodeGen/ARM/tail-call-scheduling.ll
  llvm/test/CodeGen/ARM/win32-ssp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112811.383322.patch
Type: text/x-patch
Size: 8657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211029/f14f9ffc/attachment.bin>


More information about the llvm-commits mailing list