[clang] 17d0a15 - [SPARC][clang] Enable frame pointer optimization by default
Brad Smith via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 28 15:23:37 PST 2022
Author: Koakuma
Date: 2022-11-28T18:22:46-05:00
New Revision: 17d0a15478e96d8de611c90e760ca4f7b4ff5490
URL: https://github.com/llvm/llvm-project/commit/17d0a15478e96d8de611c90e760ca4f7b4ff5490
DIFF: https://github.com/llvm/llvm-project/commit/17d0a15478e96d8de611c90e760ca4f7b4ff5490.diff
LOG: [SPARC][clang] Enable frame pointer optimization by default
Enable frame pointer optimization by default to match it with other targets.
This brings a small reduction in generated binary sizes.
Fixes bug #48327
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D138532
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/frame-pointer-elim.c
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index d8a1ebb45f60b..d8ece4ee7a9f3 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -538,6 +538,9 @@ static bool useFramePointerForTargetByDefault(const ArgList &Args,
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:
diff --git a/clang/test/Driver/frame-pointer-elim.c b/clang/test/Driver/frame-pointer-elim.c
index 79cc0ee1b18b9..761b2ae713f83 100644
--- a/clang/test/Driver/frame-pointer-elim.c
+++ b/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 | \
More information about the cfe-commits
mailing list