This is the mail archive of the
mailing list for the GCC project.
[RFC] Modeling the behavior of function calls
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc at gcc dot gnu dot org
- Cc: Xinliang David Li <davidxl at google dot com>, Robert Hundt <rhundt at google dot com>
- Date: Mon, 28 Apr 2008 15:04:56 -0400
- Subject: [RFC] Modeling the behavior of function calls
[ Apologies if this comes out twice. I posted this message last week,
but I think it was rejected because of a .pdf attachment. ]
We have been bouncing ideas for a new mechanism to describe the behavior
of function calls so that optimizers can be more aggressive at call
sites. Currently, GCC supports the notion of pure/impure,
const/non-const, but that is not enough for various cases.
The main application for this would be stable library code like libc,
that the compiler generally doesn't get to process.
David sketched up the initial idea and we have been adding to it for the
last few weeks. At this point, we have the initial design ideas and
some thoughts on how we would implement it, but we have not started any
actual implementation work.
The main idea is to add a variety of attributes to describe contracts
for function calls. When the optimizers read in the function
declaration, they can take advantage of the attributes and adjust the
clobbering effects of call sites.
We are interested in feedback on the main idea and possible
implementation effort. We would like to discuss this further at the
Summit, perhaps we can organize a BoF or just get folks together for a
chat (this came up after the Summit deadline).
The design document is available at the new wiki page I set up for this