public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
@ 2005-10-18  9:48 ` bonzini at gcc dot gnu dot org
  2005-10-18  9:55 ` bonzini at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-18  9:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from bonzini at gcc dot gnu dot org  2005-10-18 09:48 -------
Can anybody try killloop-branch?  Just a wild guess.


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
  2005-10-18  9:48 ` [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code bonzini at gcc dot gnu dot org
@ 2005-10-18  9:55 ` bonzini at gcc dot gnu dot org
  2005-10-18 10:07 ` bonzini at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-18  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from bonzini at gcc dot gnu dot org  2005-10-18 09:55 -------
There is also a (minor) register allocation problem in both outputs:

8048392: 0f be 01                movsbl (%ecx),%eax    !   |
8048395: 0f be 13                movsbl (%ebx),%edx    !   |
8048398: 29 c2                   sub    %eax,%edx      !   |
804839a: 89 d0                   mov    %edx,%eax      !   |
804839c: 74 e2                   je     8048380        ! --+

This could obviously become

8048392: 0f be 11                movsbl (%ecx),%edx
8048395: 0f be 03                movsbl (%ebx),%eax
8048398: 2b c2                   sub    %edx,%eax
804839c: 74 e2                   je     8048380


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
  2005-10-18  9:48 ` [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code bonzini at gcc dot gnu dot org
  2005-10-18  9:55 ` bonzini at gcc dot gnu dot org
@ 2005-10-18 10:07 ` bonzini at gcc dot gnu dot org
  2005-10-18 11:41 ` bonzini at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-18 10:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from bonzini at gcc dot gnu dot org  2005-10-18 10:07 -------
The code I get from -mbranch-cost=1 is extremely similar to what 3.2.2
produced:

.L7:
        cmpl    %ebx, %edi
        jae     .L2
        cmpl    %ecx, %esi
        jae     .L2
        decl    %ebx
        movsbl  -1(%ecx),%eax
        decl    %ecx
        movsbl  (%ebx),%edx
        subl    %eax, %edx
        movl    %edx, %eax
        je      .L7
.L2:

The front-end is correctly producing a TRUTH_AND_EXPR, i.e. the
short-circuiting is not required.  RTL expansion will use jae (short-circuited
evaluation) or seta, depending on the branch cost.

However, the tuning here is wrong because on a pentium4 I do get a 40% speedup
from -mbranch-cost=1.


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-18 10:07 ` bonzini at gcc dot gnu dot org
@ 2005-10-18 11:41 ` bonzini at gcc dot gnu dot org
  2005-10-18 16:04 ` bonzini at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-18 11:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from bonzini at gcc dot gnu dot org  2005-10-18 11:41 -------
Created an attachment (id=10016)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10016&action=view)
patch to fix the bug

Indeed, RTL expansion will use jae (short-circuited evaluation) or seta,
depending on the branch cost, but in a very involuted way which screws up the
tuning.

This patch makes it more direct.


-- 

bonzini at gcc dot gnu dot org changed:

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


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2005-10-18 11:41 ` bonzini at gcc dot gnu dot org
@ 2005-10-18 16:04 ` bonzini at gcc dot gnu dot org
  2005-10-19 10:37 ` cvs-commit at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-18 16:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from bonzini at gcc dot gnu dot org  2005-10-18 16:04 -------
The patch is not good because I forgot to check fallthrough edges.  The code I
added goes above, just before "case CALL_EXPR:".

Restarting a bootstrap with a correct patch.


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2005-10-18 16:04 ` bonzini at gcc dot gnu dot org
@ 2005-10-19 10:37 ` cvs-commit at gcc dot gnu dot org
  2005-10-19 10:41 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-19 10:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from cvs-commit at gcc dot gnu dot org  2005-10-19 10:37 -------
Subject: Bug 19672

CVSROOT:        /cvs/gcc
Module name:    gcc
Changes by:     bonzini@gcc.gnu.org     2005-10-19 10:37:31

Modified files:
        gcc            : ChangeLog dojump.c 

Log message:
        2005-10-18  Paolo Bonzini  <bonzini@gnu.org>

        PR #19672
        * dojump.c (do_jump): Handle TRUTH_AND_EXPR and TRUTH_OR_EXPR here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10182&r2=2.10183
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dojump.c.diff?cvsroot=gcc&r1=1.42&r2=1.43


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2005-10-19 10:37 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-19 10:41 ` cvs-commit at gcc dot gnu dot org
  2005-10-19 10:50 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-19 10:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from cvs-commit at gcc dot gnu dot org  2005-10-19 10:41 -------
Subject: Bug 19672

CVSROOT:        /cvs/gcc
Module name:    gcc
Branch:         gcc-4_0-branch
Changes by:     bonzini@gcc.gnu.org     2005-10-19 10:41:09

Modified files:
        gcc            : dojump.c ChangeLog 

