From 5256457fc45c0921c82f9c0ff51cd395d14a4f97 Mon Sep 17 00:00:00 2001 From: Sam Schweigel Date: Thu, 30 Jan 2025 13:23:48 -0800 Subject: [PATCH] Always add the frame-pointer=all attribute At some point LLVM on MacOS started doing frame pointer optimization by default. Ask for a frame pointer on every function, on all platforms. --- src/codegen.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index e9e4275672c7e..2690c095305ec 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -83,20 +83,6 @@ using namespace llvm; -static bool jl_fpo_disabled(const Triple &TT) { -#ifdef JL_DISABLE_FPO - return true; -#endif -#ifdef _COMPILER_MSAN_ENABLED_ - // MSAN doesn't support FPO - return true; -#endif - if (TT.isOSLinux() || TT.isOSWindows() || TT.isOSFreeBSD() || TT.isOSOpenBSD()) { - return true; - } - return false; -} - static bool jl_floattemp_var_needed(const Triple &TT) { #ifdef JL_NEED_FLOATTEMP_VAR return true; @@ -2969,8 +2955,7 @@ void jl_init_function(Function *F, const Triple &TT) if (TT.isOSWindows() && TT.getArch() == Triple::x86_64) { attr.addUWTableAttr(llvm::UWTableKind::Default); // force NeedsWinEH } - if (jl_fpo_disabled(TT)) - attr.addAttribute("frame-pointer", "all"); + attr.addAttribute("frame-pointer", "all"); if (!TT.isOSWindows()) { #if !defined(_COMPILER_ASAN_ENABLED_) // ASAN won't like us accessing undefined memory causing spurious issues,