[PATCH] D70424: clang/AMDGPU: Fix default for frame-pointer attribute
Matt Arsenault via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 19 02:08:05 PST 2019
arsenm created this revision.
arsenm added reviewers: yaxunl, scott.linder, t-tye.
Herald added subscribers: tpr, dstuttard, wdng, kzhuravl.
Enabling optimization should allow frame pointer elimination.
https://reviews.llvm.org/D70424
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/frame-pointer-elim.cl
Index: clang/test/Driver/frame-pointer-elim.cl
===================================================================
--- /dev/null
+++ clang/test/Driver/frame-pointer-elim.cl
@@ -0,0 +1,8 @@
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O3 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKNONE %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O3 -fno-omit-frame-pointer %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+// RUN: %clang -target amdgcn-amd-amdhsa -### -S -cl-opt-disable %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECKALL %s
+
+// CHECKNONE: -mframe-pointer=none
+// CHECKALL: -mframe-pointer=all
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -538,6 +538,8 @@
case llvm::Triple::ppc64le:
case llvm::Triple::riscv32:
case llvm::Triple::riscv64:
+ case llvm::Triple::amdgcn:
+ case llvm::Triple::r600:
return !areOptimizationsEnabled(Args);
default:
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70424.230006.patch
Type: text/x-patch
Size: 1270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191119/502cd72b/attachment.bin>
More information about the cfe-commits
mailing list