redirect_edge_and_branch_force (edge e, basic_block dest)
{
basic_block ret, src = e->src;
- struct loop *loop;
if (!cfg_hooks->redirect_edge_and_branch_force)
internal_error ("%s does not support redirect_edge_and_branch_force",
rescan_loop_exit (e, false, true);
ret = cfg_hooks->redirect_edge_and_branch_force (e, dest);
- if (ret != NULL
- && dom_info_available_p (CDI_DOMINATORS))
+
+ if (ret != NULL && dom_info_available_p (CDI_DOMINATORS))
set_immediate_dominator (CDI_DOMINATORS, ret, src);
if (current_loops != NULL)
{
if (ret != NULL)
{
- loop = find_common_loop (single_pred (ret)->loop_father,
- single_succ (ret)->loop_father);
+ struct loop *loop
+ = find_common_loop (single_pred (ret)->loop_father,
+ single_succ (ret)->loop_father);
add_bb_to_loop (ret, loop);
}
else if (find_edge (src, dest) == e)
return fallthru;
}
+/* Try to make the edge fallthru. */
+
void
tidy_fallthru_edge (edge e)
{
/* Fix up edges that now fall through, or rather should now fall through
but previously required a jump around now deleted blocks. Simplify
the search by only examining blocks numerically adjacent, since this
- is how they were created. */
+ is how they were created.
+
+ ??? This routine is currently RTL specific. */
void
tidy_fallthru_edges (void)
}
}
+/* Edge E is assumed to be fallthru edge. Emit needed jump instruction
+ (and possibly create new basic block) to make edge non-fallthru.
+ Return newly created BB or NULL if none. */
+
+basic_block
+force_nonfallthru (edge e)
+{
+ basic_block ret, src = e->src;
+
+ if (!cfg_hooks->force_nonfallthru)
+ internal_error ("%s does not support force_nonfallthru",
+ cfg_hooks->name);
+
+ ret = cfg_hooks->force_nonfallthru (e);
+ if (ret != NULL)
+ {
+ if (dom_info_available_p (CDI_DOMINATORS))
+ set_immediate_dominator (CDI_DOMINATORS, ret, src);
+
+ if (current_loops != NULL)
+ {
+ struct loop *loop
+ = find_common_loop (single_pred (ret)->loop_father,
+ single_succ (ret)->loop_father);
+ rescan_loop_exit (e, false, true);
+ add_bb_to_loop (ret, loop);
+ }
+ }
+
+ return ret;
+}
+
/* Returns true if we can duplicate basic block BB. */
bool