public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Puzzles about implementation of bb-reorder pass
@ 2009-10-28 15:29 Amker.Cheng
  0 siblings, 0 replies; only message in thread
From: Amker.Cheng @ 2009-10-28 15:29 UTC (permalink / raw)
  To: gcc

Hi :
    The bb-reorder pass is relative simple comparing with others, but still
    I got following puzzles.
1 : the comment at top of the bb-reorder.c file says that :

   There are two parameters: Branch Threshold and Exec Threshold.
   If the edge to a successor of the actual basic block is lower than
   Branch Threshold or the frequency of the successor is lower than
   Exec Threshold the successor will be the seed in one of the next rounds.

  but when computing which_heap in function "find_traces_1_round", it uses
  push_to_next_round_p to decide whether the successor should go to next round,
  which takes only exec_th as argument, not branch_th.

  Is this  inconsistent ?

2 : when checking for situation :

		     A
		   /  |
		  B  |
		   \  |
		     C
     gcc uses the condition
                EDGE_FREQUENCY (AB) + EDGE_FREQUENCY (BC)
		    >= EDGE_FREQUENCY (AC).
     what does "EDGE_FREQUENCY (AB) + EDGE_FREQUENCY (BC)"
     stand for? Since edge B is dominated by A and C is the only successor,
     the frequency of path(ABC) is less than path(AC), I think.

3 : It is possible to merge two traces by copying exactly one basic block.
     gcc uses following code to take trace which has only one bb into consider:

		    if (bbd[e->dest->index].start_of_trace >= 0
			&& traces[bbd[e->dest->index].start_of_trace].length
			   == 1)
		      {
			best = e;
			try_copy = true;
			continue;
		      }
    Here is the question, what about that trace has already been merged and has
    no free successor traces(traces which start bb is the successor of
the single bb).
    in this situation next_bb is NULL and all we did is just copy a
already merged bb.
    Is this right?

Please correct me and help me out, Thanks.

-- 
Best Regards.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-28 14:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28 15:29 Puzzles about implementation of bb-reorder pass Amker.Cheng

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