public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Frederik Harwath <frederik@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/omp/gcc-11] openacc: Disable pass_pre on outlined functions analyzed by Graphite
Date: Wed, 17 Nov 2021 08:18:41 +0000 (GMT)	[thread overview]
Message-ID: <20211117081841.588113857C65@sourceware.org> (raw)

https://gcc.gnu.org/g:50d4be1d4dfefa739bdd06567700281afcb4f068

commit 50d4be1d4dfefa739bdd06567700281afcb4f068
Author: Frederik Harwath <frederik@codesourcery.com>
Date:   Tue Nov 16 16:20:56 2021 +0100

    openacc: Disable pass_pre on outlined functions analyzed by Graphite
    
    The additional dependences introduced by partial redundancy
    elimination proper and by the code hoisting step of the pass very
    often cause Graphite to fail on OpenACC functions. On the other hand,
    the pass can also enable the analysis of OpenACC loops (cf. e.g. the
    loop-auto-transfer-4.f90 testcase), for instance, because full
    redundancy elimination removes definitions that would otherwise
    prevent the creation of runtime alias checks outside of the SCoP.
    
    This commit disables the actual partial redundancy elimination step as
    well as the code hoisting step of pass_pre on OpenACC functions that
    might be handled by Graphite.
    
    gcc/ChangeLog:
    
            * tree-ssa-pre.c (insert): Skip any insertions in OpenACC
            functions that might be processed by Graphite.

Diff:
---
 gcc/tree-ssa-pre.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 2aedc31e1d7..b904354e4c7 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-dce.h"
 #include "tree-cfgcleanup.h"
 #include "alias.h"
+#include "graphite-oacc.h"
 
 /* Even though this file is called tree-ssa-pre.c, we actually
    implement a bit more than just PRE here.  All of them piggy-back
@@ -3736,6 +3737,22 @@ do_hoist_insertion (basic_block block)
 static void
 insert (void)
 {
+
+    /* The additional dependences introduced by the code insertions
+     can cause Graphite's dependence analysis to fail .  Without
+     special handling of those dependences in Graphite, it seems
+     better to skip this step if OpenACC loops that need to be handled
+     by Graphite are found.  Note that the full redundancy elimination
+     step of this pass is useful for the purpose of dependence
+     analysis, for instance, because it can remove definitions from
+     SCoPs that would otherwise prevent the creation of runtime alias
+     checks since those may only use definitions that are available
+     before the SCoP. */
+
+  if (oacc_function_p (cfun)
+      && ::graphite_analyze_oacc_function_p (cfun))
+    return;
+
   basic_block bb;
 
   FOR_ALL_BB_FN (bb, cfun)


                 reply	other threads:[~2021-11-17  8:18 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=20211117081841.588113857C65@sourceware.org \
    --to=frederik@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: link
Be 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).