diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 34a8e9d..2991c9e 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -190,7 +190,7 @@ remap_ssa_name (tree name, copy_body_data *id) new_tree = remap_decl (SSA_NAME_VAR (name), id); /* We might've substituted constant or another SSA_NAME for - the variable. + the variable. Replace the SSA name representing RESULT_DECL by variable during inlining: this saves us from need to introduce PHI node in a case @@ -223,7 +223,7 @@ remap_ssa_name (tree name, copy_body_data *id) { gimple_stmt_iterator gsi = gsi_last_bb (id->entry_bb); gimple init_stmt; - + init_stmt = gimple_build_assign (new_tree, fold_convert (TREE_TYPE (new_tree), integer_zero_node)); @@ -277,7 +277,7 @@ remap_decl (tree decl, copy_body_data *id) { /* Make a copy of the variable or label. */ tree t = id->copy_decl (decl, id); - + /* Remember it, so that if we encounter this local entity again we can reuse this copy. Do this early because remap_type may need this decl for TYPE_STUB_DECL. */ @@ -493,7 +493,7 @@ remapped_type (tree type, copy_body_data *id) /* The type only needs remapping if it's variably modified. */ /* Decide if DECL can be put into BLOCK_NONLOCAL_VARs. */ - + static bool can_be_nonlocal (tree decl, copy_body_data *id) { @@ -561,7 +561,7 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id) /* If we didn't remap this variable, we can't mess with its TREE_CHAIN. If we remapped this variable to the return slot, it's already declared somewhere else, so don't declare it here. */ - + if (new_var == id->retvar) ; else if (!new_var) @@ -1095,7 +1095,7 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data) && id->remapping_type_depth == 0 && !processing_debug_stmt) add_referenced_var (*tp); - + /* If EXPR has block defined, map it to newly constructed block. When inlining we want EXPRs without block appear in the block of function call. */ @@ -1247,7 +1247,7 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) case GIMPLE_TRY: s1 = remap_gimple_seq (gimple_try_eval (stmt), id); s2 = remap_gimple_seq (gimple_try_cleanup (stmt), id); - copy = gimple_build_try (s1, s2, gimple_try_kind (stmt)); + copy = gimple_build_try (s1, s2, gimple_try_kind (stmt)); break; case GIMPLE_WITH_CLEANUP_EXPR: @@ -1448,7 +1448,7 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) if (skip_first) walk_tree (gimple_op_ptr (copy, 1), remap_gimple_op_r, &wi, NULL); else - walk_gimple_op (copy, remap_gimple_op_r, &wi); + walk_gimple_op (copy, remap_gimple_op_r, &wi); /* Clear the copied virtual operands. We are not remapping them here but are going to recreate them from scratch. */ @@ -1642,7 +1642,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, /* We could also just rescale the frequency, but doing so would introduce roundoff errors and make verifier unhappy. */ - edge->frequency + edge->frequency = compute_call_stmt_bb_frequency (id->dst_node->decl, copy_basic_block); if (dump_file @@ -1681,7 +1681,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, /* Constant propagation on argument done during inlining may create new direct call. Produce an edge for it. */ - if ((!edge + if ((!edge || (edge->indirect_call && id->transform_call_graph_edges == CB_CGE_MOVE_CLONES)) && is_gimple_call (stmt) @@ -1700,7 +1700,7 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale, if (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES) cgraph_create_edge_including_clones (id->dst_node, dest, stmt, bb->count, - compute_call_stmt_bb_frequency (id->dst_node->decl, + compute_call_stmt_bb_frequency (id->dst_node->decl, copy_basic_block), bb->loop_depth, CIF_ORIGINALLY_INDIRECT_CALL); else @@ -1955,7 +1955,7 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); gsi_insert_seq_on_edge_immediate (new_edge, stmts); } - add_phi_arg (new_phi, new_arg, new_edge, + add_phi_arg (new_phi, new_arg, new_edge, gimple_phi_arg_location_from_edge (phi, old_edge)); } } @@ -2569,7 +2569,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, STRIP_USELESS_TYPE_CONVERSION (return_slot_addr); /* We are going to construct *&return_slot and we can't do that - for variables believed to be not addressable. + for variables believed to be not addressable. FIXME: This check possibly can match, because values returned via return slot optimization are not believed to have address @@ -2687,7 +2687,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest, use = var; if (!useless_type_conversion_p (caller_type, TREE_TYPE (var))) use = fold_convert (caller_type, var); - + STRIP_USELESS_TYPE_CONVERSION (use); if (DECL_BY_REFERENCE (result)) @@ -2747,7 +2747,7 @@ cannot_copy_type_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED, UNION_TYPE nodes, then it goes into infinite recursion on a structure containing a pointer to its own type. If it doesn't, then the type node for S doesn't get adjusted properly when - F is inlined. + F is inlined. ??? This is likely no longer true, but it's too late in the 4.0 cycle to try to find out. This should be checked for 4.1. */ @@ -3270,7 +3270,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights) case GIMPLE_SWITCH: /* Take into account cost of the switch + guess 2 conditional jumps for - each case label. + each case label. TODO: once the switch expansion logic is sufficiently separated, we can do better job on estimating cost of the switch. */ @@ -3293,7 +3293,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights) cost = weights->target_builtin_call_cost; else cost = weights->call_cost; - + if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) switch (DECL_FUNCTION_CODE (decl)) { @@ -3746,9 +3746,9 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "Inlining "); - print_generic_expr (dump_file, id->src_fn, 0); + print_generic_expr (dump_file, id->src_fn, 0); fprintf (dump_file, " to "); - print_generic_expr (dump_file, id->dst_fn, 0); + print_generic_expr (dump_file, id->dst_fn, 0); fprintf (dump_file, " with frequency %i\n", cg_edge->frequency); } @@ -4043,11 +4043,11 @@ optimize_inline_calls (tree fn) gcc_assert (e->inline_failed); } #endif - + /* Fold the statements before compacting/renumbering the basic blocks. */ fold_marked_statements (last, id.statements_to_fold); pointer_set_destroy (id.statements_to_fold); - + gcc_assert (!id.debug_stmts); /* Renumber the (code) basic_blocks consecutively. */ @@ -4515,14 +4515,14 @@ copy_decl_for_dup_finish (copy_body_data *id, tree decl, tree copy) DECL_IGNORED_P (copy) = DECL_IGNORED_P (decl); /* Set the DECL_ABSTRACT_ORIGIN so the debugging routines know what - declaration inspired this copy. */ + declaration inspired this copy. */ DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl); /* The new variable/label has no RTL, yet. */ if (CODE_CONTAINS_STRUCT (TREE_CODE (copy), TS_DECL_WRTL) && !TREE_STATIC (copy) && !DECL_EXTERNAL (copy)) SET_DECL_RTL (copy, NULL_RTX); - + /* These args would always appear unused, if not for this. */ TREE_USED (copy) = 1; @@ -4733,7 +4733,7 @@ delete_unreachable_blocks_update_callgraph (copy_body_data *id) else cgraph_remove_edge (e); } - + if (node->clones) node = node->clones; else if (node->next_sibling_clone) @@ -4796,9 +4796,9 @@ update_clone_info (copy_body_data * id) /* Create a copy of a function's tree. OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes of the original function and the new copied function - respectively. In case we want to replace a DECL - tree with another tree while duplicating the function's - body, TREE_MAP represents the mapping between these + respectively. In case we want to replace a DECL + tree with another tree while duplicating the function's + body, TREE_MAP represents the mapping between these trees. If UPDATE_CLONES is set, the call_stmt fields of edges of clones of the function will be updated. */ void @@ -4862,7 +4862,7 @@ tree_function_versioning (tree old_decl, tree new_decl, old_transforms_to_apply, i)); } - + id.copy_decl = copy_decl_no_change; id.transform_call_graph_edges = update_clones ? CB_CGE_MOVE_CLONES : CB_CGE_MOVE; @@ -4876,14 +4876,14 @@ tree_function_versioning (tree old_decl, tree new_decl, initialize_cfun (new_decl, old_decl, old_entry_block->count); push_cfun (DECL_STRUCT_FUNCTION (new_decl)); - + /* Copy the function's static chain. */ p = DECL_STRUCT_FUNCTION (old_decl)->static_chain_decl; if (p) DECL_STRUCT_FUNCTION (new_decl)->static_chain_decl = copy_static_chain (DECL_STRUCT_FUNCTION (old_decl)->static_chain_decl, &id); - + /* If there's a tree_map, prepare for substitution. */ if (tree_map) for (i = 0; i < VEC_length (ipa_replace_map_p, tree_map); i++) @@ -4898,7 +4898,7 @@ tree_function_versioning (tree old_decl, tree new_decl, if (TREE_CODE (op) == VIEW_CONVERT_EXPR) op = TREE_OPERAND (op, 0); - + if (TREE_CODE (op) == ADDR_EXPR) { op = TREE_OPERAND (op, 0); @@ -4921,12 +4921,12 @@ tree_function_versioning (tree old_decl, tree new_decl, DECL_ARGUMENTS (new_decl) = copy_arguments_for_versioning (DECL_ARGUMENTS (old_decl), &id, args_to_skip, &vars); - + DECL_INITIAL (new_decl) = remap_blocks (DECL_INITIAL (id.src_fn), &id); - + /* Renumber the lexical scoping (non-code) blocks consecutively. */ number_blocks (id.dst_fn); - + declare_inline_vars (DECL_INITIAL (new_decl), vars); if (DECL_STRUCT_FUNCTION (old_decl)->local_decls != NULL_TREE) @@ -4942,18 +4942,18 @@ tree_function_versioning (tree old_decl, tree new_decl, tree_cons (NULL_TREE, remap_decl (var, &id), cfun->local_decls); } - + /* Copy the Function's body. */ copy_body (&id, old_entry_block->count, REG_BR_PROB_BASE, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR); - + if (DECL_RESULT (old_decl) != NULL_TREE) { tree *res_decl = &DECL_RESULT (old_decl); DECL_RESULT (new_decl) = remap_decl (*res_decl, &id); lang_hooks.dup_lang_specific_decl (DECL_RESULT (new_decl)); } - + /* Renumber the lexical scoping (non-code) blocks consecutively. */ number_blocks (new_decl); |