Log message:
        2005-10-18  Paolo Bonzini  <bonzini@gnu.org>

        PR #19672
        * dojump.c (do_jump): Handle TRUTH_AND_EXPR and TRUTH_OR_EXPR here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dojump.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.37.8.1&r2=1.37.8.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.470&r2=2.7592.2.471


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2005-10-19 10:41 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-19 10:50 ` cvs-commit at gcc dot gnu dot org
  2005-10-19 10:57 ` bonzini at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-10-19 10:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from cvs-commit at gcc dot gnu dot org  2005-10-19 10:50 -------
Subject: Bug 19672

CVSROOT:        /cvs/gcc
Module name:    gcc
Branch:         gcc-3_4-branch
Changes by:     bonzini@gcc.gnu.org     2005-10-19 10:49:57

Modified files:
        gcc            : ChangeLog dojump.c 

Log message:
        2005-10-19  Paolo Bonzini  <bonzini@gnu.org>

        PR #19672
        * dojump.c (do_jump): Handle TRUTH_AND_EXPR and TRUTH_OR_EXPR
        like TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR, if the branch cost
        is low enough.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.923&r2=2.2326.2.924
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dojump.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.9.4.2&r2=1.9.4.3


-- 


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2005-10-19 10:50 ` cvs-commit at gcc dot gnu dot org
@ 2005-10-19 10:57 ` bonzini at gcc dot gnu dot org
  2005-10-19 11:40 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-10-19 10:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from bonzini at gcc dot gnu dot org  2005-10-19 10:57 -------
Patches committed to all active branches.


-- 

bonzini at gcc dot gnu dot org changed:

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


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


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

* [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2005-10-19 10:57 ` bonzini at gcc dot gnu dot org
@ 2005-10-19 11:40 ` pinskia at gcc dot gnu dot org
  2005-11-05 12:15 ` [Bug target/19672] [3.4] " bonzini at gcc dot gnu dot org
  2005-11-21  2:26 ` [Bug target/19672] [3.4 Regression] " gdr at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-19 11:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |3.4.5


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


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

* [Bug target/19672] [3.4] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2005-10-19 11:40 ` pinskia at gcc dot gnu dot org
@ 2005-11-05 12:15 ` bonzini at gcc dot gnu dot org
  2005-11-21  2:26 ` [Bug target/19672] [3.4 Regression] " gdr at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: bonzini at gcc dot gnu dot org @ 2005-11-05 12:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from bonzini at gcc dot gnu dot org  2005-11-05 12:15 -------
Patch had to be reverted on 3.4


-- 

bonzini at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
      Known to fail|3.3.3 3.4.0 4.0.0 4.1.0     |3.3.3 3.4.5 4.0.2
      Known to work|2.95.3 3.2.3                |2.95.3 3.2.3 4.0.3 4.1.0
         Resolution|FIXED                       |
            Summary|[3.4/4.0/4.1 Regression]    |[3.4] Performance regression
                   |Performance regression in   |in simple loop code
                   |simple loop code            |


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


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

* [Bug target/19672] [3.4 Regression] Performance regression in simple loop code
       [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2005-11-05 12:15 ` [Bug target/19672] [3.4] " bonzini at gcc dot gnu dot org
@ 2005-11-21  2:26 ` gdr at gcc dot gnu dot org
  11 siblings, 0 replies; 12+ messages in thread
From: gdr at gcc dot gnu dot org @ 2005-11-21  2:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from gdr at gcc dot gnu dot org  2005-11-21 02:26 -------
Fixed for 4.0.x and higher.
Won't fix in 3.4.x


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|3.4.5                       |4.0.3


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


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

end of thread, other threads:[~2005-11-21  2:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19672-8689@http.gcc.gnu.org/bugzilla/>
2005-10-18  9:48 ` [Bug target/19672] [3.4/4.0/4.1 Regression] Performance regression in simple loop code bonzini at gcc dot gnu dot org
2005-10-18  9:55 ` bonzini at gcc dot gnu dot org
2005-10-18 10:07 ` bonzini at gcc dot gnu dot org
2005-10-18 11:41 ` bonzini at gcc dot gnu dot org
2005-10-18 16:04 ` bonzini at gcc dot gnu dot org
2005-10-19 10:37 ` cvs-commit at gcc dot gnu dot org
2005-10-19 10:41 ` cvs-commit at gcc dot gnu dot org
2005-10-19 10:50 ` cvs-commit at gcc dot gnu dot org
2005-10-19 10:57 ` bonzini at gcc dot gnu dot org
2005-10-19 11:40 ` pinskia at gcc dot gnu dot org
2005-11-05 12:15 ` [Bug target/19672] [3.4] " bonzini at gcc dot gnu dot org
2005-11-21  2:26 ` [Bug target/19672] [3.4 Regression] " gdr 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).