public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-10 18:04 ` hubicka at gcc dot gnu.org
  2010-11-10 18:06 ` hubicka at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: hubicka at gcc dot gnu.org @ 2010-11-10 18:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus@net-b.de, hubicka at
                   |                            |gcc dot gnu.org, kargl at
                   |                            |gcc dot gnu.org

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> 2010-11-10 18:04:17 UTC ---
Function is static, that seems OK.
We inline it with ./xgcc -B ./ -O2 t.f90 -S  --param large-stack-frame=2000

We are somewhat stupid here, since the call happens all the time and thus stack
frame growth limits don't need to apply.  I can implement this if this is
common case for fortran.  How commonly we run into these io structs?
We can also bump large stack limits to make fortran I/O to fit in.

Honza


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
  2010-11-10 18:04 ` [Bug tree-optimization/34940] contained subroutines called only once are not inlined hubicka at gcc dot gnu.org
@ 2010-11-10 18:06 ` hubicka at gcc dot gnu.org
  2010-11-10 19:13 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: hubicka at gcc dot gnu.org @ 2010-11-10 18:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |hubicka at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2010-11-10 18:06:49 UTC ---
Assigning to myself. I plan to do IPA noreturn discovery that will track when
function has to be called and we can use that info there too.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
  2010-11-10 18:04 ` [Bug tree-optimization/34940] contained subroutines called only once are not inlined hubicka at gcc dot gnu.org
  2010-11-10 18:06 ` hubicka at gcc dot gnu.org
@ 2010-11-10 19:13 ` jakub at gcc dot gnu.org
  2010-11-10 22:36 ` hubicka at ucw dot cz
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-10 19:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-10 19:12:52 UTC ---
The large Fortran IO parameter block should actually be always coalesceable
with all other IO parameter blocks in the same function (including all inlined
IO), as it should be live just around each single IO and die at the end of IO
block.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-11-10 19:13 ` jakub at gcc dot gnu.org
@ 2010-11-10 22:36 ` hubicka at ucw dot cz
  2010-11-10 22:43 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: hubicka at ucw dot cz @ 2010-11-10 22:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #9 from Jan Hubicka <hubicka at ucw dot cz> 2010-11-10 22:35:46 UTC ---
The inline heuristics should take that into account. But at the moment
io block simply always prevent inlining function with IO into function without
IO.
We consider function with more than 256 bytes of stack frame to have large
frame
and those are.  Why it needs that much of stack space at first place?


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2010-11-10 22:36 ` hubicka at ucw dot cz
@ 2010-11-10 22:43 ` jakub at gcc dot gnu.org
  2010-11-10 22:50 ` hubicka at ucw dot cz
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-10 22:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-10 22:43:31 UTC ---
Because one IO command is split into several function calls and a state has to
be preserved in between those.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2010-11-10 22:43 ` jakub at gcc dot gnu.org
@ 2010-11-10 22:50 ` hubicka at ucw dot cz
  2010-11-10 22:54 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: hubicka at ucw dot cz @ 2010-11-10 22:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #11 from Jan Hubicka <hubicka at ucw dot cz> 2010-11-10 22:50:08 UTC ---
Ok, it might be interesting to run some fortran benchmarks with the
large-stack-frame parameter
bumped up.  If it helps, I think we can just do so for 4.6.x


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2010-11-10 22:50 ` hubicka at ucw dot cz
@ 2010-11-10 22:54 ` rguenth at gcc dot gnu.org
  2010-11-10 22:55 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-10 22:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-10 22:53:46 UTC ---
Note that the IO block escapes and thus cannot be coalesced with others in
the same function.  I had a frontend patch to re-use the same IO struct
across multiple calls but that was rejected on the grounds of future
implementation of async IO.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2010-11-10 22:54 ` rguenth at gcc dot gnu.org
@ 2010-11-10 22:55 ` rguenth at gcc dot gnu.org
  2010-11-10 23:05 ` hubicka at ucw dot cz
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-10 22:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-10 22:54:51 UTC ---
Btw, the old "kill stmt" idea would be a useful thing to insert for the
frontend
to mark the end of life of IO struct contents.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2010-11-10 22:55 ` rguenth at gcc dot gnu.org
@ 2010-11-10 23:05 ` hubicka at ucw dot cz
  2012-06-29 14:53 ` Joost.VandeVondele at mat dot ethz.ch
  2013-03-29  8:58 ` Joost.VandeVondele at mat dot ethz.ch
  10 siblings, 0 replies; 17+ messages in thread
From: hubicka at ucw dot cz @ 2010-11-10 23:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

--- Comment #14 from Jan Hubicka <hubicka at ucw dot cz> 2010-11-10 23:05:25 UTC ---
> Note that the IO block escapes and thus cannot be coalesced with others in
> the same function.  I had a frontend patch to re-use the same IO struct
> across multiple calls but that was rejected on the grounds of future
> implementation of async IO.

I think inline heuristics ignore this fact and just assume overlap across
sibling calls
that gets inlined.  Not terribly realistic but not terribly bad either.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2010-11-10 23:05 ` hubicka at ucw dot cz
@ 2012-06-29 14:53 ` Joost.VandeVondele at mat dot ethz.ch
  2013-03-29  8:58 ` Joost.VandeVondele at mat dot ethz.ch
  10 siblings, 0 replies; 17+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2012-06-29 14:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2008-01-23 11:27:01         |2012-06-29 11:27:01

--- Comment #15 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2012-06-29 14:52:44 UTC ---
no inlining with 4.8 either


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
       [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2012-06-29 14:53 ` Joost.VandeVondele at mat dot ethz.ch
