[PATCH] D56925: Do not use frame pointer by default for MSP430
Dmitry Mikushin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 29 09:51:50 PST 2019
dmikushin updated this revision to Diff 184116.
dmikushin edited the summary of this revision.
dmikushin added a comment.
Unbreaking clang driver patch. Not using calla asm instruction, as recomended.
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56925/new/
https://reviews.llvm.org/D56925
Files:
lib/Driver/ToolChains/Clang.cpp
test/CodeGen/msp430-fp-elim.c
Index: test/CodeGen/msp430-fp-elim.c
===================================================================
--- /dev/null
+++ 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");
+}
+
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56925.184116.patch
Type: text/x-patch
Size: 1203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190129/905c5d68/attachment.bin>
More information about the cfe-commits
mailing list