public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jiu Fu Guo <guojiufu@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ibm/heads/perf)] tree-optimization/93964 - adjust ISL code generation for pointer params Date: Thu, 19 Mar 2020 06:05:57 +0000 (GMT) [thread overview] Message-ID: <20200319060557.7DEE539524A2@sourceware.org> (raw) https://gcc.gnu.org/g:dca54007ebb5d49c3d6cea63ee87fd8f3ccb9ca5 commit dca54007ebb5d49c3d6cea63ee87fd8f3ccb9ca5 Author: Richard Biener <rguenther@suse.de> Date: Wed Mar 4 10:40:32 2020 +0100 tree-optimization/93964 - adjust ISL code generation for pointer params Pointers eventually need intermediate conversions in code generation. Allowing them is much easier than fending them off since niter and scev expansion easily drag those in. 2020-02-04 Richard Biener <rguenther@suse.de> PR tree-optimization/93964 * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id): Add intermediate conversion for pointer to integer converts. * graphite-scop-detection.c (assign_parameter_index_in_region): Relax assert. * gcc.dg/graphite/pr93964.c: New testcase. Diff: --- gcc/ChangeLog | 9 +++++++++ gcc/graphite-isl-ast-to-gimple.c | 3 +++ gcc/graphite-scop-detection.c | 1 - gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/graphite/pr93964.c | 19 +++++++++++++++++++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a08bdaf8ecd..82b66089c8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-02-04 Richard Biener <rguenther@suse.de> + + PR tree-optimization/93964 + * graphite-isl-ast-to-gimple.c + (gcc_expression_from_isl_ast_expr_id): Add intermediate + conversion for pointer to integer converts. + * graphite-scop-detection.c (assign_parameter_index_in_region): + Relax assert. + 2020-03-04 Martin Liska <mliska@suse.cz> PR c/93886 diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index c08a259a80e..ef93fda2233 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -265,6 +265,9 @@ gcc_expression_from_isl_ast_expr_id (tree type, tree t = res->second; if (useless_type_conversion_p (type, TREE_TYPE (t))) return t; + if (POINTER_TYPE_P (TREE_TYPE (t)) + && !POINTER_TYPE_P (type) && !ptrofftype_p (type)) + t = fold_convert (sizetype, t); return fold_convert (type, t); } diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index ed12fea801b..75f81227f8a 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1102,7 +1102,6 @@ static void assign_parameter_index_in_region (tree name, sese_info_p region) { gcc_assert (TREE_CODE (name) == SSA_NAME - && INTEGRAL_TYPE_P (TREE_TYPE (name)) && ! defined_in_sese_p (name, region->region)); int i; tree p; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a13a0a4ba59..cbf17163195 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-02-04 Richard Biener <rguenther@suse.de> + + PR tree-optimization/93964 + * gcc.dg/graphite/pr93964.c: New testcase. + 2020-03-04 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/94001 diff --git a/gcc/testsuite/gcc.dg/graphite/pr93964.c b/gcc/testsuite/gcc.dg/graphite/pr93964.c new file mode 100644 index 00000000000..80fc523b855 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr93964.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-nest-optimize" } */ + +int * +eo (void); + +void +g4 (int *nt) +{ + int dh, t2 = (__INTPTR_TYPE__)eo (); + + for (dh = 0; dh < 2; ++dh) + { + int m7; + + for (m7 = 0; m7 < t2; ++m7) + nt[m7] = 0; + } +}
reply other threads:[~2020-03-19 6:05 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200319060557.7DEE539524A2@sourceware.org \ --to=guojiufu@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).