@ 2013-03-29  8:58 ` Joost.VandeVondele at mat dot ethz.ch
  10 siblings, 0 replies; 17+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2013-03-29  8:58 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2012-06-29 11:27:01         |2013-03-29
                 CC|                            |Joost.VandeVondele at mat
                   |                            |dot ethz.ch
      Known to fail|                            |4.9.0

--- Comment #16 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2013-03-29 08:58:42 UTC ---
(In reply to comment #6)
> Function is static, that seems OK.
> We inline it with ./xgcc -B ./ -O2 t.f90 -S  --param large-stack-frame=2000
> 
> We are somewhat stupid here, since the call happens all the time and thus stack
> frame growth limits don't need to apply.  I can implement this if this is
> common case for fortran.  How commonly we run into these io structs?
> We can also bump large stack limits to make fortran I/O to fit in.
> 
> Honza

I think it would make sense to implement this, if easy enough. It could be a
common pattern for contained subroutines and private module procedures


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2008-01-23 17:57 ` jv244 at cam dot ac dot uk
@ 2008-12-29 14:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-29 14:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2008-01-23 16:21 ` jv244 at cam dot ac dot uk
@ 2008-01-23 17:57 ` jv244 at cam dot ac dot uk
  2008-12-29 14:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-01-23 17:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jv244 at cam dot ac dot uk  2008-01-23 17:22 -------
just a note, ifort does inline the function cs1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2008-01-23 14:38 ` rguenth at gcc dot gnu dot org
@ 2008-01-23 16:21 ` jv244 at cam dot ac dot uk
  2008-01-23 17:57 ` jv244 at cam dot ac dot uk
  2008-12-29 14:57 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 17+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-01-23 16:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jv244 at cam dot ac dot uk  2008-01-23 15:45 -------
(In reply to comment #2)
> It's considered too big and it's not static.
> 

not sure if my C is good enough to reply, but CS1 is visible only from within
the subroutine S1. That's somewhat similar to (or stricter than) 'static' ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
  2008-01-23 13:14 ` [Bug tree-optimization/34940] " steven at gcc dot gnu dot org
  2008-01-23 14:25 ` rguenth at gcc dot gnu dot org
@ 2008-01-23 14:38 ` rguenth at gcc dot gnu dot org
  2008-01-23 16:21 ` jv244 at cam dot ac dot uk
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-23 14:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-01-23 13:55 -------
Considering cs1 with 52 insns
 to be inlined into s1
 Estimated growth after inlined into all callees is -13 insns.
 Estimated badness is 86, frequency 1.00.
 Not inlining into s1:--param large-stack-frame-growth limit reached.

the fortran IO param structure is blowing the stack limit ;)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
  2008-01-23 13:14 ` [Bug tree-optimization/34940] " steven at gcc dot gnu dot org
@ 2008-01-23 14:25 ` rguenth at gcc dot gnu dot org
  2008-01-23 14:38 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-23 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-01-23 13:54 -------
It's considered too big and it's not static.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [Bug tree-optimization/34940] contained subroutines called only once are not inlined
  2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
@ 2008-01-23 13:14 ` steven at gcc dot gnu dot org
  2008-01-23 14:25 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-01-23 13:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from steven at gcc dot gnu dot org  2008-01-23 11:27 -------
It is not always a win.  A function called once on a cold path should not be
inlined for e.g. icache reasons.

For your test case however, CS1 should have been inlined.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-23 11:27:01
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34940


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-03-29  8:58 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-34940-4@http.gcc.gnu.org/bugzilla/>
2010-11-10 18:04 ` [Bug tree-optimization/34940] contained subroutines called only once are not inlined hubicka at gcc dot gnu.org
2010-11-10 18:06 ` hubicka at gcc dot gnu.org
2010-11-10 19:13 ` jakub at gcc dot gnu.org
2010-11-10 22:36 ` hubicka at ucw dot cz
2010-11-10 22:43 ` jakub at gcc dot gnu.org
2010-11-10 22:50 ` hubicka at ucw dot cz
2010-11-10 22:54 ` rguenth at gcc dot gnu.org
2010-11-10 22:55 ` rguenth at gcc dot gnu.org
2010-11-10 23:05 ` hubicka at ucw dot cz
2012-06-29 14:53 ` Joost.VandeVondele at mat dot ethz.ch
2013-03-29  8:58 ` Joost.VandeVondele at mat dot ethz.ch
2008-01-23 13:14 [Bug tree-optimization/34940] New: " jv244 at cam dot ac dot uk
2008-01-23 13:14 ` [Bug tree-optimization/34940] " steven at gcc dot gnu dot org
2008-01-23 14:25 ` rguenth at gcc dot gnu dot org
2008-01-23 14:38 ` rguenth at gcc dot gnu dot org
2008-01-23 16:21 ` jv244 at cam dot ac dot uk
2008-01-23 17:57 ` jv244 at cam dot ac dot uk
2008-12-29 14:57 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).