2004-11-08 Kazu Hirata <kazu@cs.umass.edu>
+ * tree-cfg.c (thread_jumps): Speed up by keeping a pointer to
+ the last used element in the worklist.
+
+2004-11-08 Kazu Hirata <kazu@cs.umass.edu>
+
* tree-inline.c (remap_save_expr): Make it static.
* tree-inline.h: Remove the corresponding prototype.
basic_block bb;
bool retval = false;
basic_block *worklist = xmalloc (sizeof (basic_block) * last_basic_block);
- unsigned int size = 0;
+ basic_block *current = worklist;
FOR_EACH_BB (bb)
{
&& !bb_ann (e->src)->forwardable)
{
e->src->flags |= BB_VISITED;
- worklist[size] = e->src;
- size++;
+ *current++ = e->src;
}
}
}
/* Now let's drain WORKLIST. */
- while (size > 0)
+ while (worklist != current)
{
- size--;
- bb = worklist[size];
+ bb = *--current;
/* BB is no longer in WORKLIST, so clear BB_VISITED. */
bb->flags &= ~BB_VISITED;
&& !bb_ann (f->src)->forwardable)
{
f->src->flags |= BB_VISITED;
- worklist[size] = f->src;
- size++;
+ *current++ = f->src;
}
}
}