Default -fomit-frame-pointer for PowerPC

Roman Lebedev via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 2 10:31:30 PDT 2019


Best to submit patches to phabricator https://reviews.llvm.org/

On Tue, Apr 2, 2019 at 8:30 PM George Koehler via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
> 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>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list