From: Tom de Vries <Tom_deVries@mentor.com>
To: "gcc-patches@gnu.org" <gcc-patches@gnu.org>
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: [gomp4, committed, 4/9] Revert "Add pass_dominator::sese_mode_p ()"
Date: Thu, 05 Nov 2015 10:50:00 -0000 [thread overview]
Message-ID: <563B3468.1080007@mentor.com> (raw)
In-Reply-To: <563B2C99.90308@mentor.com>
[-- Attachment #1: Type: text/plain, Size: 1655 bytes --]
On 05/11/15 11:16, Tom de Vries wrote:
> Hi,
>
> now that we have committed -foffload-alias in gomp-4_0-branch (
> https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00214.html ), we no longer
> need the kernels region to be a part of the original function when doing
> alias analysis.
>
> So, we no longer have the need to postpone splitting off the kernels
> region into a seperate function until after alias analysis, but we can
> do this at the same time as when we expand the parallel region.
>
> The following patch series implements that:
>
> 1 Move expansion of kernels region back to first omp-expand
> 2 Update gate_oacc_kernels to handle oacc function
> 3 Revert "Add skip_stmt parm to pass_dominator::get_sese ()"
> 4 Revert "Add pass_dominator::sese_mode_p ()"
> 5 Handle oacc function in parloops
> 6 Update goacc kernels C testcases
> 7 Update goacc kernels Fortran testcases
> 8 Release_defs in expand_omp_atomic_fetch_op
> 9 Remove BUILT_IN_GOACC_KERNELS_INTERNAL
>
> [ The patch series is broken up into logical bits, but intended as
> single commit. Various things in kernels support will be broken in
> intermediate stages. ]
>
> Committed to gomp-4_0-branch.
>
> I'll post the patches in reply to this message.
We needed the sese_mode_p functionality in the dominators pass to limit
optimization scope to kernels regions. Now we no longer encounter
kernels region in the kernels pass group, but split-off function that
used to be kernels region. So we no longer need this functionality.
This patch reverts the sese_mode_p functionality.
Thanks,
- Tom
[-- Attachment #2: 0004-Revert-Add-pass_dominator-sese_mode_p.patch --]
[-- Type: text/x-patch, Size: 4566 bytes --]
Revert "Add pass_dominator::sese_mode_p ()"
2015-11-04 Tom de Vries <tom@codesourcery.com>
revert:
2015-10-12 Tom de Vries <tom@codesourcery.com>
* tree-ssa-dom.c (pass_dominator::jump_threading_p): Handle sese_mode_p.
(pass_dominator::sese_mode_p, pass_dominator::get_sese): New protected
virtual function.
(pass_dominator::execute): Handle sese_mode_p.
---
gcc/tree-ssa-dom.c | 78 ++++++------------------------------------------------
1 file changed, 8 insertions(+), 70 deletions(-)
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index e1cf38b..44253bf 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -44,7 +44,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-dom.h"
#include "gimplify.h"
#include "tree-cfgcleanup.h"
-#include "cfgcleanup.h"
#include "omp-low.h"
/* This file implements optimizations on the dominator tree. */
@@ -535,17 +534,7 @@ class dominator_base : public gimple_opt_pass
unsigned int execute (function *);
/* Return true if pass should perform jump threading. */
- virtual bool jump_threading_p (void) { return !sese_mode_p (); }
-
- /* Return true if pass should visit a series of seses rather than the whole
- dominator tree. */
- virtual bool sese_mode_p (void) { return false; }
-
- /* In sese mode, return true if there's another sese to visit. Return the
- sese to visit in SESE_ENTRY and SESE_EXIT. */
- virtual bool get_sese (basic_block *sese_entry ATTRIBUTE_UNUSED,
- basic_block *sese_exit ATTRIBUTE_UNUSED)
- { gcc_unreachable (); }
+ virtual bool jump_threading_p (void) { return true; }
}; // class dominator_base
const pass_data pass_data_dominator =
@@ -602,14 +591,11 @@ dominator_base::execute (function *fun)
LOOPS_HAVE_PREHEADERS won't be needed here. */
loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES);
- if (!sese_mode_p ())
- /* Initialize the value-handle array. */
- threadedge_initialize_values ();
+ /* Initialize the value-handle array. */
+ threadedge_initialize_values ();
if (jump_threading_p ())
{
- gcc_assert (!sese_mode_p ());
-
/* We need accurate information regarding back edges in the CFG
for jump threading; this may include back edges that are not part of
a single loop. */
@@ -631,29 +617,7 @@ dominator_base::execute (function *fun)
const_and_copies,
avail_exprs_stack,
jump_threading_p ());
- if (!sese_mode_p ())
- walker.walk (fun->cfg->x_entry_block_ptr);
- else
- {
- basic_block sese_entry, sese_exit;
- while (get_sese (&sese_entry, &sese_exit))
- {
- threadedge_initialize_values ();
- avail_exprs_stack->push_marker ();
- const_and_copies->push_marker ();
-
- walker.walk_until (sese_entry, sese_exit, true);
-
- avail_exprs_stack->pop_to_marker ();
- const_and_copies->pop_to_marker ();
- threadedge_finalize_values ();
-
- /* KLUDGE: The dom_walker does not allow unreachable blocks when
- starting the walk, and during the dom_opt_dom_walker walk we may
- produce unreachable blocks, so we need to clean them up here. */
- delete_unreachable_blocks ();
- }
- }
+ walker.walk (fun->cfg->x_entry_block_ptr);
{
gimple_stmt_iterator gsi;
@@ -753,9 +717,8 @@ dominator_base::execute (function *fun)
delete avail_exprs_stack;
delete const_and_copies;
- if (!sese_mode_p ())
- /* Free the value-handle array. */
- threadedge_finalize_values ();
+ /* Free the value-handle array. */
+ threadedge_finalize_values ();
return 0;
}
@@ -789,33 +752,8 @@ public:
protected:
/* dominator_base methods: */
- virtual bool sese_mode_p (void) { return true; }
- virtual bool get_sese (basic_block *sese_entry, basic_block *sese_exit)
- {
- if (m_regions == NULL)
- {
- m_regions = BITMAP_ALLOC (NULL);
- basic_block bb;
- FOR_EACH_BB_FN (bb, cfun)
- if (oacc_kernels_region_entry_p (bb, NULL))
- bitmap_set_bit (m_regions, bb->index);
- }
-
- if (bitmap_empty_p (m_regions))
- {
- BITMAP_FREE (m_regions);
- return false;
- }
-
- unsigned int index = bitmap_first_set_bit (m_regions);
- bitmap_clear_bit (m_regions, index);
-
- *sese_entry = BASIC_BLOCK_FOR_FN (cfun, index);
- *sese_exit = get_oacc_kernels_region_exit (*sese_entry);
-
- return true;
- }
-
+ /* Return true if pass should perform jump threading. */
+ virtual bool jump_threading_p (void) { return false; }
}; // class pass_dominator_oacc_kernels
} // anon namespace
--
1.9.1
next prev parent reply other threads:[~2015-11-05 10:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 10:17 [gomp4, committed] expand oacc kernels region at same time as oacc parallel region Tom de Vries
2015-11-05 10:33 ` [gomp4, committed, 1/9] Move expansion of kernels region back to first omp-expand Tom de Vries
2015-11-05 10:40 ` [gomp4, committed, 2/9] Update gate_oacc_kernels to handle oacc function Tom de Vries
2015-11-05 10:46 ` [gomp4, committed, 3/9] Revert "Add skip_stmt parm to pass_dominator::get_sese ()" Tom de Vries
2015-11-05 10:50 ` Tom de Vries [this message]
2015-11-05 10:57 ` [gomp4, committed, 5/9] Handle oacc function in parloops Tom de Vries
2015-11-05 10:59 ` [gomp4, committed, 6/9] Update goacc kernels C testcases Tom de Vries
2015-11-05 11:01 ` [gomp4, committed, 7/9] Update goacc kernels Fortran testcases Tom de Vries
2015-11-05 11:26 ` [gomp4, committed, 8/9] Release_defs in expand_omp_atomic_fetch_op Tom de Vries
2015-11-05 11:30 ` [gomp4, committed, 9/9] Remove BUILT_IN_GOACC_KERNELS_INTERNAL Tom de Vries
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=563B3468.1080007@mentor.com \
--to=tom_devries@mentor.com \
--cc=gcc-patches@gnu.org \
--cc=jakub@redhat.com \
/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).