diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3ebc191..ebfd34c 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2241,14 +2241,14 @@ maybe_move_debug_stmts_to_successors (copy_body_data *id, basic_block new_bb) as siblings of DEST_PARENT. */ static void -copy_loops (bitmap blocks_to_copy, +copy_loops (copy_body_data *id, struct loop *dest_parent, struct loop *src_parent) { struct loop *src_loop = src_parent->inner; while (src_loop) { - if (!blocks_to_copy - || bitmap_bit_p (blocks_to_copy, src_loop->header->index)) + if (!id->blocks_to_copy + || bitmap_bit_p (id->blocks_to_copy, src_loop->header->index)) { struct loop *dest_loop = alloc_loop (); @@ -2272,8 +2272,19 @@ copy_loops (bitmap blocks_to_copy, place_new_loop (cfun, dest_loop); flow_loop_tree_node_add (dest_parent, dest_loop); + if (src_loop->simduid) + { + dest_loop->simduid = remap_decl (src_loop->simduid, id); + cfun->has_simduid_loops = true; + } + if (src_loop->force_vect) + { + dest_loop->force_vect = true; + cfun->has_force_vect_loops = true; + } + /* Recurse. */ - copy_loops (blocks_to_copy, dest_loop, src_loop); + copy_loops (id, dest_loop, src_loop); } src_loop = src_loop->next; } @@ -2302,7 +2313,7 @@ redirect_all_calls (copy_body_data * id, basic_block bb) static tree copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, basic_block entry_block_map, basic_block exit_block_map, - bitmap blocks_to_copy, basic_block new_entry) + basic_block new_entry) { tree callee_fndecl = id->src_fn; /* Original cfun for the callee, doesn't change. */ @@ -2366,7 +2377,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, /* Use aux pointers to map the original blocks to copy. */ FOR_EACH_BB_FN (bb, cfun_to_copy) - if (!blocks_to_copy || bitmap_bit_p (blocks_to_copy, bb->index)) + if (!id->blocks_to_copy || bitmap_bit_p (id->blocks_to_copy, bb->index)) { basic_block new_bb = copy_bb (id, bb, frequency_scale, count_scale); bb->aux = new_bb; @@ -2380,8 +2391,8 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, bool can_make_abormal_goto = id->gimple_call && stmt_can_make_abnormal_goto (id->gimple_call); FOR_ALL_BB_FN (bb, cfun_to_copy) - if (!blocks_to_copy - || (bb->index > 0 && bitmap_bit_p (blocks_to_copy, bb->index))) + if (!id->blocks_to_copy + || (bb->index > 0 && bitmap_bit_p (id->blocks_to_copy, bb->index))) need_debug_cleanup |= copy_edges_for_bb (bb, count_scale, exit_block_map, can_make_abormal_goto); @@ -2396,12 +2407,10 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, if (loops_for_fn (src_cfun) != NULL && current_loops != NULL) { - copy_loops (blocks_to_copy, entry_block_map->loop_father, + copy_loops (id, entry_block_map->loop_father, get_loop (src_cfun, 0)); /* Defer to cfgcleanup to update loop-father fields of basic-blocks. */ loops_state_set (LOOPS_NEED_FIXUP); - cfun->has_force_vect_loops |= src_cfun->has_force_vect_loops; - cfun->has_simduid_loops |= src_cfun->has_simduid_loops; } /* If the loop tree in the source function needed fixup, mark the @@ -2411,8 +2420,8 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency_scale, if (gimple_in_ssa_p (cfun)) FOR_ALL_BB_FN (bb, cfun_to_copy) - if (!blocks_to_copy - || (bb->index > 0 && bitmap_bit_p (blocks_to_copy, bb->index))) + if (!id->blocks_to_copy + || (bb->index > 0 && bitmap_bit_p (id->blocks_to_copy, bb->index))) copy_phis_for_bb (bb, id); FOR_ALL_BB_FN (bb, cfun_to_copy) @@ -2584,7 +2593,7 @@ copy_tree_body (copy_body_data *id) static tree copy_body (copy_body_data *id, gcov_type count, int frequency_scale, basic_block entry_block_map, basic_block exit_block_map, - bitmap blocks_to_copy, basic_block new_entry) + basic_block new_entry) { tree fndecl = id->src_fn; tree body; @@ -2592,7 +2601,7 @@ copy_body (copy_body_data *id, gcov_type count, int frequency_scale, /* If this body has a CFG, walk CFG and copy. */ gcc_assert (ENTRY_BLOCK_PTR_FOR_FUNCTION (DECL_STRUCT_FUNCTION (fndecl))); body = copy_cfg_body (id, count, frequency_scale, entry_block_map, exit_block_map, - blocks_to_copy, new_entry); + new_entry); copy_debug_stmts (id); return body; @@ -4201,7 +4210,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) duplicate our body before altering anything. */ copy_body (id, bb->count, GCOV_COMPUTE_SCALE (cg_edge->frequency, CGRAPH_FREQ_BASE), - bb, return_block, NULL, NULL); + bb, return_block, NULL); /* Reset the escaped solution. */ if (cfun->gimple_df) @@ -5328,7 +5337,7 @@ tree_function_versioning (tree old_decl, tree new_decl, /* Copy the Function's body. */ copy_body (&id, old_entry_block->count, REG_BR_PROB_BASE, - ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, blocks_to_copy, new_entry); + ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, new_entry); /* Renumber the lexical scoping (non-code) blocks consecutively. */ number_blocks (new_decl); |