public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/31375]  New: missed loop-if transformation / branch reduction.
@ 2007-03-27 12:56 pluto at agmk dot net
  2007-03-27 13:24 ` [Bug tree-optimization/31375] " rguenth at gcc dot gnu dot org
  2007-03-27 18:01 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: pluto at agmk dot net @ 2007-03-27 12:56 UTC (permalink / raw)
  To: gcc-bugs

long condition( void );
long f1( void );
long f2( void );

void foo( void )
{
        for ( ;; )
                if ( condition() )
                        f1();
                else
                        f2();
}

foo() could be transformed to bar():

void bar( void )
{
        long (* f[ 2 ])() = { &f2, &f1 };
        for ( ;; )
                f[ condition() ]();
}


-- 
           Summary: missed loop-if transformation / branch reduction.
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net


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


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

* [Bug tree-optimization/31375] missed loop-if transformation / branch reduction.
  2007-03-27 12:56 [Bug tree-optimization/31375] New: missed loop-if transformation / branch reduction pluto at agmk dot net
@ 2007-03-27 13:24 ` rguenth at gcc dot gnu dot org
  2007-03-27 18:01 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-03-27 13:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-03-27 14:24 -------
Uh, an indirect call is much more expensive in general unless you can prove
that the branch if (condition()) is completely random and so usually
mispredicted.


-- 


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


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

* [Bug tree-optimization/31375] missed loop-if transformation / branch reduction.
  2007-03-27 12:56 [Bug tree-optimization/31375] New: missed loop-if transformation / branch reduction pluto at agmk dot net
  2007-03-27 13:24 ` [Bug tree-optimization/31375] " rguenth at gcc dot gnu dot org
@ 2007-03-27 18:01 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-27 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2007-03-27 19:01 -------
This is not even a size win for either x86-linux or powerpc{,64}-linux-gnu so
closing as invalid.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2007-03-27 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-27 12:56 [Bug tree-optimization/31375] New: missed loop-if transformation / branch reduction pluto at agmk dot net
2007-03-27 13:24 ` [Bug tree-optimization/31375] " rguenth at gcc dot gnu dot org
2007-03-27 18:01 ` 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).