This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add minimum insn match to crossjump





The following patch imposes a minimum threshhold on the number of
instructions to match before proceeding with the crossjump optimization in
cases where the block we're crossjumping from is not totally matched.  The
thought here is to make sure there is some minimum number of instructions
in the new block to make adding an extra branch along the one path worth
while, it should also give the scheduler a little more to work with in the
new block.  Runs of SPECInt and Skidmarks showed some minor improvement.

I've bootstrapped/regtested on powerpc64-unknown-linux-gnu with no
regressions.

OK for mainline?

-Pat



2004-06-28  Pat Haugen  <pthaugen@us.ibm.com>

      * cfgcleanup.c (try_crossjump_to_edge): Add minimum insn match
      threshhold.

Index: gcc/cfgcleanup.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.113
diff -c -3 -p -r1.113 cfgcleanup.c
*** gcc/cfgcleanup.c    13 May 2004 06:39:32 -0000    1.113
--- gcc/cfgcleanup.c    25 Jun 2004 20:01:37 -0000
*************** try_crossjump_to_edge (int mode, edge e1
*** 1549,1555 ****

    /* ... and part the second.  */
    nmatch = flow_find_cross_jump (mode, src1, src2, &newpos1, &newpos2);
!   if (!nmatch)
      return false;

  #ifndef CASE_DROPS_THROUGH
--- 1549,1560 ----

    /* ... and part the second.  */
    nmatch = flow_find_cross_jump (mode, src1, src2, &newpos1, &newpos2);
!
!   /* Don't proceed with the crossjump unless we found a sufficient number
!      of matching instructions or the 'from' block was totally matched
!      (such that its predecessors will hopefully be redirected and the
!      block removed).  */
!   if ((nmatch < 5) && (newpos1 != BB_HEAD (src1)))
      return false;

  #ifndef CASE_DROPS_THROUGH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]