[patch] tree-cfg.c: Speed up cleanup_tree_cfg().

Kazu Hirata kazu@cs.umass.edu
Fri Oct 1 21:58:00 GMT 2004


Hi Zdenek,

> in fact I think whole loop can be removed, since thread_jumps
> cannot create new unreachable blocks the way it is written
> now (it removes the blocks directly in the case they become
> unreachable).

Actually, if you don't mind, may I ask a question?  In thread_jumps()
in tree-cfg.c,

	  /* Update the dominators.  */
	  if (dom_computed[CDI_DOMINATORS] >= DOM_CONS_OK)
	    {
	      /* Remove the unreachable blocks (observe that if all blocks
		 were reachable before, only those in the path we threaded
		 over and did not have any predecessor outside of the path
		 become unreachable).  */
	      for (; old_dest != dest; old_dest = tmp)
		{
		  tmp = EDGE_SUCC (old_dest, 0)->dest;

		  if (EDGE_COUNT (old_dest->preds) > 0)
		    break;

		  delete_basic_block (old_dest);
		}

why do you remove unreachable_blocks under "if (...)"?  I don't
understand the dominator code very well, but it seems to me that
removing unreachable blocks is something you want to do
unconditionally.

Kazu Hirata



More information about the Gcc-patches mailing list