[PATCH] D71167: [Driver] Default to -momit-leaf-frame-pointer for AArch64
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 13 18:55:37 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rG074323c84658: [Driver] Default to -momit-leaf-frame-pointer for AArch64 (authored by MaskRay).
Changed prior to commit:
https://reviews.llvm.org/D71167?vs=232714&id=233906#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71167/new/
https://reviews.llvm.org/D71167
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/cl-options.c
clang/test/Driver/frame-pointer-elim.c
Index: clang/test/Driver/frame-pointer-elim.c
===================================================================
--- clang/test/Driver/frame-pointer-elim.c
+++ clang/test/Driver/frame-pointer-elim.c
@@ -90,7 +90,9 @@
// WARN-OMIT-LEAF-7S-NOT: warning: optimization flag '-momit-leaf-frame-pointer' is not supported for target 'armv7s'
// WARN-OMIT-LEAF-7S: "-mframe-pointer=non-leaf"
-// On the PS4, we default to omitting the frame pointer on leaf functions
+// On AArch64 and PS4, default to omitting the frame pointer on leaf functions
+// RUN: %clang -### -target aarch64 -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target x86_64-scei-ps4 -S %s 2>&1 | \
// RUN: FileCheck --check-prefix=KEEP-NON-LEAF %s
// RUN: %clang -### -target x86_64-scei-ps4 -S -O2 %s 2>&1 | \
Index: clang/test/Driver/cl-options.c
===================================================================
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -182,7 +182,7 @@
// Oy_2: -O2
// RUN: %clang_cl --target=aarch64-pc-windows-msvc -Werror /Oy- /O2 -### -- %s 2>&1 | FileCheck -check-prefix=Oy_aarch64 %s
-// Oy_aarch64: -mframe-pointer=all
+// Oy_aarch64: -mframe-pointer=non-leaf
// Oy_aarch64: -O2
// RUN: %clang_cl --target=i686-pc-win32 -Werror /O2 /O2 -### -- %s 2>&1 | FileCheck -check-prefix=O2O2 %s
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -603,9 +603,9 @@
bool OmitFP = A && A->getOption().matches(options::OPT_fomit_frame_pointer);
bool NoOmitFP =
A && A->getOption().matches(options::OPT_fno_omit_frame_pointer);
- bool KeepLeaf =
- Args.hasFlag(options::OPT_momit_leaf_frame_pointer,
- options::OPT_mno_omit_leaf_frame_pointer, Triple.isPS4CPU());
+ bool KeepLeaf = Args.hasFlag(options::OPT_momit_leaf_frame_pointer,
+ options::OPT_mno_omit_leaf_frame_pointer,
+ Triple.isAArch64() || Triple.isPS4CPU());
if (NoOmitFP || mustUseNonLeafFramePointerForTarget(Triple) ||
(!OmitFP && useFramePointerForTargetByDefault(Args, Triple))) {
if (KeepLeaf)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71167.233906.patch
Type: text/x-patch
Size: 2294 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191214/995aa2f9/attachment.bin>
More information about the cfe-commits
mailing list