+2013-11-08 Jeff Law <law@redhat.com>
+
+ * tree-ssa-threadupdate.h (delete_thread_path): Declare.
+ * tree-ssa-threadupdate.c (delete_thread_path): New function.
+ (ssa_redirect_edges, thread_block_1): Use it.
+ (thread_through_loop_header, mark_threaded_blocks): Likewise.
+ (thread_through_all_blocks, register_jump_thread): Likewise.
+ * tree-ssa-threadedge.c (thread_across_edge): Likewise.
+
2013-11-08 James Greenhalgh <james.greenhalgh@arm.com>
* config/arm/aarch-common.c
/* Go ahead and clear E->aux. It's not needed anymore and failure
to clear it will cause all kinds of unpleasant problems later. */
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
/* Since this case is not handled by our special code
to thread through a loop header, we must explicitly
cancel the threading request here. */
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
continue;
}
if (e->src->loop_father != e2->dest->loop_father
&& e2->dest != loop->header)
{
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
}
if (path)
{
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
}
if (e2 && !phi_args_equal_on_edges (e2, final_edge))
{
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
}
if (e->aux)
{
vec<jump_thread_edge *> *path = THREAD_PATH (e);
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
}
|| (path->last ()->type
== EDGE_COPY_SRC_JOINER_BLOCK))
{
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
break;
{
vec<jump_thread_edge *> *path = THREAD_PATH (e);
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
e->aux = NULL;
}
}
return retval;
}
+/* Delete the jump threading path PATH. We have to explcitly delete
+ each entry in the vector, then the container. */
+
+void
+delete_jump_thread_path (vec<jump_thread_edge *> *path)
+{
+ for (unsigned int i = 0; i < path->length (); i++)
+ delete (*path)[i];
+ path->release();
+}
+
/* Dump a jump threading path, including annotations about each
edge in the path. */
{
if (!dbg_cnt (registered_jump_thread))
{
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
return;
}
dump_jump_thread_path (dump_file, *path);
}
- for (unsigned int i = 0; i < path->length (); i++)
- delete (*path)[i];
- path->release ();
+ delete_jump_thread_path (path);
return;
}