[PATCH] D31972: Do not force the frame pointer by default for ARM EABI
Christian Bruel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 21 01:03:35 PDT 2017
chrib updated this revision to Diff 96109.
chrib added a comment.
- Check not mdisable-fp-elim for arm eabi when optimizing
https://reviews.llvm.org/D31972
Files:
lib/Driver/ToolChains/Clang.cpp
test/Driver/frame-pointer.c
Index: test/Driver/frame-pointer.c
===================================================================
--- test/Driver/frame-pointer.c
+++ test/Driver/frame-pointer.c
@@ -33,6 +33,9 @@
// 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
+// RUN: %clang -target arm-none-eabi -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s
+// RUN: %clang -target arm-none-eabi -### -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
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -566,6 +566,17 @@
}
}
+ if (Triple.getEnvironment() == llvm::Triple::EABI) {
+ switch (Triple.getArch()) {
+ case llvm::Triple::arm:
+ case llvm::Triple::thumb:
+ // ARM EABI doesn't require a frame pointer
+ return !areOptimizationsEnabled(Args);
+ default:
+ return true;
+ }
+ }
+
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31972.96109.patch
Type: text/x-patch
Size: 1255 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170421/0fa07f40/attachment.bin>
More information about the cfe-commits
mailing list