public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
       [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-01 12:08 ` jakub at gcc dot gnu.org
  2011-01-22 17:31 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-10-01 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.5                       |4.4.6


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
       [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
  2010-10-01 12:08 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation jakub at gcc dot gnu.org
@ 2011-01-22 17:31 ` hubicka at gcc dot gnu.org
  2011-01-22 21:51 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-22 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #19 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-22 16:24:36 UTC ---
The profile is consistent, but due to recursive inlining we create deep loop
nest in the function making profile estimation to believe that code outside the
loop nest is cold.
Path for PR44334 should cure this testcase too.  I will look into if I can get
the testsuite updated and the patch comitted.


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
       [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
  2010-10-01 12:08 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation jakub at gcc dot gnu.org
  2011-01-22 17:31 ` hubicka at gcc dot gnu.org
@ 2011-01-22 21:51 ` hubicka at gcc dot gnu.org
  2011-01-22 21:59 ` hubicka at gcc dot gnu.org
  2011-01-22 22:10 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-22 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-22 21:45:23 UTC ---
Patch posted http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01597.html
I tested that is seems to bring us back to the 4.3 speed
jh@gcc10:~/trunk/build/gcc$ time ./a.out 45
fib(45)=1134903170

real    0m7.978s
user    0m7.976s
sys     0m0.000s
jh@gcc10:~/trunk/build/gcc$ gcc-4.3
Display all 708 possibilities? (y or n)
jh@gcc10:~/trunk/build/gcc$ gcc-4.3 -O3 tt.c
jh@gcc10:~/trunk/build/gcc$ time ./a.out 45
fib(45)=1134903170

real    0m7.902s
user    0m7.888s
sys     0m0.000s

and before patch
jh@gcc10:~/trunk/build2/gcc$ time ./a.out 45
fib(45)=1134903170

real    0m8.222s
user    0m8.213s
sys     0m0.000s


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
       [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-01-22 21:51 ` hubicka at gcc dot gnu.org
@ 2011-01-22 21:59 ` hubicka at gcc dot gnu.org
  2011-01-22 22:10 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-22 21:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #22 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-22 21:49:51 UTC ---
Fixed.


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
       [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-01-22 21:59 ` hubicka at gcc dot gnu.org
@ 2011-01-22 22:10 ` hubicka at gcc dot gnu.org
  4 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2011-01-22 22:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Jan Hubicka <hubicka at gcc dot gnu.org> 2011-01-22 21:47:43 UTC ---
Author: hubicka
Date: Sat Jan 22 21:47:40 2011
New Revision: 169136

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169136
Log:
    PR tree-optimization/43884
    PR lto/44334
    * predict.c (maybe_hot_frequency_p): Use entry block frequency as an base.
    * doc/invoke.texi (hot-bb-frequency-fraction): Update docs.
    * gcc.dg/autopar/outer-2.c: Increase array size.
    * gcc.dg/tree-ssa/ldist-pr45948.c: Update test.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/predict.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/autopar/outer-2.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
                   ` (5 preceding siblings ...)
  2010-05-19 12:37 ` rguenth at gcc dot gnu dot org
@ 2010-06-25 14:10 ` hjl dot tools at gmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-06-25 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from hjl dot tools at gmail dot com  2010-06-25 14:09 -------
(In reply to comment #17)
> Subject: Re:  [4.4/4.5/4.6 Regression] Performance
>         degradation for simple fibonacci numbers calculation
> 
> This is not correct, when profile is guessed we should look into the
> frequencies.
> I guess profile is wrong after tail recursion elimination or horked by
> recursive inlining,
> I will take a look.
> 

Any updates?


-- 


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
                   ` (4 preceding siblings ...)
  2010-04-30  9:01 ` jakub at gcc dot gnu dot org
@ 2010-05-19 12:37 ` rguenth at gcc dot gnu dot org
  2010-06-25 14:10 ` hjl dot tools at gmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-19 12:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Version|unknown                     |4.4.3


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
                   ` (3 preceding siblings ...)
  2010-04-29  9:27 ` hubicka at ucw dot cz
@ 2010-04-30  9:01 ` jakub at gcc dot gnu dot org
  2010-05-19 12:37 ` rguenth at gcc dot gnu dot org
  2010-06-25 14:10 ` hjl dot tools at gmail dot com
  6 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-04-30  9:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.4                       |4.4.5


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
                   ` (2 preceding siblings ...)
  2010-04-29  2:20 ` hjl dot tools at gmail dot com
@ 2010-04-29  9:27 ` hubicka at ucw dot cz
  2010-04-30  9:01 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2010-04-29  9:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from hubicka at ucw dot cz  2010-04-29 09:27 -------
Subject: Re:  [4.4/4.5/4.6 Regression] Performance
        degradation for simple fibonacci numbers calculation

This is not correct, when profile is guessed we should look into the
frequencies.
I guess profile is wrong after tail recursion elimination or horked by
recursive inlining,
I will take a look.

Honza


-- 


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
  2010-04-26 18:55 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation hjl dot tools at gmail dot com
  2010-04-29  1:21 ` hjl dot tools at gmail dot com
@ 2010-04-29  2:20 ` hjl dot tools at gmail dot com
  2010-04-29  9:27 ` hubicka at ucw dot cz
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29  2:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from hjl dot tools at gmail dot com  2010-04-29 02:20 -------
This patch:

diff --git a/gcc/predict.c b/gcc/predict.c
index eb5ddef..a05e796 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -120,7 +120,8 @@ maybe_hot_frequency_p (int freq)
       if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT)
         return true;
     }
-  if (profile_status == PROFILE_ABSENT)
+  if (profile_status == PROFILE_ABSENT
+      || profile_status == PROFILE_GUESSED)
     return true;
   if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))
     return false;

seems to work for me. Since profile_status is PROFILE_GUESSED,
it may be hot as shown here.


-- 


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
  2010-04-26 18:55 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation hjl dot tools at gmail dot com
@ 2010-04-29  1:21 ` hjl dot tools at gmail dot com
  2010-04-29  2:20 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-29  1:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from hjl dot tools at gmail dot com  2010-04-29 01:20 -------
Revision 139756:

http://gcc.gnu.org/ml/gcc-cvs/2008-08/msg01321.html

also contributed to this regression.

[hjl@gnu-26 rrs]$ ./131573/usr/bin/gcc -O3 pr43884.c
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.237s
user    0m3.236s
sys     0m0.000s
[hjl@gnu-26 rrs]$ ./131573/usr/bin/gcc -O3 pr43884.c -m32
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.667s
user    0m3.665s
sys     0m0.001s
[hjl@gnu-26 rrs]$ ./131576/usr/bin/gcc -O3 pr43884.c 
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.687s
user    0m3.685s
sys     0m0.000s
[hjl@gnu-26 rrs]$ ./131576/usr/bin/gcc -O3 pr43884.c -m32
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.685s
user    0m3.683s
sys     0m0.001s
[hjl@gnu-26 rrs]$ 

[hjl@gnu-26 rrs]$ ./139755/usr/bin/gcc -O3 pr43884.c 
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.261s
user    0m3.260s
sys     0m0.002s
[hjl@gnu-26 rrs]$ ./139755/usr/bin/gcc -O3 pr43884.c -m32
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.043s
user    0m3.041s
sys     0m0.001s
[hjl@gnu-26 rrs]$ ./139756/usr/bin/gcc -O3 pr43884.c 
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.909s
user    0m3.906s
sys     0m0.001s
[hjl@gnu-26 rrs]$ ./139756/usr/bin/gcc -O3 pr43884.c -m32
[hjl@gnu-26 rrs]$ time ./a.out 45
fib(45)=1134903170

real    0m3.883s
user    0m3.881s
sys     0m0.000s
[hjl@gnu-26 rrs]$ 


-- 


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


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

* [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation
  2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
@ 2010-04-26 18:55 ` hjl dot tools at gmail dot com
  2010-04-29  1:21 ` hjl dot tools at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-04-26 18:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from hjl dot tools at gmail dot com  2010-04-26 18:54 -------
It is caused by revision 131576:

http://gcc.gnu.org/ml/gcc-cvs/2008-01/msg00337.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.4/4.5/4.6 Regression]    |[4.4/4.5/4.6 Regression]
                   |Performance degradation for |Performance degradation for
                   |simple fibonacci numbers    |simple fibonacci numbers
                   |calculation due to extra    |calculation
                   |stack alignment             |


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


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

end of thread, other threads:[~2011-01-22 21:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43884-4@http.gcc.gnu.org/bugzilla/>
2010-10-01 12:08 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation jakub at gcc dot gnu.org
2011-01-22 17:31 ` hubicka at gcc dot gnu.org
2011-01-22 21:51 ` hubicka at gcc dot gnu.org
2011-01-22 21:59 ` hubicka at gcc dot gnu.org
2011-01-22 22:10 ` hubicka at gcc dot gnu.org
2010-04-25  7:18 [Bug c++/43884] New: Performance degradation of the simple example (fibonacci) 4.3.3->4.5.0 yuri at tsoft dot com
2010-04-26 18:55 ` [Bug target/43884] [4.4/4.5/4.6 Regression] Performance degradation for simple fibonacci numbers calculation hjl dot tools at gmail dot com
2010-04-29  1:21 ` hjl dot tools at gmail dot com
2010-04-29  2:20 ` hjl dot tools at gmail dot com
2010-04-29  9:27 ` hubicka at ucw dot cz
2010-04-30  9:01 ` jakub at gcc dot gnu dot org
2010-05-19 12:37 ` rguenth at gcc dot gnu dot org
2010-06-25 14:10 ` hjl dot tools at gmail dot com

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).