Projects
Mega:23.03
gcc
_service:tar_scm:0072-Struct-Reorg-Merge-struct...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0072-Struct-Reorg-Merge-struct_layout-pass-into-struct_re.patch of Package gcc
From 6a7b9e30955e0da5258d8c4ab8de611c8a5653a5 Mon Sep 17 00:00:00 2001 From: liyancheng <412998149@qq.com> Date: Thu, 3 Nov 2022 20:11:18 +0800 Subject: [PATCH 24/35] [Struct Reorg] Merge struct_layout pass into struct_reorg 1. Merge struct_layout pass into struct_reorg 2. Merge srmode and into struct_layout_opt_level 3. Adapt to all relevant deja tests --- gcc/common.opt | 2 +- gcc/ipa-struct-reorg/ipa-struct-reorg.c | 316 ++++++++---------- gcc/opts.c | 15 +- gcc/passes.def | 1 - gcc/symbol-summary.h | 4 +- gcc/testsuite/gcc.dg/struct/dfe_DTE_verify.c | 2 +- .../gcc.dg/struct/dfe_ele_minus_verify.c | 2 +- .../gcc.dg/struct/dfe_extr_board_init.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_extr_dtrace.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_extr_gc.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_extr_hpsa.c | 2 +- .../gcc.dg/struct/dfe_extr_mv_udc_core.c | 2 +- .../gcc.dg/struct/dfe_extr_tcp_usrreq.c | 2 +- .../gcc.dg/struct/dfe_extr_ui_main.c | 2 +- .../gcc.dg/struct/dfe_mem_ref_offset.c | 2 +- .../struct/dfe_mul_layer_ptr_record_bug.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_ptr_diff.c | 2 +- .../gcc.dg/struct/dfe_ptr_negate_expr.c | 2 +- gcc/testsuite/gcc.dg/struct/dfe_ptr_ptr.c | 2 +- .../struct/rf_DTE_struct_instance_field.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_DTE_verify.c | 2 +- .../gcc.dg/struct/rf_check_ptr_layers_bug.c | 2 +- .../gcc.dg/struct/rf_create_fields_bug.c | 2 +- .../gcc.dg/struct/rf_create_new_func_bug.c | 2 +- .../gcc.dg/struct/rf_ele_minus_verify.c | 2 +- .../gcc.dg/struct/rf_escape_by_base.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c | 2 +- .../gcc.dg/struct/rf_mem_ref_offset.c | 2 +- .../struct/rf_mul_layer_ptr_record_bug.c | 2 +- .../gcc.dg/struct/rf_pass_conflict.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_ptr2void_lto.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_ptr_diff.c | 2 +- .../gcc.dg/struct/rf_ptr_negate_expr.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_ptr_offset.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_ptr_ptr.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_ptr_ptr_ptr.c | 2 +- .../gcc.dg/struct/rf_rescusive_type.c | 2 +- .../struct/rf_rewrite_assign_more_cmp.c | 2 +- .../gcc.dg/struct/rf_rewrite_cond_bug.c | 2 +- .../gcc.dg/struct/rf_rewrite_cond_more_cmp.c | 2 +- .../gcc.dg/struct/rf_rewrite_phi_bug.c | 2 +- gcc/testsuite/gcc.dg/struct/rf_visible_func.c | 2 +- .../gcc.dg/struct/rf_void_ptr_param_func.c | 2 +- gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c | 2 +- gcc/testsuite/gcc.dg/struct/struct-reorg.exp | 4 +- gcc/testsuite/gcc.dg/struct/struct_reorg-1.c | 2 +- gcc/testsuite/gcc.dg/struct/struct_reorg-2.c | 2 +- gcc/testsuite/gcc.dg/struct/struct_reorg-3.c | 2 +- gcc/testsuite/gcc.dg/struct/struct_reorg-4.c | 2 +- .../gcc.dg/struct/w_prof_global_array.c | 2 +- .../gcc.dg/struct/w_prof_global_var.c | 2 +- .../gcc.dg/struct/w_prof_local_array.c | 2 +- .../gcc.dg/struct/w_prof_local_var.c | 2 +- .../gcc.dg/struct/w_prof_single_str_global.c | 2 +- gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c | 2 +- .../gcc.dg/struct/w_ratio_cold_str.c | 2 +- .../gcc.dg/struct/wo_prof_array_field.c | 2 +- .../struct/wo_prof_array_through_pointer.c | 2 +- .../gcc.dg/struct/wo_prof_double_malloc.c | 2 +- .../gcc.dg/struct/wo_prof_empty_str.c | 2 +- .../struct/wo_prof_escape_arg_to_local.c | 2 +- .../struct/wo_prof_escape_substr_array.c | 2 +- .../gcc.dg/struct/wo_prof_global_array.c | 2 +- .../gcc.dg/struct/wo_prof_global_var.c | 2 +- .../gcc.dg/struct/wo_prof_local_array.c | 2 +- .../gcc.dg/struct/wo_prof_local_var.c | 2 +- .../gcc.dg/struct/wo_prof_malloc_size_var-1.c | 2 +- .../gcc.dg/struct/wo_prof_malloc_size_var.c | 2 +- .../struct/wo_prof_mult_field_peeling.c | 2 +- .../gcc.dg/struct/wo_prof_single_str_global.c | 2 +- .../gcc.dg/struct/wo_prof_single_str_local.c | 2 +- .../gcc.dg/struct/wo_prof_two_strs.c | 2 +- gcc/timevar.def | 1 - gcc/tree-pass.h | 1 - gcc/tree.c | 4 +- 76 files changed, 222 insertions(+), 260 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index be7bfee60..ad147f7a9 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1881,7 +1881,7 @@ Common Ignore Does nothing. Preserved for backward compatibility. fipa-reorder-fields -Common Report Var(flag_ipa_struct_layout) Init(0) Optimization +Common Report Var(flag_ipa_reorder_fields) Init(0) Optimization Perform structure fields reorder optimizations. fipa-struct-reorg diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c index 54c20ca3f..08cb51fee 100644 --- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c +++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c @@ -232,12 +232,6 @@ is_from_void_ptr_parm (tree ssa_name) && VOID_POINTER_P (TREE_TYPE (ssa_name))); } -enum srmode -{ - NORMAL = 0, - COMPLETE_STRUCT_RELAYOUT, - STRUCT_LAYOUT_OPTIMIZE -}; /* Enum the struct layout optimize level, which should be the same as the option -fstruct-reorg=. */ @@ -245,16 +239,17 @@ enum srmode enum struct_layout_opt_level { NONE = 0, - STRUCT_REORG, - STRUCT_REORDER_FIELDS, - DEAD_FIELD_ELIMINATION + STRUCT_SPLIT = 1 << 0, + COMPLETE_STRUCT_RELAYOUT = 1 << 1, + STRUCT_REORDER_FIELDS = 1 << 2, + DEAD_FIELD_ELIMINATION = 1 << 3 }; static bool is_result_of_mult (tree arg, tree *num, tree struct_size); bool isptrptr (tree type); void get_base (tree &base, tree expr); -srmode current_mode; +static unsigned int current_layout_opt_level; hash_map<tree, tree> replace_type_map; @@ -607,7 +602,7 @@ void srtype::simple_dump (FILE *f) { print_generic_expr (f, type); - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { fprintf (f, "(%d)", TYPE_UID (type)); } @@ -656,7 +651,7 @@ srfield::create_new_fields (tree newtype[max_split], tree newfields[max_split], tree newlast[max_split]) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { create_new_optimized_fields (newtype, newfields, newlast); return; @@ -857,7 +852,7 @@ srtype::create_new_type (void) we are not splitting the struct into two clusters, then just return false and don't change the type. */ if (!createnewtype && maxclusters == 0 - && current_mode != STRUCT_LAYOUT_OPTIMIZE) + && current_layout_opt_level < STRUCT_REORDER_FIELDS) { newtype[0] = type; return false; @@ -885,8 +880,7 @@ srtype::create_new_type (void) sprintf(id, "%d", i); if (tname) { - name = concat (tname, current_mode == STRUCT_LAYOUT_OPTIMIZE - ? ".slo." : ".reorg.", id, NULL); + name = concat (tname, ".reorg.", id, NULL); TYPE_NAME (newtype[i]) = build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier (name), newtype[i]); free (name); @@ -896,8 +890,7 @@ srtype::create_new_type (void) for (unsigned i = 0; i < fields.length (); i++) { srfield *f = fields[i]; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE - && struct_layout_optimize_level >= DEAD_FIELD_ELIMINATION + if (current_layout_opt_level & DEAD_FIELD_ELIMINATION && !(f->field_access & READ_FIELD)) continue; f->create_new_fields (newtype, newfields, newlast); @@ -921,13 +914,12 @@ srtype::create_new_type (void) warn_padded = save_warn_padded; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && replace_type_map.get (this->newtype[0]) == NULL) replace_type_map.put (this->newtype[0], this->type); if (dump_file) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE - && struct_layout_optimize_level >= DEAD_FIELD_ELIMINATION + if (current_layout_opt_level & DEAD_FIELD_ELIMINATION && has_dead_field ()) fprintf (dump_file, "Dead field elimination.\n"); } @@ -1046,8 +1038,7 @@ srfunction::create_new_decls (void) sprintf(id, "%d", j); if (tname) { - name = concat (tname, current_mode == STRUCT_LAYOUT_OPTIMIZE - ? ".slo." : ".reorg.", id, NULL); + name = concat (tname, ".reorg.", id, NULL); new_name = get_identifier (name); free (name); } @@ -1266,7 +1257,7 @@ public: { } - unsigned execute (enum srmode mode); + unsigned execute (unsigned int opt); void mark_type_as_escape (tree type, escape_type, gimple *stmt = NULL); // fields @@ -2796,7 +2787,7 @@ escape_type escape_type_volatile_array_or_ptrptr (tree type) return escape_volatile; if (isarraytype (type)) return escape_array; - if (isptrptr (type) && (current_mode != STRUCT_LAYOUT_OPTIMIZE)) + if (isptrptr (type) && (current_layout_opt_level < STRUCT_REORDER_FIELDS)) return escape_ptr_ptr; return does_not_escape; } @@ -2817,14 +2808,13 @@ ipa_struct_reorg::record_field_type (tree field, srtype *base_srtype) field_srfield->type = field_srtype; field_srtype->add_field_site (field_srfield); } - if (field_srtype == base_srtype && current_mode != COMPLETE_STRUCT_RELAYOUT - && current_mode != STRUCT_LAYOUT_OPTIMIZE) + if (field_srtype == base_srtype && current_layout_opt_level == STRUCT_SPLIT) { base_srtype->mark_escape (escape_rescusive_type, NULL); } /* Types of non-pointer field are difficult to track the correctness of the rewrite when it used by the escaped type. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && TREE_CODE (field_type) == RECORD_TYPE) { field_srtype->mark_escape (escape_instance_field, NULL); @@ -2859,7 +2849,7 @@ ipa_struct_reorg::record_struct_field_types (tree base_type, } /* Types of non-pointer field are difficult to track the correctness of the rewrite when it used by the escaped type. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && TREE_CODE (field_type) == RECORD_TYPE) { base_srtype->mark_escape (escape_instance_field, NULL); @@ -3043,8 +3033,7 @@ ipa_struct_reorg::record_var (tree decl, escape_type escapes, int arg) /* Separate instance is hard to trace in complete struct relayout optimization. */ - if ((current_mode == COMPLETE_STRUCT_RELAYOUT - || current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= COMPLETE_STRUCT_RELAYOUT && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE) { e = escape_separate_instance; @@ -3149,7 +3138,7 @@ ipa_struct_reorg::find_vars (gimple *stmt) /* Add a safe func mechanism. */ bool l_find = true; bool r_find = true; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { l_find = !(current_function->is_safe_func && TREE_CODE (lhs) == SSA_NAME @@ -3195,7 +3184,7 @@ ipa_struct_reorg::find_vars (gimple *stmt) } } } - else if ((current_mode == STRUCT_LAYOUT_OPTIMIZE) + else if ((current_layout_opt_level >= STRUCT_REORDER_FIELDS) && (gimple_assign_rhs_code (stmt) == LE_EXPR || gimple_assign_rhs_code (stmt) == LT_EXPR || gimple_assign_rhs_code (stmt) == GE_EXPR @@ -3206,7 +3195,7 @@ ipa_struct_reorg::find_vars (gimple *stmt) find_var (gimple_assign_rhs2 (stmt), stmt); } /* find void ssa_name from stmt such as: _2 = _1 - old_arcs_1. */ - else if ((current_mode == STRUCT_LAYOUT_OPTIMIZE) + else if ((current_layout_opt_level >= STRUCT_REORDER_FIELDS) && gimple_assign_rhs_code (stmt) == POINTER_DIFF_EXPR && types_compatible_p ( TYPE_MAIN_VARIANT (TREE_TYPE (gimple_assign_rhs1 (stmt))), @@ -3418,8 +3407,7 @@ ipa_struct_reorg::maybe_record_stmt (cgraph_node *node, gimple *stmt) default: break; } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE - && struct_layout_optimize_level >= DEAD_FIELD_ELIMINATION) + if (current_layout_opt_level & DEAD_FIELD_ELIMINATION) { /* Look for loads and stores. */ walk_stmt_load_store_ops (stmt, this, find_field_p_load, @@ -3590,11 +3578,12 @@ is_result_of_mult (tree arg, tree *num, tree struct_size) size_def_stmt = SSA_NAME_DEF_STMT (arg); } else if (rhs_code == NEGATE_EXPR - && current_mode == STRUCT_LAYOUT_OPTIMIZE) + && current_layout_opt_level >= STRUCT_REORDER_FIELDS) { return trace_calculate_negate (size_def_stmt, num, struct_size); } - else if (rhs_code == NOP_EXPR && current_mode == STRUCT_LAYOUT_OPTIMIZE) + else if (rhs_code == NOP_EXPR + && current_layout_opt_level >= STRUCT_REORDER_FIELDS) { return trace_calculate_diff (size_def_stmt, num); } @@ -3614,17 +3603,17 @@ is_result_of_mult (tree arg, tree *num, tree struct_size) bool ipa_struct_reorg::handled_allocation_stmt (gimple *stmt) { - if ((current_mode == STRUCT_LAYOUT_OPTIMIZE) + if ((current_layout_opt_level >= STRUCT_REORDER_FIELDS) && (gimple_call_builtin_p (stmt, BUILT_IN_REALLOC) || gimple_call_builtin_p (stmt, BUILT_IN_MALLOC) || gimple_call_builtin_p (stmt, BUILT_IN_CALLOC))) { return true; } - if ((current_mode == COMPLETE_STRUCT_RELAYOUT) + if ((current_layout_opt_level == COMPLETE_STRUCT_RELAYOUT) && gimple_call_builtin_p (stmt, BUILT_IN_CALLOC)) return true; - if ((current_mode == NORMAL) + if ((current_layout_opt_level == STRUCT_SPLIT) && (gimple_call_builtin_p (stmt, BUILT_IN_REALLOC) || gimple_call_builtin_p (stmt, BUILT_IN_MALLOC) || gimple_call_builtin_p (stmt, BUILT_IN_CALLOC) @@ -3750,7 +3739,7 @@ ipa_struct_reorg::maybe_mark_or_record_other_side (tree side, tree other, gimple /* x_1 = y.x_nodes; void *x; Directly mark the structure pointer type assigned to the void* variable as escape. */ - else if (current_mode == STRUCT_LAYOUT_OPTIMIZE + else if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && TREE_CODE (side) == SSA_NAME && VOID_POINTER_P (TREE_TYPE (side)) && SSA_NAME_VAR (side) @@ -4017,7 +4006,7 @@ ipa_struct_reorg::get_type_field (tree expr, tree &base, bool &indirect, and doesn't mark escape follow.). */ /* _1 = MEM[(struct arc_t * *)a_1]. then base a_1: ssa_name - pointer_type - integer_type. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { bool is_int_ptr = POINTER_TYPE_P (TREE_TYPE (base)) && (TREE_CODE (inner_type (TREE_TYPE (base))) @@ -4081,7 +4070,7 @@ ipa_struct_reorg::get_type_field (tree expr, tree &base, bool &indirect, /* Escape the operation of fetching field with pointer offset such as: *(&(t->right)) = malloc (0); -> MEM[(struct node * *)_1 + 8B] = malloc (0); */ - if (current_mode != NORMAL + if (current_layout_opt_level > STRUCT_SPLIT && (TREE_CODE (expr) == MEM_REF) && (offset != 0)) { gcc_assert (can_escape); @@ -4233,7 +4222,7 @@ ipa_struct_reorg::maybe_record_call (cgraph_node *node, gcall *stmt) /* callee_func (_1, _2); Check the callee func, instead of current func. */ if (!(free_or_realloc - || (current_mode == STRUCT_LAYOUT_OPTIMIZE + || (current_layout_opt_level >= STRUCT_REORDER_FIELDS && safe_functions.contains ( node->get_edge (stmt)->callee))) && VOID_POINTER_P (argtypet)) @@ -4265,14 +4254,7 @@ ipa_struct_reorg::record_stmt_expr (tree expr, cgraph_node *node, gimple *stmt) realpart, imagpart, address, escape_from_base)) return; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) - { - if (!opt_for_fn (current_function_decl, flag_ipa_struct_layout)) - { - type->mark_escape (escape_non_optimize, stmt); - } - } - else + if (current_layout_opt_level > NONE) { if (!opt_for_fn (current_function_decl, flag_ipa_struct_reorg)) { @@ -4379,7 +4361,7 @@ ipa_struct_reorg::check_type_and_push (tree newdecl, srdecl *decl, void ipa_struct_reorg::check_alloc_num (gimple *stmt, srtype *type) { - if (current_mode == COMPLETE_STRUCT_RELAYOUT + if (current_layout_opt_level == COMPLETE_STRUCT_RELAYOUT && handled_allocation_stmt (stmt)) { tree arg0 = gimple_call_arg (stmt, 0); @@ -4490,7 +4472,7 @@ ipa_struct_reorg::check_definition_call (srdecl *decl, vec<srdecl*> &worklist) check_type_and_push (gimple_call_arg (stmt, 0), decl, worklist, stmt); } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { if (!handled_allocation_stmt (stmt)) { @@ -4544,7 +4526,8 @@ ipa_struct_reorg::check_definition (srdecl *decl, vec<srdecl*> &worklist) } return; } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE && SSA_NAME_VAR (ssa_name) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS + && SSA_NAME_VAR (ssa_name) && VOID_POINTER_P (TREE_TYPE (SSA_NAME_VAR (ssa_name)))) { type->mark_escape (escape_cast_void, SSA_NAME_DEF_STMT (ssa_name)); @@ -4631,7 +4614,7 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt, vec< { /* In Complete Struct Relayout opti, if lhs type is the same as rhs type, we could return without any harm. */ - if (current_mode == COMPLETE_STRUCT_RELAYOUT) + if (current_layout_opt_level == COMPLETE_STRUCT_RELAYOUT) { return; } @@ -4645,7 +4628,7 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt, vec< if (!get_type_field (other, base, indirect, type1, field, realpart, imagpart, address, escape_from_base)) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { /* release INTEGER_TYPE cast to struct pointer. */ bool cast_from_int_ptr = current_function->is_safe_func && base @@ -4703,7 +4686,8 @@ get_base (tree &base, tree expr) void ipa_struct_reorg::check_ptr_layers (tree a_expr, tree b_expr, gimple* stmt) { - if (current_mode != STRUCT_LAYOUT_OPTIMIZE || current_function->is_safe_func + if (current_layout_opt_level < STRUCT_REORDER_FIELDS + || current_function->is_safe_func || !(POINTER_TYPE_P (TREE_TYPE (a_expr))) || !(POINTER_TYPE_P (TREE_TYPE (b_expr))) || !handled_type (TREE_TYPE (a_expr)) @@ -4779,12 +4763,9 @@ ipa_struct_reorg::check_use (srdecl *decl, gimple *stmt, vec<srdecl*> &worklist) tree rhs2 = gimple_cond_rhs (stmt); tree orhs = rhs1; enum tree_code code = gimple_cond_code (stmt); - if ((current_mode == NORMAL && (code != EQ_EXPR && code != NE_EXPR)) - || (current_mode == COMPLETE_STRUCT_RELAYOUT - && (code != EQ_EXPR && code != NE_EXPR - && code != LT_EXPR && code != LE_EXPR - && code != GT_EXPR && code != GE_EXPR)) - || (current_mode == STRUCT_LAYOUT_OPTIMIZE + if ((current_layout_opt_level == STRUCT_SPLIT + && (code != EQ_EXPR && code != NE_EXPR)) + || (current_layout_opt_level >= COMPLETE_STRUCT_RELAYOUT && (code != EQ_EXPR && code != NE_EXPR && code != LT_EXPR && code != LE_EXPR && code != GT_EXPR && code != GE_EXPR))) @@ -4818,15 +4799,12 @@ ipa_struct_reorg::check_use (srdecl *decl, gimple *stmt, vec<srdecl*> &worklist) tree rhs2 = gimple_assign_rhs2 (stmt); tree orhs = rhs1; enum tree_code code = gimple_assign_rhs_code (stmt); - if ((current_mode == NORMAL && (code != EQ_EXPR && code != NE_EXPR)) - || (current_mode == COMPLETE_STRUCT_RELAYOUT + if ((current_layout_opt_level == STRUCT_SPLIT + && (code != EQ_EXPR && code != NE_EXPR)) + || (current_layout_opt_level >= COMPLETE_STRUCT_RELAYOUT && (code != EQ_EXPR && code != NE_EXPR && code != LT_EXPR && code != LE_EXPR - && code != GT_EXPR && code != GE_EXPR)) - || (current_mode == STRUCT_LAYOUT_OPTIMIZE - && (code != EQ_EXPR && code != NE_EXPR - && code != LT_EXPR && code != LE_EXPR - && code != GT_EXPR && code != GE_EXPR))) + && code != GT_EXPR && code != GE_EXPR))) { mark_expr_escape (rhs1, escape_non_eq, stmt); mark_expr_escape (rhs2, escape_non_eq, stmt); @@ -4945,11 +4923,11 @@ ipa_struct_reorg::record_function (cgraph_node *node) escapes = escape_marked_as_used; else if (!node->local) { - if (current_mode != STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level < STRUCT_REORDER_FIELDS) { escapes = escape_visible_function; } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE && node->externally_visible) + else if (node->externally_visible) { escapes = escape_visible_function; } @@ -4959,14 +4937,7 @@ ipa_struct_reorg::record_function (cgraph_node *node) else if (!tree_versionable_function_p (node->decl)) escapes = escape_noclonable_function; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) - { - if (!opt_for_fn (node->decl, flag_ipa_struct_layout)) - { - escapes = escape_non_optimize; - } - } - else if (current_mode == NORMAL || current_mode == COMPLETE_STRUCT_RELAYOUT) + if (current_layout_opt_level > NONE) { if (!opt_for_fn (node->decl, flag_ipa_struct_reorg)) { @@ -4978,10 +4949,10 @@ ipa_struct_reorg::record_function (cgraph_node *node) gimple_stmt_iterator si; /* Add a safe func mechanism. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { current_function->is_safe_func = safe_functions.contains (node); - if (dump_file) + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, "\nfunction %s/%u: is_safe_func = %d\n", node->name (), node->order, @@ -5194,7 +5165,7 @@ ipa_struct_reorg::record_accesses (void) } /* Add a safe func mechanism. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { record_safe_func_with_void_ptr_parm (); } @@ -5392,8 +5363,7 @@ ipa_struct_reorg::propagate_escape_via_empty_with_no_original (void) void ipa_struct_reorg::prune_escaped_types (void) { - if (current_mode != COMPLETE_STRUCT_RELAYOUT - && current_mode != STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level == STRUCT_SPLIT) { /* Detect recusive types and mark them as escaping. */ detect_cycles (); @@ -5401,7 +5371,7 @@ ipa_struct_reorg::prune_escaped_types (void) mark them as escaping. */ propagate_escape (); } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { propagate_escape_via_original (); propagate_escape_via_empty_with_no_original (); @@ -5461,7 +5431,7 @@ ipa_struct_reorg::prune_escaped_types (void) if (function->args.is_empty () && function->decls.is_empty () && function->globals.is_empty () - && current_mode != STRUCT_LAYOUT_OPTIMIZE) + && current_layout_opt_level < STRUCT_REORDER_FIELDS) { delete function; functions.ordered_remove (i); @@ -5489,7 +5459,7 @@ ipa_struct_reorg::prune_escaped_types (void) /* The escape type is not deleted in STRUCT_LAYOUT_OPTIMIZE, Then the type that contains the escaped type fields can find complete information. */ - if (current_mode != STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level < STRUCT_REORDER_FIELDS) { for (unsigned i = 0; i < types.length ();) { @@ -5539,7 +5509,7 @@ ipa_struct_reorg::create_new_types (void) for (unsigned i = 0; i < types.length (); i++) newtypes += types[i]->create_new_type (); - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { for (unsigned i = 0; i < types.length (); i++) { @@ -5561,14 +5531,31 @@ ipa_struct_reorg::create_new_types (void) } } - if (dump_file) + if (current_layout_opt_level == STRUCT_SPLIT) { - if (newtypes) - fprintf (dump_file, "\nNumber of structures to transform is %d\n", newtypes); - else - fprintf (dump_file, "\nNo structures to transform.\n"); + if (dump_file) + { + if (newtypes) + fprintf (dump_file, "\nNumber of structures to transform in" + " struct split is %d\n", newtypes); + else + fprintf (dump_file, "\nNo structures to transform in" + " struct split.\n"); + } + } + else + { + if (dump_file) + { + if (newtypes) + fprintf (dump_file, "\nNumber of structures to transform" + " is %d\n", newtypes); + else + fprintf (dump_file, "\nNo structures to transform.\n"); + } } + return newtypes != 0; } @@ -5663,8 +5650,7 @@ ipa_struct_reorg::create_new_args (cgraph_node *new_node) char *name = NULL; if (tname) { - name = concat (tname, current_mode == STRUCT_LAYOUT_OPTIMIZE - ? ".slo.0" : ".reorg.0", NULL); + name = concat (tname, ".reorg.0", NULL); new_name = get_identifier (name); free (name); } @@ -5751,9 +5737,7 @@ ipa_struct_reorg::create_new_functions (void) } statistics_counter_event (NULL, "Create new function", 1); new_node = node->create_version_clone_with_body ( - vNULL, NULL, NULL, NULL, NULL, - current_mode == STRUCT_LAYOUT_OPTIMIZE - ? "slo" : "struct_reorg"); + vNULL, NULL, NULL, NULL, NULL, "struct_reorg"); new_node->can_change_signature = node->can_change_signature; new_node->make_local (); f->newnode = new_node; @@ -5871,7 +5855,7 @@ ipa_struct_reorg::rewrite_expr (tree expr, tree newexpr[max_split], bool ignore_ newbase1 = build_fold_addr_expr (newbase1); if (indirect) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { /* Supports the MEM_REF offset. _1 = MEM[(struct arc *)ap_1 + 72B].flow; @@ -5927,8 +5911,7 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi) { bool remove = false; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE - && struct_layout_optimize_level >= DEAD_FIELD_ELIMINATION + if (current_layout_opt_level & DEAD_FIELD_ELIMINATION && remove_dead_field_stmt (gimple_assign_lhs (stmt))) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -5964,10 +5947,10 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi) return remove; } - if ((current_mode != STRUCT_LAYOUT_OPTIMIZE + if ((current_layout_opt_level < STRUCT_REORDER_FIELDS && (gimple_assign_rhs_code (stmt) == EQ_EXPR || gimple_assign_rhs_code (stmt) == NE_EXPR)) - || (current_mode == STRUCT_LAYOUT_OPTIMIZE + || (current_layout_opt_level >= STRUCT_REORDER_FIELDS && (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison))) { @@ -5977,7 +5960,7 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi) tree newrhs2[max_split]; tree_code rhs_code = gimple_assign_rhs_code (stmt); tree_code code = rhs_code == EQ_EXPR ? BIT_AND_EXPR : BIT_IOR_EXPR; - if (current_mode == STRUCT_LAYOUT_OPTIMIZE + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && rhs_code != EQ_EXPR && rhs_code != NE_EXPR) { code = rhs_code; @@ -6024,8 +6007,9 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi) _6 = _4 + _5; _5 = (long unsigned int) _3; _3 = _1 - old_2. */ - if (current_mode != STRUCT_LAYOUT_OPTIMIZE - || (current_mode == STRUCT_LAYOUT_OPTIMIZE && (num != NULL))) + if (current_layout_opt_level < STRUCT_REORDER_FIELDS + || (current_layout_opt_level >= STRUCT_REORDER_FIELDS + && (num != NULL))) { num = gimplify_build1 (gsi, NOP_EXPR, sizetype, num); } @@ -6053,7 +6037,7 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi) } /* Support POINTER_DIFF_EXPR rewriting. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && gimple_assign_rhs_code (stmt) == POINTER_DIFF_EXPR) { tree rhs1 = gimple_assign_rhs1 (stmt); @@ -6240,7 +6224,8 @@ ipa_struct_reorg::rewrite_call (gcall *stmt, gimple_stmt_iterator *gsi) srfunction *f = find_function (node); /* Add a safe func mechanism. */ - if (current_mode == STRUCT_LAYOUT_OPTIMIZE && f && f->is_safe_func) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS + && f && f->is_safe_func) { tree expr = gimple_call_arg (stmt, 0); tree newexpr[max_split]; @@ -6367,9 +6352,9 @@ ipa_struct_reorg::rewrite_cond (gcond *stmt, gimple_stmt_iterator *gsi) tree_code rhs_code = gimple_cond_code (stmt); /* Handle only equals or not equals conditionals. */ - if ((current_mode != STRUCT_LAYOUT_OPTIMIZE + if ((current_layout_opt_level < STRUCT_REORDER_FIELDS && (rhs_code != EQ_EXPR && rhs_code != NE_EXPR)) - || (current_mode == STRUCT_LAYOUT_OPTIMIZE + || (current_layout_opt_level >= STRUCT_REORDER_FIELDS && TREE_CODE_CLASS (rhs_code) != tcc_comparison)) return false; tree lhs = gimple_cond_lhs (stmt); @@ -6429,7 +6414,7 @@ ipa_struct_reorg::rewrite_cond (gcond *stmt, gimple_stmt_iterator *gsi) bool ipa_struct_reorg::rewrite_debug (gimple *stmt, gimple_stmt_iterator *) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { /* Delete debug gimple now. */ return true; @@ -6593,7 +6578,7 @@ ipa_struct_reorg::rewrite_functions (void) then don't rewrite any accesses. */ if (!create_new_types ()) { - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { for (unsigned i = 0; i < functions.length (); i++) { @@ -6612,7 +6597,7 @@ ipa_struct_reorg::rewrite_functions (void) return 0; } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE && dump_file) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && dump_file) { fprintf (dump_file, "=========== all created newtypes: ===========\n\n"); dump_newtypes (dump_file); @@ -6622,13 +6607,13 @@ ipa_struct_reorg::rewrite_functions (void) { retval = TODO_remove_functions; create_new_functions (); - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { prune_escaped_types (); } } - if (current_mode == STRUCT_LAYOUT_OPTIMIZE) + if (current_layout_opt_level >= STRUCT_REORDER_FIELDS) { for (unsigned i = 0; i < functions.length (); i++) { @@ -6794,13 +6779,13 @@ ipa_struct_reorg::execute_struct_relayout (void) } unsigned int -ipa_struct_reorg::execute (enum srmode mode) +ipa_struct_reorg::execute (unsigned int opt) { unsigned int ret = 0; - if (mode == NORMAL || mode == STRUCT_LAYOUT_OPTIMIZE) + if (opt != COMPLETE_STRUCT_RELAYOUT) { - current_mode = mode; + current_layout_opt_level = opt; /* If there is a top-level inline-asm, the pass immediately returns. */ if (symtab->first_asm_symbol ()) @@ -6809,20 +6794,20 @@ ipa_struct_reorg::execute (enum srmode mode) } record_accesses (); prune_escaped_types (); - if (current_mode == NORMAL) + if (opt == STRUCT_SPLIT) { analyze_types (); } ret = rewrite_functions (); } - else if (mode == COMPLETE_STRUCT_RELAYOUT) + else // do COMPLETE_STRUCT_RELAYOUT { if (dump_file) { fprintf (dump_file, "\n\nTry Complete Struct Relayout:\n"); } - current_mode = COMPLETE_STRUCT_RELAYOUT; + current_layout_opt_level = COMPLETE_STRUCT_RELAYOUT; if (symtab->first_asm_symbol ()) { return 0; @@ -6861,67 +6846,48 @@ public: virtual unsigned int execute (function *) { unsigned int ret = 0; - ret = ipa_struct_reorg ().execute (NORMAL); - if (!ret) + unsigned int ret_reorg = 0; + unsigned int level = 0; + switch (struct_layout_optimize_level) { - ret = ipa_struct_reorg ().execute (COMPLETE_STRUCT_RELAYOUT); + case 3: level |= DEAD_FIELD_ELIMINATION; + // FALLTHRU + case 2: level |= STRUCT_REORDER_FIELDS; + // FALLTHRU + case 1: + level |= COMPLETE_STRUCT_RELAYOUT; + level |= STRUCT_SPLIT; + break; + case 0: break; + default: gcc_unreachable (); } - return ret; - } -}; // class pass_ipa_struct_reorg - -bool -pass_ipa_struct_reorg::gate (function *) -{ - return (optimize >= 3 - && flag_ipa_struct_reorg - /* Don't bother doing anything if the program has errors. */ - && !seen_error () - && flag_lto_partition == LTO_PARTITION_ONE - /* Only enable struct optimizations in C since other - languages' grammar forbid. */ - && lang_c_p () - /* Only enable struct optimizations in lto or whole_program. */ - && (in_lto_p || flag_whole_program)); -} + /* Preserved for backward compatibility, reorder fields needs run before + struct split and complete struct relayout. */ + if (flag_ipa_reorder_fields && level < STRUCT_REORDER_FIELDS) + ret = ipa_struct_reorg ().execute (STRUCT_REORDER_FIELDS); -const pass_data pass_data_ipa_struct_layout = -{ - SIMPLE_IPA_PASS, // type - "struct_layout", // name - OPTGROUP_NONE, // optinfo_flags - TV_IPA_STRUCT_LAYOUT, // tv_id - 0, // properties_required - 0, // properties_provided - 0, // properties_destroyed - 0, // todo_flags_start - 0, // todo_flags_finish -}; + if (level >= STRUCT_REORDER_FIELDS) + ret = ipa_struct_reorg ().execute (level); -class pass_ipa_struct_layout : public simple_ipa_opt_pass -{ -public: - pass_ipa_struct_layout (gcc::context *ctxt) - : simple_ipa_opt_pass (pass_data_ipa_struct_layout, ctxt) - {} + if (level >= COMPLETE_STRUCT_RELAYOUT) + { + /* Preserved for backward compatibility. */ + ret_reorg = ipa_struct_reorg ().execute (STRUCT_SPLIT); + if (!ret_reorg) + ret_reorg = ipa_struct_reorg ().execute (COMPLETE_STRUCT_RELAYOUT); + } - /* opt_pass methods: */ - virtual bool gate (function *); - virtual unsigned int execute (function *) - { - unsigned int ret = 0; - ret = ipa_struct_reorg ().execute (STRUCT_LAYOUT_OPTIMIZE); - return ret; + return ret | ret_reorg; } -}; // class pass_ipa_struct_layout +}; // class pass_ipa_struct_reorg bool -pass_ipa_struct_layout::gate (function *) +pass_ipa_struct_reorg::gate (function *) { return (optimize >= 3 - && flag_ipa_struct_layout + && flag_ipa_struct_reorg /* Don't bother doing anything if the program has errors. */ && !seen_error () && flag_lto_partition == LTO_PARTITION_ONE @@ -6939,9 +6905,3 @@ make_pass_ipa_struct_reorg (gcc::context *ctxt) { return new pass_ipa_struct_reorg (ctxt); } - -simple_ipa_opt_pass * -make_pass_ipa_struct_layout (gcc::context *ctxt) -{ - return new pass_ipa_struct_layout (ctxt); -} diff --git a/gcc/opts.c b/gcc/opts.c index c3877c24e..f12b13599 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -2696,15 +2696,20 @@ common_handle_option (struct gcc_options *opts, break; case OPT_fipa_struct_reorg_: - opts->x_struct_layout_optimize_level = value; - if (value > 1) - { - SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_struct_layout, value); - } /* No break here - do -fipa-struct-reorg processing. */ /* FALLTHRU. */ case OPT_fipa_struct_reorg: opts->x_flag_ipa_struct_reorg = value; + if (value && !opts->x_struct_layout_optimize_level) + { + /* Using the -fipa-struct-reorg option is equivalent to using + -fipa-struct-reorg=1. */ + opts->x_struct_layout_optimize_level = 1; + } + break; + + case OPT_fipa_reorder_fields: + SET_OPTION_IF_UNSET (opts, opts_set, flag_ipa_struct_reorg, value); break; case OPT_fprofile_generate_: diff --git a/gcc/passes.def b/gcc/passes.def index 94554cc1d..f3b6048d8 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -175,7 +175,6 @@ along with GCC; see the file COPYING3. If not see INSERT_PASSES_AFTER (all_late_ipa_passes) NEXT_PASS (pass_materialize_all_clones); NEXT_PASS (pass_ipa_pta); - NEXT_PASS (pass_ipa_struct_layout); /* FIXME: this should a normal IP pass */ NEXT_PASS (pass_ipa_struct_reorg); NEXT_PASS (pass_omp_simd_clone); diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h index f62222a96..1e7341b24 100644 --- a/gcc/symbol-summary.h +++ b/gcc/symbol-summary.h @@ -61,7 +61,7 @@ protected: { /* In structure optimizatons, we call new to ensure that the allocated memory is initialized to 0. */ - if (flag_ipa_struct_layout || flag_ipa_struct_reorg) + if (flag_ipa_struct_reorg) return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T () : new T (); /* Call gcc_internal_because we do not want to call finalizer for @@ -77,7 +77,7 @@ protected: ggc_delete (item); else { - if (flag_ipa_struct_layout || flag_ipa_struct_reorg) + if (flag_ipa_struct_reorg) delete item; else m_allocator.remove (item); diff --git a/gcc/testsuite/gcc.dg/struct/dfe_DTE_verify.c b/gcc/testsuite/gcc.dg/struct/dfe_DTE_verify.c index 4261d2352..afa181e07 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_DTE_verify.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_DTE_verify.c @@ -83,4 +83,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_ele_minus_verify.c b/gcc/testsuite/gcc.dg/struct/dfe_ele_minus_verify.c index 42d38c63a..c87db2aba 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_ele_minus_verify.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_ele_minus_verify.c @@ -57,4 +57,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_board_init.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_board_init.c index 4e52564b6..d217f7bd8 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_board_init.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_board_init.c @@ -74,4 +74,4 @@ LBF_DFU_If_Needed (void) } } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c index 894e9f460..e56bf467b 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c @@ -74,4 +74,4 @@ claw_snd_conn_req (struct net_device *dev, __u8 link) return rc; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_dtrace.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_dtrace.c index 13a226ee8..c86c4bb3c 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_dtrace.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_dtrace.c @@ -53,4 +53,4 @@ dtrace_bcmp (const void *s1, const void *s2, size_t len) return (0); } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_gc.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_gc.c index 1fff2cb9d..8484d29d2 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_gc.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_gc.c @@ -159,4 +159,4 @@ gc_gray_mark (mrb_state *mrb, mrb_gc *gc, struct RBasic *obj) return children; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_hpsa.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_hpsa.c index 0f577667c..300b2dac4 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_hpsa.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_hpsa.c @@ -123,4 +123,4 @@ hpsa_cmd_dev_match (struct ctlr_info *h, struct CommandList *c, return match; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 0 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_mv_udc_core.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_mv_udc_core.c index 9801f87f1..9397b98ea 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_mv_udc_core.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_mv_udc_core.c @@ -79,4 +79,4 @@ ep0_reset (struct mv_udc *udc) } } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_tcp_usrreq.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_tcp_usrreq.c index 5570c762e..0ae75e13e 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_tcp_usrreq.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_tcp_usrreq.c @@ -55,4 +55,4 @@ tcp_usr_listen (struct socket *so, struct proc *p) COMMON_END (PRU_LISTEN); } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_extr_ui_main.c b/gcc/testsuite/gcc.dg/struct/dfe_extr_ui_main.c index 50ab9cc24..512fb37a7 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_extr_ui_main.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_ui_main.c @@ -58,4 +58,4 @@ UI_LoadMods () } } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_mem_ref_offset.c b/gcc/testsuite/gcc.dg/struct/dfe_mem_ref_offset.c index 53583fe82..0dea5517c 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_mem_ref_offset.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_mem_ref_offset.c @@ -55,4 +55,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_mul_layer_ptr_record_bug.c b/gcc/testsuite/gcc.dg/struct/dfe_mul_layer_ptr_record_bug.c index fd675ec2e..00bd911c1 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_mul_layer_ptr_record_bug.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_mul_layer_ptr_record_bug.c @@ -27,4 +27,4 @@ main() { return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_ptr_diff.c b/gcc/testsuite/gcc.dg/struct/dfe_ptr_diff.c index 600e7908b..0cfa6554e 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_ptr_diff.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_ptr_diff.c @@ -68,4 +68,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 3 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 3 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_ptr_negate_expr.c b/gcc/testsuite/gcc.dg/struct/dfe_ptr_negate_expr.c index f411364a7..4a7069244 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_ptr_negate_expr.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_ptr_negate_expr.c @@ -52,4 +52,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/dfe_ptr_ptr.c b/gcc/testsuite/gcc.dg/struct/dfe_ptr_ptr.c index a4e723763..b91efe10f 100644 --- a/gcc/testsuite/gcc.dg/struct/dfe_ptr_ptr.c +++ b/gcc/testsuite/gcc.dg/struct/dfe_ptr_ptr.c @@ -52,4 +52,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_layout" } } */ +/* { dg-final { scan-ipa-dump-times "Dead field elimination" 2 "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/rf_DTE_struct_instance_field.c b/gcc/testsuite/gcc.dg/struct/rf_DTE_struct_instance_field.c index 882a695b0..1b6a462e2 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_DTE_struct_instance_field.c +++ b/gcc/testsuite/gcc.dg/struct/rf_DTE_struct_instance_field.c @@ -72,4 +72,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_DTE_verify.c b/gcc/testsuite/gcc.dg/struct/rf_DTE_verify.c index 20ecee545..346c71264 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_DTE_verify.c +++ b/gcc/testsuite/gcc.dg/struct/rf_DTE_verify.c @@ -91,4 +91,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_check_ptr_layers_bug.c b/gcc/testsuite/gcc.dg/struct/rf_check_ptr_layers_bug.c index ad879fc11..8eb16c8d6 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_check_ptr_layers_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_check_ptr_layers_bug.c @@ -21,4 +21,4 @@ main() { g(); } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_create_fields_bug.c b/gcc/testsuite/gcc.dg/struct/rf_create_fields_bug.c index f0c9d8f39..7d7641f01 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_create_fields_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_create_fields_bug.c @@ -79,4 +79,4 @@ main() return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_create_new_func_bug.c b/gcc/testsuite/gcc.dg/struct/rf_create_new_func_bug.c index fa5e6c2d0..63fb3f828 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_create_new_func_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_create_new_func_bug.c @@ -53,4 +53,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ele_minus_verify.c b/gcc/testsuite/gcc.dg/struct/rf_ele_minus_verify.c index 2966869e7..8c431e15f 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ele_minus_verify.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ele_minus_verify.c @@ -57,4 +57,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_escape_by_base.c b/gcc/testsuite/gcc.dg/struct/rf_escape_by_base.c index b74b9e5e9..efc95a4cd 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_escape_by_base.c +++ b/gcc/testsuite/gcc.dg/struct/rf_escape_by_base.c @@ -80,4 +80,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c b/gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c index cf85c6109..75fc10575 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c +++ b/gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c @@ -69,4 +69,4 @@ main() return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_mem_ref_offset.c b/gcc/testsuite/gcc.dg/struct/rf_mem_ref_offset.c index 61fd9f755..9fb06877b 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_mem_ref_offset.c +++ b/gcc/testsuite/gcc.dg/struct/rf_mem_ref_offset.c @@ -55,4 +55,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_mul_layer_ptr_record_bug.c b/gcc/testsuite/gcc.dg/struct/rf_mul_layer_ptr_record_bug.c index 2c115da02..e8eb0eaa0 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_mul_layer_ptr_record_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_mul_layer_ptr_record_bug.c @@ -27,4 +27,4 @@ main() { return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_pass_conflict.c b/gcc/testsuite/gcc.dg/struct/rf_pass_conflict.c index c7646d8b7..bd535afd0 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_pass_conflict.c +++ b/gcc/testsuite/gcc.dg/struct/rf_pass_conflict.c @@ -106,4 +106,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr2void_lto.c b/gcc/testsuite/gcc.dg/struct/rf_ptr2void_lto.c index 01c000375..11393a197 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr2void_lto.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr2void_lto.c @@ -84,4 +84,4 @@ main () return cnt; } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr_diff.c b/gcc/testsuite/gcc.dg/struct/rf_ptr_diff.c index f962163fe..d601fae64 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr_diff.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr_diff.c @@ -68,4 +68,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr_negate_expr.c b/gcc/testsuite/gcc.dg/struct/rf_ptr_negate_expr.c index 6558b1797..4d5f25aa1 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr_negate_expr.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr_negate_expr.c @@ -52,4 +52,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr_offset.c b/gcc/testsuite/gcc.dg/struct/rf_ptr_offset.c index 6d528ed5b..b3891fde9 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr_offset.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr_offset.c @@ -31,4 +31,4 @@ main () printf (" Tree.\n"); } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr.c b/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr.c index e95cf2e5d..4df79e4f0 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr.c @@ -52,4 +52,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr_ptr.c b/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr_ptr.c index cb4054522..49d2106d1 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr_ptr.c +++ b/gcc/testsuite/gcc.dg/struct/rf_ptr_ptr_ptr.c @@ -55,4 +55,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_rescusive_type.c b/gcc/testsuite/gcc.dg/struct/rf_rescusive_type.c index 38bddbae5..f71c7894f 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_rescusive_type.c +++ b/gcc/testsuite/gcc.dg/struct/rf_rescusive_type.c @@ -54,4 +54,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_rewrite_assign_more_cmp.c b/gcc/testsuite/gcc.dg/struct/rf_rewrite_assign_more_cmp.c index 86034f042..721cee2c6 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_rewrite_assign_more_cmp.c +++ b/gcc/testsuite/gcc.dg/struct/rf_rewrite_assign_more_cmp.c @@ -62,4 +62,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_bug.c b/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_bug.c index aae7c4bc9..3871d3d99 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_bug.c @@ -69,4 +69,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_more_cmp.c b/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_more_cmp.c index 8672e7552..5ad206433 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_more_cmp.c +++ b/gcc/testsuite/gcc.dg/struct/rf_rewrite_cond_more_cmp.c @@ -55,4 +55,4 @@ main() return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_rewrite_phi_bug.c b/gcc/testsuite/gcc.dg/struct/rf_rewrite_phi_bug.c index 2d67434a0..a002f9889 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_rewrite_phi_bug.c +++ b/gcc/testsuite/gcc.dg/struct/rf_rewrite_phi_bug.c @@ -78,4 +78,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 3" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_visible_func.c b/gcc/testsuite/gcc.dg/struct/rf_visible_func.c index a8cf2b63c..f77a062bd 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_visible_func.c +++ b/gcc/testsuite/gcc.dg/struct/rf_visible_func.c @@ -89,4 +89,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/rf_void_ptr_param_func.c b/gcc/testsuite/gcc.dg/struct/rf_void_ptr_param_func.c index b6cba3c34..cba6225a5 100644 --- a/gcc/testsuite/gcc.dg/struct/rf_void_ptr_param_func.c +++ b/gcc/testsuite/gcc.dg/struct/rf_void_ptr_param_func.c @@ -51,4 +51,4 @@ main() return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_layout" } } */ \ No newline at end of file +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ \ No newline at end of file diff --git a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c index fb135ef0b..e3d219fe1 100644 --- a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c +++ b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c @@ -22,4 +22,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split." "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp index ac5585813..2eebef768 100644 --- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp +++ b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp @@ -64,8 +64,6 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/complete_struct_relayout "" "-fipa-struct-reorg=1 -fdump-ipa-all -flto-partition=one -fwhole-program" # -fipa-struct-reorg=2 -gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/rf*.c]] \ - "" "-fipa-struct-reorg=2 -fdump-ipa-all -flto-partition=one -fwhole-program" gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/wo_prof_*.c]] \ "" "-fipa-struct-reorg=2 -fdump-ipa-all -flto-partition=one -fwhole-program" gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/w_ratio_*.c]] \ @@ -80,6 +78,8 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/csr_*.c]] \ "" "-fipa-struct-reorg=2 -fdump-ipa-all -flto-partition=one -fwhole-program" gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/complete_struct_relayout.c]] \ "" "-fipa-struct-reorg=2 -fdump-ipa-all -flto-partition=one -fwhole-program" +gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/rf*.c]] \ + "" "-fipa-struct-reorg=2 -fdump-ipa-all -flto-partition=one -fwhole-program" # -fipa-struct-reorg=3 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dfe*.c]] \ diff --git a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c index 23444fe8b..a73ff8e7e 100644 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c @@ -27,4 +27,4 @@ int main() return g (); } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split." "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c index 44babd35b..d7ab7d21c 100644 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c @@ -26,4 +26,4 @@ int main() assert (f(1, 2) == 3); } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 2" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c index 2d1f95c99..9e5b192eb 100644 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c @@ -25,4 +25,4 @@ int main() f (NULL, NULL, 1); } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c index e5a8a6c84..27b4b56e0 100644 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c @@ -56,4 +56,4 @@ main (void) return 0; } -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split." "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c index 733413a94..9e0f84da8 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c @@ -26,4 +26,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c index 0ef686e74..c868347e3 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c @@ -39,4 +39,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c index 23a53be53..185ff3125 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c @@ -34,4 +34,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c index 0cbb172f2..6294fb2a2 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c @@ -37,4 +37,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c index f900b1349..3ca4e0e71 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c @@ -28,4 +28,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c index 13b4cdc70..ac99b9e62 100644 --- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c +++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c @@ -61,4 +61,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 2" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c index dcc545964..afa145a57 100644 --- a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c +++ b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c @@ -40,4 +40,4 @@ main () /*--------------------------------------------------------------------------*/ /* Arrays are not handled. */ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c index 6d6375fc1..7fa6ae275 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_field.c @@ -23,4 +23,4 @@ int main() } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c index 9d3213408..b3bde5836 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_array_through_pointer.c @@ -35,4 +35,4 @@ main () return 0; } -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c index d79992a53..f2bb82b94 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_double_malloc.c @@ -26,4 +26,4 @@ int main() } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c b/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c index ee9b0d765..0685cf8fe 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_empty_str.c @@ -41,4 +41,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "No structures to transform" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c index 9ebb2b4cc..1a0a5a9c6 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_arg_to_local.c @@ -40,5 +40,5 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c index 60d2466e1..9533538c4 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_substr_array.c @@ -30,4 +30,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c index 1c5a3aa15..100a93868 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_array.c @@ -29,4 +29,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c index a0d1467fe..669d0b886 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c @@ -42,4 +42,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c index 6c24e1c8b..ce6c1544c 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_array.c @@ -37,4 +37,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" { xfail *-*-* } } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c index 8f2f8143f..eca2ebf32 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c @@ -40,4 +40,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var-1.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var-1.c index 98bf01a6d..6f8f94d7d 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var-1.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var-1.c @@ -44,4 +44,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c index 66b0f967c..2ca729d1f 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c @@ -44,4 +44,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c index d28bcfb02..6000b2919 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c @@ -39,4 +39,4 @@ main () /*--------------------------------------------------------------------------*/ /* Two more fields structure is not splitted. */ -/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split." "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c index 37a6a43a8..f4a103409 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_global.c @@ -31,4 +31,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 1" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c index ca9a8efcf..0c97173eb 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_single_str_local.c @@ -31,4 +31,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "No structures to transform" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in struct split" "struct_reorg" } } */ diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c index cba92e995..bc8eacc77 100644 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_two_strs.c @@ -64,4 +64,4 @@ main () } /*--------------------------------------------------------------------------*/ -/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in struct split is 2" "struct_reorg" } } */ diff --git a/gcc/timevar.def b/gcc/timevar.def index e9866ebf0..2814b14f2 100644 --- a/gcc/timevar.def +++ b/gcc/timevar.def @@ -80,7 +80,6 @@ DEFTIMEVAR (TV_IPA_CONSTANT_PROP , "ipa cp") DEFTIMEVAR (TV_IPA_INLINING , "ipa inlining heuristics") DEFTIMEVAR (TV_IPA_FNSPLIT , "ipa function splitting") DEFTIMEVAR (TV_IPA_COMDATS , "ipa comdats") -DEFTIMEVAR (TV_IPA_STRUCT_LAYOUT , "ipa struct layout optimization") DEFTIMEVAR (TV_IPA_STRUCT_REORG , "ipa struct reorg optimization") DEFTIMEVAR (TV_IPA_EXTEND_AUTO_PROFILE, "ipa extend auto profile") DEFTIMEVAR (TV_IPA_OPT , "ipa various optimizations") diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 09dd9b289..2b4864b89 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -510,7 +510,6 @@ extern ipa_opt_pass_d *make_pass_ipa_odr (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_reference (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_hsa (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_pure_const (gcc::context *ctxt); -extern simple_ipa_opt_pass *make_pass_ipa_struct_layout (gcc::context *ctxt); extern simple_ipa_opt_pass *make_pass_ipa_struct_reorg (gcc::context *ctxt); extern simple_ipa_opt_pass *make_pass_ipa_extend_auto_profile (gcc::context *ctxt); diff --git a/gcc/tree.c b/gcc/tree.c index 84a440b35..8bbd54e0d 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -5222,7 +5222,7 @@ fld_simplified_type_name (tree type) /* Simplify type will cause that struct A and struct A within struct B are different type pointers, so skip it in structure optimizations. */ - if ((flag_ipa_struct_layout || flag_ipa_struct_reorg) + if (flag_ipa_struct_reorg && lang_c_p () && flag_lto_partition == LTO_PARTITION_ONE && (in_lto_p || flag_whole_program)) @@ -5469,7 +5469,7 @@ fld_simplified_type (tree t, class free_lang_data_d *fld) /* Simplify type will cause that struct A and struct A within struct B are different type pointers, so skip it in structure optimizations. */ - if ((flag_ipa_struct_layout || flag_ipa_struct_reorg) + if (flag_ipa_struct_reorg && lang_c_p () && flag_lto_partition == LTO_PARTITION_ONE && (in_lto_p || flag_whole_program)) -- 2.27.0.windows.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2