public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/106498 - reduce SSA updates in autopar
@ 2022-08-02  6:40 Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2022-08-02  6:40 UTC (permalink / raw)
  To: gcc-patches

The following reduces the number of SSA updates done during autopar
OMP expansion, specifically avoiding the cases that just add virtual
operands (where maybe none have been before) in dead regions of the CFG.

Instead virtual SSA update is delayed until after the pass.  There's
much more TLC needed here, but test coverage makes it really difficult.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR tree-optimization/106498
	* omp-expand.cc (expand_omp_taskreg): Do not perform virtual
	SSA update here.
	(expand_omp_for): Or here.
	(execute_expand_omp): Instead schedule it here together
	with CFG cleanup via TODO.
---
 gcc/omp-expand.cc | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc
index 936adff7f45..64e6308fc7b 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -1530,8 +1530,6 @@ expand_omp_taskreg (struct omp_region *region)
     expand_teams_call (new_bb, as_a <gomp_teams *> (entry_stmt));
   else
     expand_task_call (region, new_bb, as_a <gomp_task *> (entry_stmt));
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Information about members of an OpenACC collapsed loop nest.  */
@@ -8191,9 +8189,6 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt)
 			      (enum built_in_function) next_ix, sched_arg,
 			      inner_stmt);
     }
-
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Expand code for an OpenMP sections directive.  In pseudo code, we generate
@@ -10591,13 +10586,10 @@ execute_expand_omp (void)
 
   expand_omp (root_omp_region);
 
-  if (flag_checking && !loops_state_satisfies_p (LOOPS_NEED_FIXUP))
-    verify_loop_structure ();
-  cleanup_tree_cfg ();
-
   omp_free_regions ();
 
-  return 0;
+  return (TODO_cleanup_cfg
+	  | (gimple_in_ssa_p (cfun) ? TODO_update_ssa_only_virtuals : 0));
 }
 
 /* OMP expansion -- the default pass, run before creation of SSA form.  */
-- 
2.35.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] tree-optimization/106498 - reduce SSA updates in autopar
@ 2022-08-02  6:40 Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2022-08-02  6:40 UTC (permalink / raw)
  To: gcc-patches

The following reduces the number of SSA updates done during autopar
OMP expansion, specifically avoiding the cases that just add virtual
operands (where maybe none have been before) in dead regions of the CFG.

Instead virtual SSA update is delayed until after the pass.  There's
much more TLC needed here, but test coverage makes it really difficult.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR tree-optimization/106498
	* omp-expand.cc (expand_omp_taskreg): Do not perform virtual
	SSA update here.
	(expand_omp_for): Or here.
	(execute_expand_omp): Instead schedule it here together
	with CFG cleanup via TODO.
---
 gcc/omp-expand.cc | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc
index 936adff7f45..64e6308fc7b 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -1530,8 +1530,6 @@ expand_omp_taskreg (struct omp_region *region)
     expand_teams_call (new_bb, as_a <gomp_teams *> (entry_stmt));
   else
     expand_task_call (region, new_bb, as_a <gomp_task *> (entry_stmt));
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Information about members of an OpenACC collapsed loop nest.  */
@@ -8191,9 +8189,6 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt)
 			      (enum built_in_function) next_ix, sched_arg,
 			      inner_stmt);
     }
-
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Expand code for an OpenMP sections directive.  In pseudo code, we generate
@@ -10591,13 +10586,10 @@ execute_expand_omp (void)
 
   expand_omp (root_omp_region);
 
-  if (flag_checking && !loops_state_satisfies_p (LOOPS_NEED_FIXUP))
-    verify_loop_structure ();
-  cleanup_tree_cfg ();
-
   omp_free_regions ();
 
-  return 0;
+  return (TODO_cleanup_cfg
+	  | (gimple_in_ssa_p (cfun) ? TODO_update_ssa_only_virtuals : 0));
 }
 
 /* OMP expansion -- the default pass, run before creation of SSA form.  */
-- 
2.35.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] tree-optimization/106498 - reduce SSA updates in autopar
@ 2022-08-02  6:40 Richard Biener
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2022-08-02  6:40 UTC (permalink / raw)
  To: gcc-patches

The following reduces the number of SSA updates done during autopar
OMP expansion, specifically avoiding the cases that just add virtual
operands (where maybe none have been before) in dead regions of the CFG.

Instead virtual SSA update is delayed until after the pass.  There's
much more TLC needed here, but test coverage makes it really difficult.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

	PR tree-optimization/106498
	* omp-expand.cc (expand_omp_taskreg): Do not perform virtual
	SSA update here.
	(expand_omp_for): Or here.
	(execute_expand_omp): Instead schedule it here together
	with CFG cleanup via TODO.
---
 gcc/omp-expand.cc | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc
index 936adff7f45..64e6308fc7b 100644
--- a/gcc/omp-expand.cc
+++ b/gcc/omp-expand.cc
@@ -1530,8 +1530,6 @@ expand_omp_taskreg (struct omp_region *region)
     expand_teams_call (new_bb, as_a <gomp_teams *> (entry_stmt));
   else
     expand_task_call (region, new_bb, as_a <gomp_task *> (entry_stmt));
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Information about members of an OpenACC collapsed loop nest.  */
@@ -8191,9 +8189,6 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt)
 			      (enum built_in_function) next_ix, sched_arg,
 			      inner_stmt);
     }
-
-  if (gimple_in_ssa_p (cfun))
-    update_ssa (TODO_update_ssa_only_virtuals);
 }
 
 /* Expand code for an OpenMP sections directive.  In pseudo code, we generate
@@ -10591,13 +10586,10 @@ execute_expand_omp (void)
 
   expand_omp (root_omp_region);
 
-  if (flag_checking && !loops_state_satisfies_p (LOOPS_NEED_FIXUP))
-    verify_loop_structure ();
-  cleanup_tree_cfg ();
-
   omp_free_regions ();
 
-  return 0;
+  return (TODO_cleanup_cfg
+	  | (gimple_in_ssa_p (cfun) ? TODO_update_ssa_only_virtuals : 0));
 }
 
 /* OMP expansion -- the default pass, run before creation of SSA form.  */
-- 
2.35.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-02  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-02  6:40 [PATCH] tree-optimization/106498 - reduce SSA updates in autopar Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2022-08-02  6:40 Richard Biener
2022-08-02  6:40 Richard Biener

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).