public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18768] New: Missed ivopts opportunity
@ 2004-12-01 21:18 pthaugen at us dot ibm dot com
  2004-12-01 21:22 ` [Bug tree-optimization/18768] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pthaugen at us dot ibm dot com @ 2004-12-01 21:18 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2005-03-03  3:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-01 21:18 [Bug tree-optimization/18768] New: Missed ivopts opportunity pthaugen at us dot ibm dot com
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

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