Commit aee2d611 by Jeff Law Committed by Jeff Law

tree-ssa-threadedge.c (thread_across_edge): Make path a pointer to a vec.

	* tree-ssa-threadedge.c (thread_across_edge): Make path a pointer to
	a vec.  Only delete the path if we create one without successfully
	registering a jump thread.
	* tree-ssa-threadupdate.h (register_jump_thread): Pass in path vector
	as a pointer.
	* tree-ssa-threadupdate.c (threaded_edges): Remove.  No longer used
	(paths): New vector of jump threading paths.
	(THREAD_TARGET, THREAD_TARGET2): Remove accessor macros.
	(THREAD_PATH): New accessor macro for the entire thread path.
	(lookup_redirection_data): Get intermediate and final outgoing edge
	from the thread path.
	(create_edge_and_update_destination_phis): Copy the threading path.
	(ssa_fix_duplicate_block_edges): Get edges and block types from the
	jump threading path.
	(ssa_redirect_edges): Get edges and block types from the jump threading
	path.  Free the path vector.
	(thread_block): Get edges from the jump threading path.  Look at the
	entire path to see if we thread to a loop exit.  If we cancel a jump
	thread request, then free the path vector.
	(thread_single_edge): Get edges and block types from the jump threading
	path.  Free the path vector.
	(thread_through_loop_header): Get edges and block types from the jump
	threading path.  Free the path vector.
	(mark_threaded_blocks): Iterate over the vector of paths and store
	the path on the appropriate edge.  Get edges and block types from the
	jump threading path.
	(mark_threaded_blocks): Get edges and block types from the jump
	threading path.  Free the path vector.
	(thread_through_all_blocks): Use the vector of paths rather than
	a vector of 3-edge sets.
	(register_jump_thread): Accept pointer to a path vector rather
	than the path vector itself.  Store the path vector for later use.
	Simplify.

From-SVN: r203061
parent 966f97ac
2013-10-01 Jeff Law <law@redhat.com>
* tree-ssa-threadedge.c (thread_across_edge): Make path a pointer to
a vec. Only delete the path if we create one without successfully
registering a jump thread.
* tree-ssa-threadupdate.h (register_jump_thread): Pass in path vector
as a pointer.
* tree-ssa-threadupdate.c (threaded_edges): Remove. No longer used
(paths): New vector of jump threading paths.
(THREAD_TARGET, THREAD_TARGET2): Remove accessor macros.
(THREAD_PATH): New accessor macro for the entire thread path.
(lookup_redirection_data): Get intermediate and final outgoing edge
from the thread path.
(create_edge_and_update_destination_phis): Copy the threading path.
(ssa_fix_duplicate_block_edges): Get edges and block types from the
jump threading path.
(ssa_redirect_edges): Get edges and block types from the jump threading
path. Free the path vector.
(thread_block): Get edges from the jump threading path. Look at the
entire path to see if we thread to a loop exit. If we cancel a jump
thread request, then free the path vector.
(thread_single_edge): Get edges and block types from the jump threading
path. Free the path vector.
(thread_through_loop_header): Get edges and block types from the jump
threading path. Free the path vector.
(mark_threaded_blocks): Iterate over the vector of paths and store
the path on the appropriate edge. Get edges and block types from the
jump threading path.
(mark_threaded_blocks): Get edges and block types from the jump
threading path. Free the path vector.
(thread_through_all_blocks): Use the vector of paths rather than
a vector of 3-edge sets.
(register_jump_thread): Accept pointer to a path vector rather
than the path vector itself. Store the path vector for later use.
Simplify.
2013-10-01 Jakub Jelinek <jakub@redhat.com>
Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
......
......@@ -929,13 +929,13 @@ thread_across_edge (gimple dummy_cond,
if (dest == NULL || dest == e->dest)
goto fail;
vec<jump_thread_edge *> path = vNULL;
vec<jump_thread_edge *> *path = new vec<jump_thread_edge *> ();
jump_thread_edge *x
= new jump_thread_edge (e, EDGE_START_JUMP_THREAD);
path.safe_push (x);
path->safe_push (x);
x = new jump_thread_edge (taken_edge, EDGE_COPY_SRC_BLOCK);
path.safe_push (x);
path->safe_push (x);
/* See if we can thread through DEST as well, this helps capture
secondary effects of threading without having to re-run DOM or
......@@ -953,17 +953,14 @@ thread_across_edge (gimple dummy_cond,
handle_dominating_asserts,
simplify,
visited,
&path);
path);
BITMAP_FREE (visited);
}
remove_temporary_equivalences (stack);
propagate_threaded_block_debug_into (path.last ()->e->dest,
propagate_threaded_block_debug_into (path->last ()->e->dest,
e->dest);
register_jump_thread (path);
for (unsigned int i = 0; i < path.length (); i++)
delete path[i];
path.release ();
return;
}
}
......@@ -992,37 +989,39 @@ thread_across_edge (gimple dummy_cond,
bitmap_clear (visited);
bitmap_set_bit (visited, taken_edge->dest->index);
bitmap_set_bit (visited, e->dest->index);
vec<jump_thread_edge *> path = vNULL;
vec<jump_thread_edge *> *path = new vec<jump_thread_edge *> ();
/* Record whether or not we were able to thread through a successor
of E->dest. */
jump_thread_edge *x = new jump_thread_edge (e, EDGE_START_JUMP_THREAD);
path.safe_push (x);
path->safe_push (x);
x = new jump_thread_edge (taken_edge, EDGE_COPY_SRC_JOINER_BLOCK);
path.safe_push (x);
path->safe_push (x);
found = false;
if ((e->flags & EDGE_DFS_BACK) == 0
|| ! cond_arg_set_in_bb (path.last ()->e, e->dest))
|| ! cond_arg_set_in_bb (path->last ()->e, e->dest))
found = thread_around_empty_blocks (taken_edge,
dummy_cond,
handle_dominating_asserts,
simplify,
visited,
&path);
path);
/* If we were able to thread through a successor of E->dest, then
record the jump threading opportunity. */
if (found)
{
propagate_threaded_block_debug_into (path.last ()->e->dest,
propagate_threaded_block_debug_into (path->last ()->e->dest,
taken_edge->dest);
register_jump_thread (path);
}
for (unsigned int i = 0; i < path.length (); i++)
delete path[i];
path.release ();
else
{
for (unsigned int i = 0; i < path->length (); i++)
delete (*path)[i];
path->release();
}
}
BITMAP_FREE (visited);
}
......
......@@ -41,5 +41,5 @@ public:
enum jump_thread_edge_type type;
};
extern void register_jump_thread (vec<class jump_thread_edge *>);
extern void register_jump_thread (vec <class jump_thread_edge *> *);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment