This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Function specific optimizations call for discussion
- From: "Michael Meissner" <michael dot meissner at amd dot com>
- To: gcc at gcc dot gnu dot org, christophe dot harle at amd dot com
- Cc: michael dot meissner at amd dot com
- Date: Wed, 28 Nov 2007 15:57:37 -0500
- Subject: Function specific optimizations call for discussion
One of the things that I've been interested in is adding support to GCC to
compile individual functions with specific target options. I first presented a
draft at the Google mini-summit, and then another draft at the GCC developer
summit last July.
In the x86 world this would mean saying that an individual function can use
SSE5 instructions or SSE4.1 instructions. This would simplify things for
people who need to write high performance libraries that run on different
architectures, and need to be optimal on each platform. Ultimately, the goal
is to allow hotspot functions to be compiled several times with different
target specific optimizations. I would welcome any thoughts or suggestions
about this proposal.
The proposal is at:
http://gcc.gnu.org/wiki/FunctionSpecificOpt
Part of the infrastructure work for doing this is already addressed in function
adaption project and we will work together with that team:
http://gcc.gnu.org/wiki/functionAdaptation
One of the things that I have considered and not added to the current proposal
is to change most of the -f, -O, -W options for a function. This would be
relatively simple to add once the infrastructure is in place, but it can really
complicate things, since various optimizations depend on other optimizations
having been done. Similarly, the -mtune= and -march= options can overly
complicate matters.
In addition, attribute(cold) and attribute(hot) will set the optimization level
to -Os and -O3.
I will be away on vacation from December 3-8th, and not reading mail during
that time.
--
Michael Meissner, AMD
90 Central Street, MS 83-29, Boxborough, MA, 01719, USA
michael.meissner@amd.com