This enables -fomit-frame-pointer when optimizing code for all PowerPC
targets, instead of only Linux and NetBSD.
I mailed this patch to cfe-commits earlier this week.
Roman Lebedev and Hal Finkel pointed me to Phabricator;
this is my first attempt to use Phabricator.
My earlier mail wrote:
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) {}.