public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/45671]  New: Reassociate expressions for greater parallelism
@ 2010-09-14 20:14 pthaugen at gcc dot gnu dot org
  2010-09-15  4:29 ` [Bug tree-optimization/45671] " hjl dot tools at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: pthaugen at gcc dot gnu dot org @ 2010-09-14 20:14 UTC (permalink / raw)
  To: gcc-bugs

The following testcase demonstrates where reassociation/regrouping of
expressions could result in greater parallelism for processors that have
multiple arithmetic execution units.

int myfunction (int a, int b, int c, int d, int e, int f, int g, int h) {
  int ret;

  ret = a + b + c + d + e + f + g + h;
  return ret;

}

Compiling with -O3 results in a series of dependent add instructions to
accumulate the sum.

        add 4,3,4
        add 4,4,5
        add 4,4,6
        add 4,4,7
        add 4,4,8
        add 4,4,9
        add 4,4,10


If we regrouped to (a+b)+(c+d)+... we can do multiple adds in parallel on
different execution units.


-- 
           Summary: Reassociate expressions for greater parallelism
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pthaugen at gcc dot gnu dot org
 GCC build triplet: powerpc64-unknown-linux-gnu
  GCC host triplet: powerpc64-unknown-linux-gnu
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

* [Bug tree-optimization/45671] Reassociate expressions for greater parallelism
  2010-09-14 20:14 [Bug tree-optimization/45671] New: Reassociate expressions for greater parallelism pthaugen at gcc dot gnu dot org
@ 2010-09-15  4:29 ` hjl dot tools at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-09-15  4:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2010-09-15 04:29 -------


*** This bug has been marked as a duplicate of 44382 ***


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
  GCC build triplet|powerpc64-unknown-linux-gnu |
   GCC host triplet|powerpc64-unknown-linux-gnu |
 GCC target triplet|powerpc64-unknown-linux-gnu |
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2010-09-15  4:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-14 20:14 [Bug tree-optimization/45671] New: Reassociate expressions for greater parallelism pthaugen at gcc dot gnu dot org
2010-09-15  4:29 ` [Bug tree-optimization/45671] " 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).