[PATCH] D138532: [SPARC][clang] Enable frame pointer optimization by default
Koakuma via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 22 16:40:25 PST 2022
koakuma created this revision.
koakuma added reviewers: arsenm, MaskRay, brad, dcederman.
Herald added subscribers: StephenFan, fedor.sergeev, jyknight.
Herald added a project: All.
koakuma requested review of this revision.
Herald added subscribers: cfe-commits, wdng.
Herald added a project: clang.
Enable frame pointer optimization by default to match it with other targets.
This brings a small reduction in generated binary sizes.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138532
Files:
clang/lib/Driver/ToolChains/Clang.cpp
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
@@ -112,6 +112,20 @@
// RUN: %clang -### -target powerpc64 -S -O1 %s 2>&1 | \
// RUN: FileCheck --check-prefix=KEEP-NONE %s
+// SPARC targets omit the frame pointer when optimizations are enabled.
+// RUN: %clang -### -target sparc -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+// RUN: %clang -### -target sparc -S -O1 %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+// RUN: %clang -### -target sparcel -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+// RUN: %clang -### -target sparcel -S -O1 %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+// RUN: %clang -### -target sparc64 -S %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-ALL %s
+// RUN: %clang -### -target sparc64 -S -O1 %s 2>&1 | \
+// RUN: FileCheck --check-prefix=KEEP-NONE %s
+
// For AAarch32 (A32, T32) linux targets, default omit frame pointer when
// optimizations are enabled.
// RUN: %clang -### -target arm-linux-gnueabihf- -marm -S %s 2>&1 | \
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -538,6 +538,9 @@
case llvm::Triple::ppc64le:
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
+ case llvm::Triple::sparc:
+ case llvm::Triple::sparcel:
+ case llvm::Triple::sparcv9:
case llvm::Triple::amdgcn:
case llvm::Triple::r600:
case llvm::Triple::csky:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138532.477342.patch
Type: text/x-patch
Size: 1680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221123/4603ff39/attachment.bin>
More information about the cfe-commits
mailing list