22 Star 27 Fork 128

src-openEuler/gcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0024-Struct-Reorg-Refactoring-and-merge-reorder-fields-in.patch 59.44 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470
From 535d00d764c38e70c563ac59e702a20e3b744a95 Mon Sep 17 00:00:00 2001
From: liyancheng <412998149@qq.com>
Date: Tue, 29 Aug 2023 19:18:21 +0800
Subject: [PATCH] [Struct Reorg] Refactoring and merge reorder fields into
struct reorg optimization
Merge reorder_fields pass into struct_reorg pass. Using flag -fipa-struct-reorg=[0,1,2,3]
to enable none, strcut reorg, reorder fields and dfe optimizations.
---
gcc/gimple-ssa-warn-access.cc | 2 +-
gcc/ipa-free-lang-data.cc | 9 +-
gcc/ipa-struct-reorg/ipa-struct-reorg.cc | 353 ++++++++----------
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.dg/struct/rf_external_func_types.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/struct-reorg.exp | 2 +-
gcc/timevar.def | 1 -
gcc/tree-pass.h | 1 -
48 files changed, 201 insertions(+), 252 deletions(-)
diff --git a/gcc/gimple-ssa-warn-access.cc b/gcc/gimple-ssa-warn-access.cc
index 7f5c92c96..a24645783 100644
--- a/gcc/gimple-ssa-warn-access.cc
+++ b/gcc/gimple-ssa-warn-access.cc
@@ -2198,7 +2198,7 @@ pass_waccess::gate (function *)
In pass waccess, it will traverse all SSA and cause ICE
when handling these unused SSA. So temporarily disable
pass waccess when enable structure optimizations. */
- if (flag_ipa_struct_reorg || flag_ipa_reorder_fields)
+ if (flag_ipa_struct_reorg)
return false;
return (warn_free_nonheap_object
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index a88381ddb..801e95cea 100644
--- a/gcc/ipa-free-lang-data.cc
+++ b/gcc/ipa-free-lang-data.cc
@@ -49,6 +49,9 @@
#include "except.h"
#include "ipa-utils.h"
+/* Check whether in C language or LTO with only C language. */
+extern bool lang_c_p (void);
+
namespace {
/* Data used when collecting DECLs and TYPEs for language data removal. */
@@ -105,7 +108,8 @@ 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_reorg || flag_ipa_reorder_fields)
+ if (flag_ipa_struct_reorg && lang_c_p ()
+ && flag_lto_partition == LTO_PARTITION_ONE)
return TYPE_NAME (type);
if (!TYPE_NAME (type) || TREE_CODE (TYPE_NAME (type)) != TYPE_DECL)
@@ -349,7 +353,8 @@ 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_reorg || flag_ipa_reorder_fields)
+ if (flag_ipa_struct_reorg && lang_c_p ()
+ && flag_lto_partition == LTO_PARTITION_ONE)
return t;
if (POINTER_TYPE_P (t))
return fld_incomplete_type_of (t, fld);
diff --git a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
index eac5fac7e..dcc6df496 100644
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.cc
@@ -108,6 +108,37 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "langhooks.h"
+/* Check whether in C language or LTO with only C language. */
+
+bool
+lang_c_p (void)
+{
+ const char *language_string = lang_hooks.name;
+
+ if (!language_string)
+ return false;
+
+ if (lang_GNU_C ())
+ return true;
+ else if (strcmp (language_string, "GNU GIMPLE") == 0) // for LTO check
+ {
+ unsigned i = 0;
+ tree t = NULL_TREE;
+
+ FOR_EACH_VEC_SAFE_ELT (all_translation_units, i, t)
+ {
+ language_string = TRANSLATION_UNIT_LANGUAGE (t);
+ if (language_string == NULL
+ || strncmp (language_string, "GNU C", 5)
+ || (language_string[5] != '\0'
+ && !(ISDIGIT (language_string[5]))))
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
+
namespace {
using namespace struct_reorg;
@@ -198,37 +229,6 @@ gimplify_build1 (gimple_stmt_iterator *gsi, enum tree_code code, tree type,
GSI_SAME_STMT);
}
-/* Check whether in C language or LTO with only C language. */
-
-static bool
-lang_c_p (void)
-{
- const char *language_string = lang_hooks.name;
-
- if (!language_string)
- return false;
-
- if (lang_GNU_C ())
- return true;
- else if (strcmp (language_string, "GNU GIMPLE") == 0) // For LTO check
- {
- unsigned i = 0;
- tree t = NULL_TREE;
-
- FOR_EACH_VEC_SAFE_ELT (all_translation_units, i, t)
- {
- language_string = TRANSLATION_UNIT_LANGUAGE (t);
- if (language_string == NULL
- || strncmp (language_string, "GNU C", 5)
- || (language_string[5] != '\0'
- && !(ISDIGIT (language_string[5]))))
- return false;
- }
- return true;
- }
- return false;
-}
-
/* Get the number of pointer layers. */
int
@@ -262,29 +262,23 @@ is_from_void_ptr_parm (tree ssa_name)
&& VOID_POINTER_P (TREE_TYPE (ssa_name)));
}
-enum srmode
-{
- NORMAL = 0,
- COMPLETE_STRUCT_RELAYOUT,
- STRUCT_REORDER_FIELDS
-};
-
/* Enum the struct layout optimize level,
which should be the same as the option -fstruct-reorg=. */
enum struct_layout_opt_level
{
NONE = 0,
- STRUCT_REORG,
- STRUCT_REORDER_FIELDS_SLO,
- 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);
static 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;
/* Return true if one of these types is created by struct-reorg. */
@@ -626,7 +620,7 @@ void
srtype::simple_dump (FILE *f)
{
print_generic_expr (f, type);
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
fprintf (f, "(%d)", TYPE_UID (type));
}
@@ -673,7 +667,7 @@ srfield::create_new_fields (tree newtype[max_split],
tree newfields[max_split],
tree newlast[max_split])
{
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
create_new_reorder_fields (newtype, newfields, newlast);
return;
@@ -861,7 +855,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_REORDER_FIELDS)
+ && current_layout_opt_level < STRUCT_REORDER_FIELDS)
{
newtype[0] = type;
return false;
@@ -889,8 +883,7 @@ srtype::create_new_type (void)
sprintf (id, "%d", i);
if (tname)
{
- name = concat (tname, current_mode == STRUCT_REORDER_FIELDS
- ? ".reorder." : ".reorg.", id, NULL);
+ name = concat (tname, ".reorg.", id, NULL);
TYPE_NAME (newtype[i]) = build_decl (UNKNOWN_LOCATION,
TYPE_DECL,
get_identifier (name),
@@ -902,8 +895,7 @@ srtype::create_new_type (void)
for (unsigned i = 0; i < fields.length (); i++)
{
srfield *f = fields[i];
- if (current_mode == STRUCT_REORDER_FIELDS
- && 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);
@@ -924,13 +916,12 @@ srtype::create_new_type (void)
warn_padded = save_warn_padded;
- if (current_mode == STRUCT_REORDER_FIELDS
+ 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_REORDER_FIELDS
- && 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");
}
@@ -1052,8 +1043,7 @@ srfunction::create_new_decls (void)
sprintf (id, "%d", j);
if (tname)
{
- name = concat (tname, current_mode == STRUCT_REORDER_FIELDS
- ? ".reorder." : ".reorg.", id, NULL);
+ name = concat (tname, ".reorg.", id, NULL);
new_name = get_identifier (name);
free (name);
}
@@ -1264,7 +1254,7 @@ public:
bool done_recording;
// Methods
- unsigned execute (enum srmode mode);
+ unsigned execute (unsigned int opt);
void mark_type_as_escape (tree type, escape_type escapes,
gimple *stmt = NULL);
@@ -2651,7 +2641,7 @@ escape_type_volatile_array_or_ptrptr (tree type)
return escape_volatile;
if (isarraytype (type))
return escape_array;
- if (isptrptr (type) && (current_mode != STRUCT_REORDER_FIELDS))
+ if (isptrptr (type) && (current_layout_opt_level < STRUCT_REORDER_FIELDS))
return escape_ptr_ptr;
return does_not_escape;
}
@@ -2672,12 +2662,11 @@ 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_REORDER_FIELDS)
+ 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_REORDER_FIELDS
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& TREE_CODE (field_type) == RECORD_TYPE)
field_srtype->mark_escape (escape_instance_field, NULL);
}
@@ -2704,7 +2693,7 @@ ipa_struct_reorg::record_struct_field_types (tree base_type,
base_srtype->mark_escape (e, 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_REORDER_FIELDS
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& TREE_CODE (field_type) == RECORD_TYPE)
base_srtype->mark_escape (escape_instance_field, NULL);
if (handled_type (field_type))
@@ -2895,8 +2884,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_REORDER_FIELDS)
+ if (current_layout_opt_level >= COMPLETE_STRUCT_RELAYOUT
&& TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE)
e = escape_separate_instance;
@@ -3000,7 +2988,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_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
l_find = !(current_function->is_safe_func
&& TREE_CODE (lhs) == SSA_NAME
@@ -3046,7 +3034,7 @@ ipa_struct_reorg::find_vars (gimple *stmt)
}
}
}
- else if ((current_mode == STRUCT_REORDER_FIELDS)
+ 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
@@ -3057,7 +3045,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_REORDER_FIELDS)
+ 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))),
@@ -3270,8 +3258,7 @@ ipa_struct_reorg::maybe_record_stmt (cgraph_node *node, gimple *stmt)
default:
break;
}
- if (current_mode == STRUCT_REORDER_FIELDS
- && 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,
@@ -3427,9 +3414,11 @@ is_result_of_mult (tree arg, tree *num, tree struct_size)
arg = gimple_assign_rhs1 (size_def_stmt);
size_def_stmt = SSA_NAME_DEF_STMT (arg);
}
- else if (rhs_code == NEGATE_EXPR && current_mode == STRUCT_REORDER_FIELDS)
+ else if (rhs_code == NEGATE_EXPR
+ && 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_REORDER_FIELDS)
+ else if (rhs_code == NOP_EXPR
+ && current_layout_opt_level >= STRUCT_REORDER_FIELDS)
return trace_calculate_diff (size_def_stmt, num);
else
{
@@ -3447,15 +3436,15 @@ is_result_of_mult (tree arg, tree *num, tree struct_size)
bool
ipa_struct_reorg::handled_allocation_stmt (gimple *stmt)
{
- if ((current_mode == STRUCT_REORDER_FIELDS)
+ 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)
@@ -3576,7 +3565,7 @@ ipa_struct_reorg::maybe_mark_or_record_other_side (tree side, tree other,
/* 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_REORDER_FIELDS
+ else if (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& TREE_CODE (side) == SSA_NAME
&& VOID_POINTER_P (TREE_TYPE (side))
&& SSA_NAME_VAR (side)
@@ -3834,7 +3823,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_REORDER_FIELDS)
+ 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)))
@@ -3896,7 +3885,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);
@@ -4060,7 +4049,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_REORDER_FIELDS
+ || (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& safe_functions.contains (
node->get_edge (stmt)->callee)))
&& VOID_POINTER_P (argtypet))
@@ -4088,12 +4077,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_REORDER_FIELDS)
- {
- if (!opt_for_fn (current_function_decl, flag_ipa_reorder_fields))
- 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))
type->mark_escape (escape_non_optimize, stmt);
@@ -4197,7 +4181,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);
@@ -4291,7 +4275,7 @@ ipa_struct_reorg::check_definition_call (srdecl *decl, vec<srdecl *> &worklist)
if (gimple_call_builtin_p (stmt, BUILT_IN_REALLOC))
check_type_and_push (gimple_call_arg (stmt, 0), decl, worklist, stmt);
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
if (!handled_allocation_stmt (stmt))
type->mark_escape (escape_return, stmt);
@@ -4341,7 +4325,8 @@ ipa_struct_reorg::check_definition (srdecl *decl, vec<srdecl *> &worklist)
type->mark_escape (escape_cast_void, SSA_NAME_DEF_STMT (ssa_name));
return;
}
- if (current_mode == STRUCT_REORDER_FIELDS && 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));
gimple *stmt = SSA_NAME_DEF_STMT (ssa_name);
@@ -4425,7 +4410,7 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt,
{
/* In Complete Struct Relayout, 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;
tree base;
@@ -4437,7 +4422,7 @@ ipa_struct_reorg::check_other_side (srdecl *decl, tree other, gimple *stmt,
if (!get_type_field (other, base, indirect, type1, field,
realpart, imagpart, address, escape_from_base))
{
- if (current_mode == STRUCT_REORDER_FIELDS)
+ 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
@@ -4487,7 +4472,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_REORDER_FIELDS || 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))
@@ -4554,12 +4540,9 @@ ipa_struct_reorg::check_use (srdecl *decl, gimple *stmt,
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_REORDER_FIELDS
+ 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)))
@@ -4592,15 +4575,12 @@ ipa_struct_reorg::check_use (srdecl *decl, gimple *stmt,
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
- && (code != EQ_EXPR && code != NE_EXPR
- && code != LT_EXPR && code != LE_EXPR
- && code != GT_EXPR && code != GE_EXPR))
- || (current_mode == STRUCT_REORDER_FIELDS
+ 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)))
+ && code != GT_EXPR && code != GE_EXPR)))
{
mark_expr_escape (rhs1, escape_non_eq, stmt);
mark_expr_escape (rhs2, escape_non_eq, stmt);
@@ -4722,9 +4702,9 @@ ipa_struct_reorg::record_function (cgraph_node *node)
escapes = escape_marked_as_used;
else if (!node->local)
{
- if (current_mode != STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level < STRUCT_REORDER_FIELDS)
escapes = escape_visible_function;
- if (current_mode == STRUCT_REORDER_FIELDS && node->externally_visible)
+ else if (node->externally_visible)
escapes = escape_visible_function;
}
else if (!node->can_change_signature)
@@ -4732,12 +4712,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_REORDER_FIELDS)
- {
- if (!opt_for_fn (node->decl, flag_ipa_reorder_fields))
- 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))
escapes = escape_non_optimize;
@@ -4747,10 +4722,10 @@ ipa_struct_reorg::record_function (cgraph_node *node)
gimple_stmt_iterator si;
/* Add a safe func mechanism. */
- if (current_mode == STRUCT_REORDER_FIELDS)
+ 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,
@@ -4958,7 +4933,7 @@ ipa_struct_reorg::record_accesses (void)
}
/* Add a safe func mechanism. */
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
record_safe_func_with_void_ptr_parm ();
FOR_EACH_FUNCTION (cnode)
@@ -5174,8 +5149,7 @@ ipa_struct_reorg::propagate_escape_via_ext_func_types (void)
void
ipa_struct_reorg::prune_escaped_types (void)
{
- if (current_mode != COMPLETE_STRUCT_RELAYOUT
- && current_mode != STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level == STRUCT_SPLIT)
{
/* Detect recusive types and mark them as escaping. */
detect_cycles ();
@@ -5183,7 +5157,7 @@ ipa_struct_reorg::prune_escaped_types (void)
mark them as escaping. */
propagate_escape ();
}
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
propagate_escape_via_original ();
propagate_escape_via_empty_with_no_original ();
@@ -5244,7 +5218,7 @@ ipa_struct_reorg::prune_escaped_types (void)
if (function->args.is_empty ()
&& function->decls.is_empty ()
&& function->globals.is_empty ()
- && current_mode != STRUCT_REORDER_FIELDS)
+ && current_layout_opt_level < STRUCT_REORDER_FIELDS)
{
delete function;
functions.ordered_remove (i);
@@ -5272,7 +5246,7 @@ ipa_struct_reorg::prune_escaped_types (void)
/* The escape type is not deleted in STRUCT_REORDER_FIELDS,
Then the type that contains the escaped type fields
can find complete information. */
- if (current_mode != STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level < STRUCT_REORDER_FIELDS)
{
for (unsigned i = 0; i < types.length ();)
{
@@ -5320,7 +5294,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_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
for (unsigned i = 0; i < types.length (); i++)
{
@@ -5444,8 +5418,7 @@ ipa_struct_reorg::create_new_args (cgraph_node *new_node)
char *name = NULL;
if (tname)
{
- name = concat (tname, current_mode == STRUCT_REORDER_FIELDS
- ? ".reorder.0" : ".reorg.0", NULL);
+ name = concat (tname, ".reorg.0", NULL);
new_name = get_identifier (name);
free (name);
}
@@ -5532,9 +5505,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_REORDER_FIELDS
- ? "struct_reorder" : "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;
@@ -5661,7 +5632,7 @@ ipa_struct_reorg::rewrite_expr (tree expr,
newbase1 = build_fold_addr_expr (newbase1);
if (indirect)
{
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
/* Supports the MEM_REF offset.
_1 = MEM[(struct arc *)ap_1 + 72B].flow;
@@ -5719,8 +5690,7 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi)
{
bool remove = false;
- if (current_mode == STRUCT_REORDER_FIELDS
- && 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))
@@ -5756,10 +5726,10 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi)
return remove;
}
- if ((current_mode != STRUCT_REORDER_FIELDS
+ 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_REORDER_FIELDS
+ || (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
== tcc_comparison)))
{
@@ -5769,7 +5739,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_REORDER_FIELDS
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& rhs_code != EQ_EXPR && rhs_code != NE_EXPR)
code = rhs_code;
@@ -5818,8 +5788,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_REORDER_FIELDS
- || (current_mode == STRUCT_REORDER_FIELDS && (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);
for (unsigned i = 0; i < max_split && newlhs[i]; i++)
{
@@ -5843,7 +5814,7 @@ ipa_struct_reorg::rewrite_assign (gassign *stmt, gimple_stmt_iterator *gsi)
}
/* Support POINTER_DIFF_EXPR rewriting. */
- if (current_mode == STRUCT_REORDER_FIELDS
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& gimple_assign_rhs_code (stmt) == POINTER_DIFF_EXPR)
{
tree rhs1 = gimple_assign_rhs1 (stmt);
@@ -6026,7 +5997,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_REORDER_FIELDS && 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];
@@ -6152,9 +6124,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_REORDER_FIELDS
+ if ((current_layout_opt_level < STRUCT_REORDER_FIELDS
&& (rhs_code != EQ_EXPR && rhs_code != NE_EXPR))
- || (current_mode == STRUCT_REORDER_FIELDS
+ || (current_layout_opt_level >= STRUCT_REORDER_FIELDS
&& TREE_CODE_CLASS (rhs_code) != tcc_comparison))
return false;
tree lhs = gimple_cond_lhs (stmt);
@@ -6208,7 +6180,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_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
/* Delete debug gimple now. */
return true;
bool remove = false;
@@ -6367,7 +6339,7 @@ ipa_struct_reorg::rewrite_functions (void)
then don't rewrite any accesses. */
if (!create_new_types ())
{
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
for (unsigned i = 0; i < functions.length (); i++)
{
@@ -6386,7 +6358,7 @@ ipa_struct_reorg::rewrite_functions (void)
return 0;
}
- if (current_mode == STRUCT_REORDER_FIELDS && dump_file)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS && dump_file)
{
fprintf (dump_file, "=========== all created newtypes: ===========\n\n");
dump_newtypes (dump_file);
@@ -6396,13 +6368,13 @@ ipa_struct_reorg::rewrite_functions (void)
{
retval = TODO_remove_functions;
create_new_functions ();
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
prune_escaped_types ();
}
}
- if (current_mode == STRUCT_REORDER_FIELDS)
+ if (current_layout_opt_level >= STRUCT_REORDER_FIELDS)
{
for (unsigned i = 0; i < functions.length (); i++)
{
@@ -6559,33 +6531,33 @@ 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 (dump_file)
fprintf (dump_file, "\n\n====== ipa_struct_reorg level %d ======\n\n",
- mode);
+ opt);
- if (mode == NORMAL || mode == STRUCT_REORDER_FIELDS)
+ 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 ())
return 0;
record_accesses ();
prune_escaped_types ();
- if (current_mode == NORMAL)
+ if (current_layout_opt_level == STRUCT_SPLIT)
analyze_types ();
ret = rewrite_functions ();
}
- else if (mode == COMPLETE_STRUCT_RELAYOUT)
+ else
{
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;
record_accesses ();
@@ -6622,10 +6594,37 @@ public:
virtual unsigned int execute (function *)
{
unsigned int ret = 0;
- ret = ipa_struct_reorg ().execute (NORMAL);
- if (!ret)
- ret = ipa_struct_reorg ().execute (COMPLETE_STRUCT_RELAYOUT);
- return ret;
+ unsigned int ret_reorg = 0;
+ unsigned int level = 0;
+ switch (struct_layout_optimize_level)
+ {
+ 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 ();
+ }
+ /* 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);
+
+ if (level >= STRUCT_REORDER_FIELDS)
+ ret = ipa_struct_reorg ().execute (level);
+
+ 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);
+ }
+ return ret | ret_reorg;
}
}; // class pass_ipa_struct_reorg
@@ -6645,52 +6644,6 @@ pass_ipa_struct_reorg::gate (function *)
&& (in_lto_p || flag_whole_program));
}
-const pass_data pass_data_ipa_reorder_fields =
-{
- SIMPLE_IPA_PASS, // type
- "reorder_fields", // name
- OPTGROUP_NONE, // optinfo_flags
- TV_IPA_REORDER_FIELDS, // tv_id
- 0, // properties_required
- 0, // properties_provided
- 0, // properties_destroyed
- 0, // todo_flags_start
- 0, // todo_flags_finish
-};
-
-class pass_ipa_reorder_fields : public simple_ipa_opt_pass
-{
-public:
- pass_ipa_reorder_fields (gcc::context *ctxt)
- : simple_ipa_opt_pass (pass_data_ipa_reorder_fields, ctxt)
- {}
-
- /* opt_pass methods: */
- virtual bool gate (function *);
- virtual unsigned int execute (function *)
- {
- unsigned int ret = 0;
- ret = ipa_struct_reorg ().execute (STRUCT_REORDER_FIELDS);
- return ret;
- }
-
-}; // class pass_ipa_reorder_fields
-
-bool
-pass_ipa_reorder_fields::gate (function *)
-{
- return (optimize >= 3
- && flag_ipa_reorder_fields
- /* 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));
-}
-
} // anon namespace
@@ -6699,9 +6652,3 @@ make_pass_ipa_struct_reorg (gcc::context *ctxt)
{
return new pass_ipa_struct_reorg (ctxt);
}
-
-simple_ipa_opt_pass *
-make_pass_ipa_reorder_fields (gcc::context *ctxt)
-{
- return new pass_ipa_reorder_fields (ctxt);
-}
diff --git a/gcc/passes.def b/gcc/passes.def
index bdc835b87..9692066e4 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -178,7 +178,6 @@ along with GCC; see the file COPYING3. If not see
compiled unit. */
INSERT_PASSES_AFTER (all_late_ipa_passes)
NEXT_PASS (pass_ipa_pta);
- NEXT_PASS (pass_ipa_reorder_fields);
/* FIXME: this should be 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 6fa529eee..3fe64047c 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -105,7 +105,7 @@ protected:
{
/* In structure optimizatons, we call new to ensure that
the allocated memory is initialized to 0. */
- if (flag_ipa_struct_reorg || flag_ipa_reorder_fields)
+ if (flag_ipa_struct_reorg)
return is_ggc () ? new (ggc_internal_alloc (sizeof (T))) T ()
: new T ();
@@ -122,7 +122,7 @@ protected:
ggc_delete (item);
else
{
- if (flag_ipa_struct_reorg || flag_ipa_reorder_fields)
+ 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 0c9e384c4..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 "reorder_fields" } } */
+/* { 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 717fcc386..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 "reorder_fields" } } */
+/* { 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 7723c240b..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 "reorder_fields" } } */
+/* { 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 a1feac966..f9e2cf471 100644
--- a/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c
+++ b/gcc/testsuite/gcc.dg/struct/dfe_extr_claw.c
@@ -81,4 +81,4 @@ claw_snd_conn_req (struct net_device *dev, __u8 link)
return rc;
}
-/* { dg-final { scan-ipa-dump-times "Dead field elimination" 1 "reorder_fields" } } */
+/* { 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 fd1e936ca..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 "reorder_fields" } } */
+/* { 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 b13d785a9..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 "reorder_fields" } } */
+/* { 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 bc28a658a..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 "reorder_fields" } } */
+/* { 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 0a585ac3d..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 "reorder_fields" } } */
+/* { 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 bddd862fe..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 "reorder_fields" } } */
+/* { 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 1a06f5eec..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 "reorder_fields" } } */
+/* { 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 94eb88d5c..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 "reorder_fields" } } */
+/* { 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 bbf9420d0..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 "reorder_fields" } } */
+/* { 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 f706db968..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 "reorder_fields" } } */
+/* { 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 963295cb4..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 "reorder_fields" } } */
+/* { 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 aa10506a1..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 "reorder_fields" } } */
+/* { 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 b95be2dab..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." "reorder_fields" } } */
\ 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 3d243313b..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" "reorder_fields" } } */
\ 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 faaf1e3a5..b876fef86 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 "Number of structures to transform is 1" "reorder_fields" } } */
\ 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_create_fields_bug.c b/gcc/testsuite/gcc.dg/struct/rf_create_fields_bug.c
index 886706ae9..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" "reorder_fields" } } */
\ 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 f3785f392..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" "reorder_fields" } } */
\ 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 1415d759a..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" "reorder_fields" } } */
\ 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 003da0b57..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" "reorder_fields" } } */
\ 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_external_func_types.c b/gcc/testsuite/gcc.dg/struct/rf_external_func_types.c
index 84a34f241..2a9bea783 100644
--- a/gcc/testsuite/gcc.dg/struct/rf_external_func_types.c
+++ b/gcc/testsuite/gcc.dg/struct/rf_external_func_types.c
@@ -66,4 +66,4 @@ test ()
return 0;
}
-/* { dg-final { scan-ipa-dump "No structures to transform." "reorder_fields" } } */
\ 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_int_cast_ptr.c b/gcc/testsuite/gcc.dg/struct/rf_int_cast_ptr.c
index 10dcf098c..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" "reorder_fields" } } */
\ 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 8d1a9a114..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" "reorder_fields" } } */
\ 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 23765fc56..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" "reorder_fields" } } */
\ 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 54e737ee8..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" "reorder_fields" } } */
\ 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 2ae46fb31..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." "reorder_fields" } } */
\ 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 3a3c10b70..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" "reorder_fields" } } */
\ 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 7b7d110df..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" "reorder_fields" } } */
\ 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 317aafa5f..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." "reorder_fields" } } */
\ 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 01a33f669..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" "reorder_fields" } } */
\ 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 a38556533..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" "reorder_fields" } } */
\ 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 5c17ee528..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" "reorder_fields" } } */
\ 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 710517ee9..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" "reorder_fields" } } */
\ 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 6ed0a5d2d..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" "reorder_fields" } } */
\ 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 5a2dd964f..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" "reorder_fields" } } */
\ 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 faa90b42d..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" "reorder_fields" } } */
\ 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 8f2da99cc..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" "reorder_fields" } } */
\ 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 723142c59..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" "reorder_fields" } } */
\ 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/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp
index 6ccb753b5..278c4e4f5 100644
--- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp
+++ b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp
@@ -45,7 +45,7 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/rf_*.c]] \
# -fipa-struct-reorg=3
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/dfe*.c]] \
- "" "-fipa-reorder-fields -fipa-struct-reorg=3 -fdump-ipa-all -flto-partition=one -fwhole-program"
+ "" "-fipa-struct-reorg=3 -fdump-ipa-all -flto-partition=one -fwhole-program"
# All done.
torture-finish
diff --git a/gcc/timevar.def b/gcc/timevar.def
index 2b27c858a..98a5a490f 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_REORDER_FIELDS , "ipa struct reorder fields optimization")
DEFTIMEVAR (TV_IPA_STRUCT_REORG , "ipa struct reorg optimization")
DEFTIMEVAR (TV_IPA_OPT , "ipa various optimizations")
DEFTIMEVAR (TV_IPA_LTO_DECOMPRESS , "lto stream decompression")
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index a9ec8ed21..56898e019 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -527,7 +527,6 @@ extern ipa_opt_pass_d *make_pass_ipa_devirt (gcc::context *ctxt);
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_pure_const (gcc::context *ctxt);
-extern simple_ipa_opt_pass *make_pass_ipa_reorder_fields (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_struct_reorg (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_pta (gcc::context *ctxt);
extern simple_ipa_opt_pass *make_pass_ipa_tm (gcc::context *ctxt);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc
master

搜索帮助