aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorSteve Ellcey <sellcey@imgtec.com>2013-05-16 17:09:40 +0000
committerSteve Ellcey <sje@gcc.gnu.org>2013-05-16 17:09:40 +0000
commitf14540b6352b1a164ef79ae36d1ae1463efdac46 (patch)
tree0417eb55c06e17bb692b965567279eb2722fc0d5 /gcc/tree-cfg.c
parent45f9820f0075149dcbbe71eac97bf31993e9f9df (diff)
downloadgcc-f14540b6352b1a164ef79ae36d1ae1463efdac46.zip
gcc-f14540b6352b1a164ef79ae36d1ae1463efdac46.tar.gz
gcc-f14540b6352b1a164ef79ae36d1ae1463efdac46.tar.bz2
cfghooks.c (copy_bbs): Add update_dominance argument.
2013-05-16 Steve Ellcey <sellcey@imgtec.com> * cfghooks.c (copy_bbs): Add update_dominance argument. * cfghooks.h (copy_bbs): Update prototype. * tree-cfg.c (gimple_duplicate_sese_region): Add update_dominance argument. * tree-flow.h (gimple_duplicate_sese_region): Update prototype. * tree-ssa-loop-ch.c (copy_loop_headers): Update gimple_duplicate_sese_region call. * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Update copy_bbs call. * cfgloopmanip.c (duplicate_loop_to_header_edge): Ditto. * trans-mem.c (ipa_uninstrument_transaction): Ditto. From-SVN: r198980
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index a08a737..721c4f7 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -5686,16 +5686,19 @@ add_phi_args_after_copy (basic_block *region_copy, unsigned n_region,
inside region is live over the other exit edges of the region. All entry
edges to the region must go to ENTRY->dest. The edge ENTRY is redirected
to the duplicate of the region. Dominance and loop information is
- updated, but not the SSA web. The new basic blocks are stored to
- REGION_COPY in the same order as they had in REGION, provided that
- REGION_COPY is not NULL.
+ updated if UPDATE_DOMINANCE is true, but not the SSA web. If
+ UPDATE_DOMINANCE is false then we assume that the caller will update the
+ dominance information after calling this function. The new basic
+ blocks are stored to REGION_COPY in the same order as they had in REGION,
+ provided that REGION_COPY is not NULL.
The function returns false if it is unable to copy the region,
true otherwise. */
bool
gimple_duplicate_sese_region (edge entry, edge exit,
basic_block *region, unsigned n_region,
- basic_block *region_copy)
+ basic_block *region_copy,
+ bool update_dominance)
{
unsigned i;
bool free_region_copy = false, copying_header = false;
@@ -5749,12 +5752,15 @@ gimple_duplicate_sese_region (edge entry, edge exit,
free_region_copy = true;
}
- /* Record blocks outside the region that are dominated by something
- inside. */
- doms.create (0);
initialize_original_copy_tables ();
- doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region);
+ /* Record blocks outside the region that are dominated by something
+ inside. */
+ if (update_dominance)
+ {
+ doms.create (0);
+ doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region);
+ }
if (entry->dest->count)
{
@@ -5778,7 +5784,7 @@ gimple_duplicate_sese_region (edge entry, edge exit,
}
copy_bbs (region, n_region, region_copy, &exit, 1, &exit_copy, loop,
- split_edge_bb_loc (entry));
+ split_edge_bb_loc (entry), update_dominance);
if (total_count)
{
scale_bbs_frequencies_gcov_type (region, n_region,
@@ -5809,10 +5815,13 @@ gimple_duplicate_sese_region (edge entry, edge exit,
for entry block and its copy. Anything that is outside of the
region, but was dominated by something inside needs recounting as
well. */
- set_immediate_dominator (CDI_DOMINATORS, entry->dest, entry->src);
- doms.safe_push (get_bb_original (entry->dest));
- iterate_fix_dominators (CDI_DOMINATORS, doms, false);
- doms.release ();
+ if (update_dominance)
+ {
+ set_immediate_dominator (CDI_DOMINATORS, entry->dest, entry->src);
+ doms.safe_push (get_bb_original (entry->dest));
+ iterate_fix_dominators (CDI_DOMINATORS, doms, false);
+ doms.release ();
+ }
/* Add the other PHI node arguments. */
add_phi_args_after_copy (region_copy, n_region, NULL);
@@ -5944,7 +5953,7 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU
}
copy_bbs (region, n_region, region_copy, exits, 2, nexits, orig_loop,
- split_edge_bb_loc (exit));
+ split_edge_bb_loc (exit), true);
if (total_count)
{
scale_bbs_frequencies_gcov_type (region, n_region,