Re: Trace Scheduling in GCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Honza,

I have been working on this over the past week and am still having 
problems getting traces with side entrances. I have commented out the 
tail-duplication code in the tail_duplicate function in trace.c (see 
below). The problem is that when I print out trace information in 
the tail_duplicate function, tarces look good (basic blocks within the 
trace have off-trace predecessors), but when I get to the scheduler, I no 
longer see any side entrances (only the head basic block in the trace has 
off-trace predecessors). This means that somewhere in between another 
transformation is applied to the trace to redirect the off-trace 
predecessors somwhere else. I suspect that that might be done in the 
function layout_superblocks in tracer.c, but I am having hard time 
understanding what that function does.

So, can you please tell me what that function does to the CFG and whether 
it is responsible for eliminating side entrances? If not, then where should 
I be looking?

Below I am including the piece of cocde that I commented out in the 
tail_duplicate function in tracer.c.

Thanks
-Ghassan
 

    for (pos = 1; pos < n; pos++)
	{
	  basic_block bb2 = trace[pos];
	  if (blocks[bb2->index])
	    {
	      fibheap_delete_node (heap, blocks[bb2->index]);
	      blocks[bb2->index] = NULL;
	    }
	  traced_insns += bb2->frequency * counts [bb2->index];

//Block Commented out by Ghassan to eliminate tail duplication
//START OF GHASSAN"S COMMENT
/*	  if (bb2->pred && bb2->pred->pred_next
	      && cfg_layout_can_duplicate_bb_p (bb2))
	    {
	      edge e = bb2->pred;
	      basic_block old = bb2;
	      while (e->src != bb)
			e = e->pred_next;
	      nduplicated += counts [bb2->index];
	      bb2 = cfg_layout_duplicate_bb (bb2, e);
	      // Reconsider the original copy of block we've duplicated.
	      //   Removing the most common predecessor may make it to be
	      //   head. 
	      blocks[old->index] =
		fibheap_insert (heap, -old->frequency, old);
	      if (rtl_dump_file)
		fprintf (rtl_dump_file, "Duplicated %i as %i [%i]\n",
			 old->index, bb2->index, bb2->frequency);
	    }*/
//END OF GHASSAN"S COMMENT

	  bb->rbi->next = bb2;
	  bb2->rbi->visited = 1;
	  bb = bb2;
	  /* In case the trace became infrequent, stop duplicating.  */
	  if (ignore_bb_p (bb))
	    break;
	}



On Thu, 17 Feb 2005, Jan Hubicka wrote:

> > Honza,
> > 
> > But what will happen if I try to bypass the tail duplication stage? In
> > theory that should generate traces. However, the question is will the
> > data dependence graph construction and scheduling stages still work? (for
> 
> I am not too faimilar with scheduler itself, but I believe that it
> builds full dependence graph for region scheduling, so you ought to be
> safe.
> 
> Honza
> > my purposes, the scheduler does not have to produce correct schedules,
> > since all what I need is importing the data dependence graphs to
> > feed them into my standalone scheduler. So, it is all about the data
> > dependence graphs for my purpose).
> > 
> > Thanks
> > -Ghassan

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux