Default -fomit-frame-pointer for PowerPC

George Koehler via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 10:18:51 PDT 2019


Hello cfe-commits,

The attached patch is for clang to use -fomit-frame-pointer by default
for all PowerPC targets when optimizing code.  Right now, clang uses
-fomit-frame-pointer for PowerPC Linux and NetBSD but not for other
targets.  I have been running `clang -target powerpc-openbsd`.

The patch is for llvm-project.git master.  I previously posted this
patch to https://bugs.llvm.org/show_bug.cgi?id=41094 , but the patch
in this email is for a newer revision of master.

In most functions, the frame pointer in r31 is an unnecessary extra
copy of the stack pointer in r1.  GCC is using -fomit-frame-pointer by
default (in my PowerPC machine running OpenBSD/macppc); I want Clang
to be at least as good as GCC.  Also, this patch helps me to compare
the output of `clang -target powerpc-openbsd -O2 -S` with the output
for Linux or NetBSD.  In bug 41094, I showed how -fomit-frame-pointer
simplifies the C function `void nothing(void) {}`.

This is my first mail to cfe-commits; I'm using the instructions at
http://llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch

-- 
George Koehler <kernigh at gmail.com>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Use-fomit-frame-pointer-when-optimizing-PowerPC-code.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190402/0898462e/attachment-0001.ksh>


More information about the cfe-commits mailing list