[llvm] [AArch64] Stack probing for function prologues (PR #66524)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 11:27:54 PDT 2023


================
@@ -1076,6 +1076,16 @@ void CodeGenModule::Release() {
                                 "sign-return-address-with-bkey", 1);
   }
 
+  if (Arch == llvm::Triple::aarch64 || Arch == llvm::Triple::aarch64_be) {
+    auto *InlineAsm = llvm::MDString::get(TheModule.getContext(), "inline-asm");
+    if (CodeGenOpts.StackClashProtector)
+      getModule().addModuleFlag(llvm::Module::Override, "probe-stack",
+                                InlineAsm);
----------------
efriedma-quic wrote:

Why do we want to use a module flag for this, specifically on AArch64?  I'd prefer to avoid architecture-specific code here unless there's actually some architecture-specific property involved.

https://github.com/llvm/llvm-project/pull/66524


More information about the llvm-commits mailing list