This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: LTO and Code Compaction \ Reverse Inlining \ Procedure Abstraction?
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Miguel Angel <miguel55angel at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 16 Jul 2006 18:58:38 -0700
- Subject: Re: LTO and Code Compaction \ Reverse Inlining \ Procedure Abstraction?
- References: <BAY110-F24DFA15DA53FC64F50E729B16C0@phx.gbl>
Miguel Angel wrote:
> Hello!
>
> I have a VERY simple example:
> int f1 (int i) {i = (i-7)/9+3; return i;}
> int f2 (int i) {i = (i-7)/9+3; return i;}
>
> It could be reduced to:
> int f1 (int i) {i = (i-7)/9+3; return i;}
> int f2 (int i) {return f1 (i);}
>
>
> Are there any ideas on how and where to add a target and language
> independent code compaction pass into gcc?
Some people call this "uninlining". I've also heard the term
"procedural abstraction". The generalization is to identify common code
fragments that can be turned into functions. Then, replace the users of
the common code with function calls.
If we wanted to do this in GCC, it might well make sense to do this at
the same place we presently do inlining. Some toolchains do it in the
linker, at the level of assembly code.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713