From 987a8a810ecaaf065dac29b635dcd1d09e61b4dd Mon Sep 17 00:00:00 2001 From: Erick Ochoa Date: Tue, 10 Mar 2020 13:23:37 +0100 Subject: Fixes test --- gcc/Makefile.in | 1 + gcc/common.opt | 6 +++++- gcc/ipa-type-escape-analysis.c | 2 +- gcc/passes.def | 1 + gcc/testsuite/gcc.dg/ipa/ipa-ea-00-collect-global-record-0.c | 4 ++-- .../ipa/ipa-ea-01-collect-global-pointers-to-record-0.c | 6 +++--- .../gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c | 6 +++--- gcc/testsuite/gcc.dg/ipa/ipa-ea-03-collect-nested-record-0.c | 8 ++++---- gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c | 8 ++++---- gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c | 10 +++++----- gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c | 10 +++++----- gcc/testsuite/gcc.dg/ipa/ipa-ea-08-parameter-escapes-0.c | 2 +- .../gcc.dg/ipa/ipa-ea-09-parameter-type-escapes-0.c | 8 ++++---- gcc/testsuite/gcc.dg/ipa/ipa-ea-10-return-type-escapes-0.c | 8 ++++---- gcc/testsuite/gcc.dg/ipa/ipa-ea-11-cast-to-void-ptr-0.c | 10 +++++----- gcc/testsuite/gcc.dg/ipa/ipa-ea-12-cast-to-void-ptr-0.c | 12 ++++++------ gcc/tree-pass.h | 1 + 17 files changed, 55 insertions(+), 48 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b7908bda57e..f1f1cfd9a75 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1400,6 +1400,7 @@ OBJS = \ init-regs.o \ internal-fn.o \ ipa-type-escape-analysis.o \ + ipa-hello-world.o \ ipa-cp.o \ ipa-sra.o \ ipa-devirt.o \ diff --git a/gcc/common.opt b/gcc/common.opt index 5d4f458e0c7..31a1a05cad0 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3432,8 +3432,12 @@ fipa-typelist-field= Common Joined Report Var(flag_ipa_typelist_field) Init(0) -fipa-typelist-field= Name of struct of interest -fipa-hello-world +fipa-type-escape-analysis Common Report Var(flag_ipa_type_escape_analysis) Optimization +Type escape analysis + +fipa-hello-world +Common Report Var(flag_ipa_hello_world) Optimization Hello world ; This comment is to ensure we retain the blank line above. diff --git a/gcc/ipa-type-escape-analysis.c b/gcc/ipa-type-escape-analysis.c index 2987c32bbf8..a838f4d445f 100644 --- a/gcc/ipa-type-escape-analysis.c +++ b/gcc/ipa-type-escape-analysis.c @@ -864,7 +864,7 @@ namespace { const pass_data pass_data_ipa_type_escape_analysis = { SIMPLE_IPA_PASS, - "hello-world", + "type-escape-analysis", OPTGROUP_NONE, TV_NONE, (PROP_cfg | PROP_ssa), diff --git a/gcc/passes.def b/gcc/passes.def index e8e3c4a2e5d..8a54178a7e0 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -150,6 +150,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_ipa_icf); NEXT_PASS (pass_ipa_devirt); NEXT_PASS (pass_ipa_type_escape_analysis); + NEXT_PASS (pass_ipa_hello_world); NEXT_PASS (pass_ipa_cp); NEXT_PASS (pass_ipa_sra); NEXT_PASS (pass_ipa_cdtor_merge); diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-00-collect-global-record-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-00-collect-global-record-0.c index 494abdf7c11..f9c4af5d6cf 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-00-collect-global-record-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-00-collect-global-record-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ struct astruct_s { _Bool a; _Bool b; _Bool c;}; struct astruct_s astruct; @@ -10,4 +10,4 @@ main () astruct.a = 0; } -/* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-01-collect-global-pointers-to-record-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-01-collect-global-pointers-to-record-0.c index c592bdd0be2..e1147844f18 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-01-collect-global-pointers-to-record-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-01-collect-global-pointers-to-record-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -12,5 +12,5 @@ main () astruct = NULL; } -/* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s*" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s*" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c index 99e9c497d9a..aed61d4ef69 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-02-collect-global-array-to-record-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -12,5 +12,5 @@ main () struct astruct_s another = astruct[0]; } -/* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-03-collect-nested-record-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-03-collect-nested-record-0.c index 588e58e4976..e300b0b598a 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-03-collect-nested-record-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-03-collect-nested-record-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -15,6 +15,6 @@ main () struct astruct_s another = astruct[0]; } -/* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,outer_struct" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,outer_struct" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c index 8afef5a7774..7b40c7701bf 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-04-collect-parameters-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -15,6 +15,6 @@ main () { } -/* { dg-final { scan-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s*" "hello-world" } } */ -/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "hello-world" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s*" "type-escape-analysis" } } */ +/* { dg-final { scan-ipa-dump "collected,astruct_s[]" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c index cc1c46fc0eb..32a77195322 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-05-global-escapes-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ /* { dg-require-effective-target lto } */ @@ -17,7 +17,7 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "variable bstruct is escaping false" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "variable astruct is escaping true" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "variable bstruct is escaping false" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "variable astruct is escaping true" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c index 4debd92e061..2e7024ab907 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-06-global-type-escapes-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -15,7 +15,7 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type astruct_s is escaping true" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type astruct_s is escaping true" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-08-parameter-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-08-parameter-escapes-0.c index 168a125d99b..d1842987735 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-08-parameter-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-08-parameter-escapes-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ /* { dg-require-effective-target lto } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-09-parameter-type-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-09-parameter-type-escapes-0.c index e32939d913b..79809249942 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-09-parameter-type-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-09-parameter-type-escapes-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -19,6 +19,6 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-10-return-type-escapes-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-10-return-type-escapes-0.c index 7fa035122a7..f2c5f307f01 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-10-return-type-escapes-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-10-return-type-escapes-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -19,6 +19,6 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-11-cast-to-void-ptr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-11-cast-to-void-ptr-0.c index 2bd1b62e284..5ef153eb5f9 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-11-cast-to-void-ptr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-11-cast-to-void-ptr-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -20,7 +20,7 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type astruct_s\\\* is escaping true" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type astruct_s\\\* is escaping true" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "type-escape-analysis" } } */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-ea-12-cast-to-void-ptr-0.c b/gcc/testsuite/gcc.dg/ipa/ipa-ea-12-cast-to-void-ptr-0.c index 7218e5d54e4..1f298b1415b 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-ea-12-cast-to-void-ptr-0.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-ea-12-cast-to-void-ptr-0.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-flto -fipa-hello-world -fdump-ipa-hello-world" } */ +/* { dg-options "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis" } */ #include @@ -20,8 +20,8 @@ int main() } -/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type astruct_s\\\* is escaping true" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type astruct_s is escaping true" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "hello-world" } } */ -/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "hello-world" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,astruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type astruct_s\\\* is escaping true" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type astruct_s is escaping true" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "collected,bstruct_s" "type-escape-analysis" } } */ +/* { dg-final { scan-wpa-ipa-dump "type bstruct_s is escaping false" "type-escape-analysis" } } */ diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index d83fd4c6d4c..0c14a827a2e 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -502,6 +502,7 @@ extern ipa_opt_pass_d *make_pass_ipa_inline (gcc::context *ctxt); extern simple_ipa_opt_pass *make_pass_ipa_free_lang_data (gcc::context *ctxt); extern simple_ipa_opt_pass *make_pass_ipa_free_fn_summary (gcc::context *ctxt); extern simple_ipa_opt_pass *make_pass_ipa_type_escape_analysis (gcc::context *ctxt); +extern simple_ipa_opt_pass *make_pass_ipa_hello_world (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_cp (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_sra (gcc::context *ctxt); extern ipa_opt_pass_d *make_pass_ipa_icf (gcc::context *ctxt); -- cgit v1.2.3