[PATCH] D56925: Do not use frame pointer by default for MSP430
Anton Korobeynikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 5 12:16:30 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL353212: Do not use frame pointer by default for MSP430 (authored by asl, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56925/new/
https://reviews.llvm.org/D56925
Files:
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
cfe/trunk/test/CodeGen/msp430-fp-elim.c
Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp
@@ -519,6 +519,7 @@
case llvm::Triple::xcore:
case llvm::Triple::wasm32:
case llvm::Triple::wasm64:
+ case llvm::Triple::msp430:
// XCore never wants frame pointers, regardless of OS.
// WebAssembly never wants frame pointers.
return false;
Index: cfe/trunk/test/CodeGen/msp430-fp-elim.c
===================================================================
--- cfe/trunk/test/CodeGen/msp430-fp-elim.c
+++ cfe/trunk/test/CodeGen/msp430-fp-elim.c
@@ -0,0 +1,19 @@
+// REQUIRES: msp430-registered-target
+// RUN: %clang_cc1 -mdisable-fp-elim -triple msp430 -S %s -o - | FileCheck %s --check-prefix=FP_ENFORCED
+// RUN: %clang_cc1 -triple msp430 -S %s -o - | FileCheck %s --check-prefix=FP_DEFAULT
+
+// Check the frame pointer is not used on MSP430 by default, but can be forcibly turned on.
+
+// FP_ENFORCED: push r4
+// FP_ENFORCED: mov r4, r4
+// FP_ENFORCED: pop r4
+// FP_DEFAULT: .globl fp_elim_check
+// FP_DEFAULT-NOT: push r4
+// FP_DEFAULT: mov r4, r4
+// FP_DEFAULT-NOT: pop r4
+
+void fp_elim_check()
+{
+ asm volatile ("mov r4, r4");
+}
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56925.185372.patch
Type: text/x-patch
Size: 1283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190205/376b0a83/attachment.bin>
More information about the cfe-commits
mailing list