r186674 - [SystemZ] Enable frame-pointer elimination for -O1 and above
Richard Sandiford
rsandifo at linux.vnet.ibm.com
Fri Jul 19 07:06:49 PDT 2013
Author: rsandifo
Date: Fri Jul 19 09:06:49 2013
New Revision: 186674
URL: http://llvm.org/viewvc/llvm-project?rev=186674&view=rev
Log:
[SystemZ] Enable frame-pointer elimination for -O1 and above
Copies the x86 behavior.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/frame-pointer.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=186674&r1=186673&r2=186674&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jul 19 09:06:49 2013
@@ -1799,9 +1799,10 @@ static bool shouldUseFramePointer(const
options::OPT_fomit_frame_pointer))
return A->getOption().matches(options::OPT_fno_omit_frame_pointer);
- // Don't use a frame pointer on linux x86 and x86_64 if optimizing.
+ // Don't use a frame pointer on linux x86, x86_64 and z if optimizing.
if ((Triple.getArch() == llvm::Triple::x86_64 ||
- Triple.getArch() == llvm::Triple::x86) &&
+ Triple.getArch() == llvm::Triple::x86 ||
+ Triple.getArch() == llvm::Triple::systemz) &&
Triple.getOS() == llvm::Triple::Linux) {
if (Arg *A = Args.getLastArg(options::OPT_O_Group))
if (!A->getOption().matches(options::OPT_O0))
@@ -1817,9 +1818,10 @@ static bool shouldUseLeafFramePointer(co
options::OPT_momit_leaf_frame_pointer))
return A->getOption().matches(options::OPT_mno_omit_leaf_frame_pointer);
- // Don't use a leaf frame pointer on linux x86 and x86_64 if optimizing.
+ // Don't use a leaf frame pointer on linux x86, x86_64 and z if optimizing.
if ((Triple.getArch() == llvm::Triple::x86_64 ||
- Triple.getArch() == llvm::Triple::x86) &&
+ Triple.getArch() == llvm::Triple::x86 ||
+ Triple.getArch() == llvm::Triple::systemz) &&
Triple.getOS() == llvm::Triple::Linux) {
if (Arg *A = Args.getLastArg(options::OPT_O_Group))
if (!A->getOption().matches(options::OPT_O0))
Modified: cfe/trunk/test/Driver/frame-pointer.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/frame-pointer.c?rev=186674&r1=186673&r2=186674&view=diff
==============================================================================
--- cfe/trunk/test/Driver/frame-pointer.c (original)
+++ cfe/trunk/test/Driver/frame-pointer.c Fri Jul 19 09:06:49 2013
@@ -11,6 +11,11 @@
// RUN: %clang -target x86_64-pc-linux -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK3-64 %s
// RUN: %clang -target x86_64-pc-linux -### -S -Os %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKs-64 %s
+// Trust the above to get the optimizations right, and just test other targets
+// that want this by default.
+// RUN: %clang -target s390x-pc-linux -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-64 %s
+// RUN: %clang -target s390x-pc-linux -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-64 %s
+
// CHECK0-32: -mdisable-fp-elim
// CHECK1-32-NOT: -mdisable-fp-elim
// CHECK2-32-NOT: -mdisable-fp-elim
More information about the cfe-commits
mailing list