public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anton at mips dot complang dot tuwien dot ac dot at" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/15242] [3.3/3.4 regression] pessimization of "goto *"
Date: Sat, 12 Mar 2005 21:38:00 -0000	[thread overview]
Message-ID: <20050312213846.16715.qmail@sourceware.org> (raw)
In-Reply-To: <20040501142654.15242.anton@mips.complang.tuwien.ac.at>


------- Additional Comments From anton at mips dot complang dot tuwien dot ac dot at  2005-03-12 21:38 -------
Subject: Re:  [3.3/3.4 regression] pessimization of "goto *"

steven at gcc dot gnu dot org wrote:
> 
> 
> ------- Additional Comments From steven at gcc dot gnu dot org  2005-03-10 12:48 -------
> > Maybe there should be another combining pass after the duplication
> > of the indirect jumps.  Should I create another PR for this?
> 
> There should not be another "combining" pass (you really mean constant
> propagation).

I meant "Instruction combination (`combine.c')".  Not sure if this is
replaced by something else in the recent gccs.  Why do you think I
mean constant propagation?

>  This new unfactoring stuff runs after register allocation,
> so such a pass would not really help, except maybe to make the code look
> prettier to you.

Ouch.  No way to fix that?  That's the cost we wanted to avoid.

> But, is this:
> 
>         mov    0xfffffffc(%ebx),%eax
>         jmp    *%eax
> 
> slower than this:
> 
>         jmp    *0xfffffffc(%ebx)
> 
> or have you not tried that (e.g. by hacking the assembly by hand)?

Ok, I hacked the assembly by hand, and this is what I got:

All numbers are user times in seconds for gforth-fast-0.6.2:

Pentium-4 2.26 GHz (i386 code):
           no-dynamic  no-super   dynamic    
combined?  yes  no     yes  no	  yes  no    
siev       0.47 0.49   0.36 0.36  0.33 0.33  
bubble     0.81 0.81   0.52 0.53  0.47 0.47  
matrix     1.03 1.01   0.30 0.30  0.36 0.35  
fib        0.70 0.68   0.75 0.60  0.53 0.58  

Opteron 2GHz (i386 code):
           no-dynamic  no-super   dynamic    
combined?  yes  no     yes  no	  yes  no    
siev       0.46 0.47   0.37 0.36  0.33 0.32
bubble     0.73	0.74   0.50 0.51  0.50 0.51
matrix     0.93	0.95   0.35 0.34  0.31 0.32
fib        0.63	0.64   0.49 0.50  0.44 0.45

"No-super" performs the same number of indirect branches (and anything
else) as "no-dynamic", but has better branch prediction.  "Dynamic" is
like "no-super", but eliminates many of the indirect branches.

So, overall the instruction combination alone does not make much of a
difference on these CPUs.

- anton



-- 


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


  parent reply	other threads:[~2005-03-12 21:38 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-01 14:27 [Bug optimization/15242] New: " anton at mips dot complang dot tuwien dot ac dot at
2004-05-01 14:30 ` [Bug optimization/15242] " anton at mips dot complang dot tuwien dot ac dot at
2004-05-01 14:38 ` pinskia at gcc dot gnu dot org
2004-05-01 14:41 ` pinskia at gcc dot gnu dot org
2004-05-01 14:42 ` pinskia at gcc dot gnu dot org
2004-05-01 15:03 ` anton at a0 dot complang dot tuwien dot ac dot at
2004-05-01 15:13 ` pinskia at gcc dot gnu dot org
2004-05-02  7:24 ` anton at a0 dot complang dot tuwien dot ac dot at
2004-05-02 19:06 ` jsm at polyomino dot org dot uk
2004-05-04 15:06 ` anton at a0 dot complang dot tuwien dot ac dot at
2004-05-06  4:45 ` pinskia at gcc dot gnu dot org
2004-05-23  9:40 ` [Bug rtl-optimization/15242] " zlomek at gcc dot gnu dot org
2004-05-25  9:28 ` zlomek at gcc dot gnu dot org
2004-05-26 18:57 ` pinskia at gcc dot gnu dot org
2004-06-16  7:01 ` pinskia at gcc dot gnu dot org
2004-07-06 20:35 ` anton at mips dot complang dot tuwien dot ac dot at
2004-07-06 22:00 ` pinskia at gcc dot gnu dot org
2004-07-07  4:49 ` zlomj9am at artax dot karlin dot mff dot cuni dot cz
2004-07-07 13:34 ` zlomek at gcc dot gnu dot org
2004-07-08 13:03 ` anton at mips dot complang dot tuwien dot ac dot at
2004-07-16  6:50 ` zlomek at gcc dot gnu dot org
2004-07-16  7:01 ` zlomj9am at artax dot karlin dot mff dot cuni dot cz
2004-07-16  8:17 ` anton at mips dot complang dot tuwien dot ac dot at
2004-07-16  8:42 ` zlomj9am at artax dot karlin dot mff dot cuni dot cz
2004-10-03 20:25 ` bernd dot paysan at gmx dot de
2004-10-04 12:21 ` giovannibajo at libero dot it
2004-10-25 21:10 ` steven at gcc dot gnu dot org
2004-12-18 16:46 ` [Bug rtl-optimization/15242] [4.0 regression] " steven at gcc dot gnu dot org
2004-12-18 18:18 ` [Bug rtl-optimization/15242] [3.3/3.4/4.0 " pinskia at gcc dot gnu dot org
2005-01-26 17:28 ` steven at gcc dot gnu dot org
2005-01-27 13:45 ` pinskia at gcc dot gnu dot org
2005-02-01 10:04 ` cvs-commit at gcc dot gnu dot org
2005-02-01 10:11 ` [Bug rtl-optimization/15242] [3.3/3.4 " steven at gcc dot gnu dot org
2005-02-07 18:56 ` kazu at cs dot umass dot edu
2005-02-07 19:00 ` pinskia at gcc dot gnu dot org
2005-02-27 18:12 ` anton at mips dot complang dot tuwien dot ac dot at
2005-03-10 12:48 ` steven at gcc dot gnu dot org
2005-03-12 21:38 ` anton at mips dot complang dot tuwien dot ac dot at [this message]
2005-03-12 21:54 ` stevenb at suse dot de
2005-04-03 13:24 ` schwab at suse dot de
2005-04-07  9:03 ` schwab at suse dot de
2005-04-07 14:45 ` schwab at suse dot de
2005-05-19 17:36 ` mmitchel at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050312213846.16715.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).