r192815 - [mips] Enable frame-pointer elimination for -O1 and above.
Akira Hatanaka
ahatanaka at mips.com
Wed Oct 16 10:13:08 PDT 2013
Author: ahatanak
Date: Wed Oct 16 12:13:08 2013
New Revision: 192815
URL: http://llvm.org/viewvc/llvm-project?rev=192815&view=rev
Log:
[mips] Enable frame-pointer elimination for -O1 and above.
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=192815&r1=192814&r2=192815&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Oct 16 12:13:08 2013
@@ -1794,7 +1794,11 @@ static bool shouldUseFramePointer(const
// 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::systemz) &&
+ Triple.getArch() == llvm::Triple::systemz ||
+ Triple.getArch() == llvm::Triple::mips ||
+ Triple.getArch() == llvm::Triple::mipsel ||
+ Triple.getArch() == llvm::Triple::mips64 ||
+ Triple.getArch() == llvm::Triple::mips64el) &&
Triple.isOSLinux()) {
if (Arg *A = Args.getLastArg(options::OPT_O_Group))
if (!A->getOption().matches(options::OPT_O0))
@@ -1816,7 +1820,11 @@ static bool shouldUseLeafFramePointer(co
// 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::systemz) &&
+ Triple.getArch() == llvm::Triple::systemz ||
+ Triple.getArch() == llvm::Triple::mips ||
+ Triple.getArch() == llvm::Triple::mipsel ||
+ Triple.getArch() == llvm::Triple::mips64 ||
+ Triple.getArch() == llvm::Triple::mips64el) &&
Triple.isOSLinux()) {
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=192815&r1=192814&r2=192815&view=diff
==============================================================================
--- cfe/trunk/test/Driver/frame-pointer.c (original)
+++ cfe/trunk/test/Driver/frame-pointer.c Wed Oct 16 12:13:08 2013
@@ -16,6 +16,15 @@
// 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
+// RUN: %clang -target mips-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mipsel-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mipsel-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mips64-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips64-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s
+// RUN: %clang -target mips64el-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target mips64el-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %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