This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] openmp and misc API changes


>> +/* Lower the OpenMP sections directive in the current statement.  */
>
> Need documentation for GSI_P and CTX (the latter is not your bug).

Fixed.

>> +	gimple_omp_parallel_set_combined_p (stmt);
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Hm, should we change this to receive a bool flag so we can clear the 
> combined flag?  I don't think we ever clear the combined flag if we decide 
> to set it, so it may not be important.
Fixed.

>> +	debug_gimple_stmt (stmt);
>> +	exit(1);
>
> ???
Whoops, fixed.

Committing to branch.

	* omp-low.c (lower_omp_parallel): Add new argument to
	gimple_omp_parallel_set_combined_p.
	(lower_omp_1): Remove debugging code.
	* gimple.h (gimple_omp_parallel_combined_p): Add new argument.

Index: omp-low.c
===================================================================
--- omp-low.c	(revision 134557)
+++ omp-low.c	(working copy)
@@ -4339,7 +4339,8 @@ struct gimple_opt_pass pass_expand_omp =
 
 /* Routines to lower OpenMP directives into OMP-GIMPLE.  */
 
-/* Lower the OpenMP sections directive in the current statement.  */
+/* Lower the OpenMP sections directive in the current statement in GSI_P.
+   CTX is the enclosing OMP context for the current statement.  */
 
 static void
 lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
@@ -4924,7 +4925,7 @@ lower_omp_parallel (gimple_stmt_iterator
       wi.val_only = true;
       walk_gimple_seq (par_body, check_combined_parallel, NULL, &wi);
       if (ws_num == 1)
-	gimple_omp_parallel_set_combined_p (stmt);
+	gimple_omp_parallel_set_combined_p (stmt, true);
     }
 
   push_gimplify_context ();
@@ -5044,10 +5045,6 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p
       break;
     case GIMPLE_OMP_PARALLEL:
       ctx = maybe_lookup_ctx (stmt);
-      {
-	debug_gimple_stmt (stmt);
-	exit(1);
-      }
       lower_omp_parallel (gsi_p, ctx);
       break;
     case GIMPLE_OMP_FOR:
Index: gimple.h
===================================================================
--- gimple.h	(revision 134557)
+++ gimple.h	(working copy)
@@ -1130,13 +1130,17 @@ gimple_omp_parallel_combined_p (const_gi
 }
 
 
-/* Set the GF_OMP_PARALLEL_COMBINED field in G.  */
+/* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
+   value of COMBINED_P.  */
 
 static inline void
-gimple_omp_parallel_set_combined_p (gimple g)
+gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
 {
   GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
-  g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
+  if (combined_p)
+    g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
+  else
+    g->gsbase.subcode &= ~GF_OMP_PARALLEL_COMBINED;
 }
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]