This is the mail archive of the gcc@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]

Re: Ideas on basic block reordering location and frequency



  In message <200002141640.IAA10287@cse.cygnus.com>you write:
  > 
  > 
  > Jeff Law and I have discussed ideas about when the basic block reordering
  > code should happen for maximum benefit. Currently, we run the full
  > reordering pass just before jump2. However, as Jeff's comments indicate
  > (included below), it might also be useful to run a reduced version of
  > the pass earlier as well.
  > We would be interested in others comments or opinions on this.
If nobody else has comments, then my recommendation is to go ahead with
removing non-looping code from loops before the main loop optimizer runs.

The codegen benefits are real and it's a lot cleaner and more effective
than the half-hearted attempt done by loop.c right now:

  /* Now scan all insn's in the function.  If any JUMP_INSN branches into a
     loop that it is not contained within, that loop is marked invalid.
     If any INSN or CALL_INSN uses a label's address, then the loop containing
     that label is marked invalid, because it could be jumped into from
     anywhere.

     Also look for blocks of code ending in an unconditional branch that
     exits the loop.  If such a block is surrounded by a conditional
     branch around the block, move the block elsewhere (see below) and
     invert the jump to point to the code block.  This may eliminate a
     label in our loop and will simplify processing by both us and a
     possible second cse pass.  */
The second comment describes the half-hearted attempt of loop.c to do
this kind of transformation.  There's several pages of code that can
disappear once we've using the bb reordering code to do these transformations.

jeff


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