public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pthaugen at us dot ibm dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/18768] New: Missed ivopts opportunity
Date: Wed, 01 Dec 2004 21:18:00 -0000	[thread overview]
Message-ID: <20041201211816.18768.pthaugen@us.ibm.com> (raw)

Opening bug report per Zdeneck's request, snippets of email exchange follows:

=========
void f1 (void * coefPtr, double * dd)
{
  int  i,j;

  /* Cast of "coefPtr" results in poor code for this loop (missed strength
     reduction). */
  for (i = 0; i < 16; i++) {
    *(((double *) coefPtr) + i) = +0.0;
  }

  for (j = 0; j < 16; j++) {
    *(dd + j) = +0.0;
  }
}

=========

> this seems to be a problem with the cost function:
>
> Cost of strength reduction of the access =
>  Cost for incrementing the new induction variable:  8
>  Cost for increased register pressure: 4
>  Cost for the memory reference: 1
>
> Cost for expressing the access using i =
>  Cost for multiplication by 8:  12
>  Cost for the memory reference: 1 (addition of the result of
>    multiplications takes place in the address).
>
> The result is that it is not worthwhile to perform strength reduction.
> I will try to do something with the code that estimates cost of memory
> references, since it is quite wrong here.

could you please create a bugreport for this?  The things are a bit more
complicated than what I expected; there is actually no way how the
target could let ivopts know that DFmode address for (reg + reg) is more
expensive than just reg, in the current state.

-- 
           Summary: Missed ivopts opportunity
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pthaugen at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


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


             reply	other threads:[~2004-12-01 21:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-01 21:18 pthaugen at us dot ibm dot com [this message]
2004-12-01 21:22 ` [Bug tree-optimization/18768] " pinskia at gcc dot gnu dot org
2004-12-01 21:44 ` rakdver at gcc dot gnu dot org
2004-12-02 21:30 ` pthaugen at us dot ibm dot com
2004-12-02 21:56 ` pinskia at gcc dot gnu dot org
2005-03-03  3:07 ` pinskia 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=20041201211816.18768.pthaugen@us.ibm.com \
    --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).