This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Tree inlining for the C front end (part 1 of 3)
On Sep 24, 2001, Alexandre Oliva <aoliva@redhat.com> wrote:
> The plan remains, with patches 2 and 3 to follow this one in a matter
> of seconds, but I decided to put in a bit of addition stuff into patch
^al
> #1 (LANG_DISREGARD_INLINE_LIMITS) and name the hooks and hook types
> more uniformly.
Except that the change to inlinable_function_p that took advantage of
and justified LANG_DISREGARD_INLINE_LIMITS somehow didn't make it to
the patch I posted. Here's a patch that adds applies after
tree-inline-1.patch to get the desired result, and a patch file that
fixes tree-inline-2.patch so that it applies cleanly afterwards,
preserving the fix.
--- gcc/cp/optimize.c 2001/09/24 19:50:30
+++ gcc/cp/optimize.c 2001/09/25 10:59:02
@@ -632,2 +632,4 @@
- function to eat up half of our budget. */
- else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
+ function to eat up half of our budget. Make special allowance
+ for extern inline functions, though. */
+ else if (! LANG_DISREGARD_INLINE_LIMITS (fn)
+ && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
@@ -649,2 +651,3 @@
- if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
- > MAX_INLINE_INSNS
+ if (! LANG_DISREGARD_INLINE_LIMITS (fn)
+ && ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
+ > MAX_INLINE_INSNS)
39,40c38,39
< --- gcc/tree-inline.c Mon Sep 24 12:49:47 2001
< +++ gcc/tree-inline.c Mon Sep 24 12:55:48 2001
---
> --- gcc/tree-inline.c Tue Sep 25 03:59:00 2001
> +++ gcc/tree-inline.c Tue Sep 25 03:56:29 2001
56c55
< @@ -42,0 +57,1303 @@
---
> @@ -43,0 +58,1306 @@
649,650c648,651
< + function to eat up half of our budget. */
< + else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
---
> + function to eat up half of our budget. Make special allowance
> + for extern inline functions, though. */
> + else if (! LANG_DISREGARD_INLINE_LIMITS (fn)
> + && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
666,667c667,669
< + if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
< + > MAX_INLINE_INSNS
---
> + if (! LANG_DISREGARD_INLINE_LIMITS (fn)
> + && ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
> + > MAX_INLINE_INSNS)
1360,1361c1362,1363
< --- gcc/cp/optimize.c 2001/09/24 19:50:30
< +++ gcc/cp/optimize.c 2001/09/24 19:56:19
---
> --- gcc/cp/optimize.c 2001/09/25 10:59:02
> +++ gcc/cp/optimize.c 2001/09/25 10:56:31
1427c1429
< @@ -107,870 +43,0 @@
---
> @@ -107,873 +43,0 @@
1953,1954c1955,1958
< - function to eat up half of our budget. */
< - else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
---
> - function to eat up half of our budget. Make special allowance
> - for extern inline functions, though. */
> - else if (! LANG_DISREGARD_INLINE_LIMITS (fn)
> - && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2)
1970,1971c1974,1976
< - if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
< - > MAX_INLINE_INSNS
---
> - if (! LANG_DISREGARD_INLINE_LIMITS (fn)
> - && ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT
> - > MAX_INLINE_INSNS)
2298c2303
< @@ -1067,32 +133,0 @@
---
> @@ -1070,32 +133,0 @@
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me