public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: David Malcolm <dmalcolm@redhat.com>
Subject: [gimple-classes, committed 39/92] Introduce gimple_omp_task
Date: Mon, 27 Oct 2014 20:36:00 -0000	[thread overview]
Message-ID: <1414442490-14841-40-git-send-email-dmalcolm@redhat.com> (raw)
In-Reply-To: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com>

This corresponds to:
  [PATCH 41/89] Introduce gimple_omp_task
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01160.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK with expected changes due to renaming/updates to const handling.
> Please repost the final patch for archival purposes.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00806.html

gcc/
	* coretypes.h (gimple_omp_task): New typedef.
	(const_gimple_omp_task): New typedef.

	* gimple.h (gimple_build_omp_task): Return a gimple_omp_task
	rather than a plain gimple.

	* gimple-pretty-print.c (dump_gimple_omp_task): Require a
	gimple_omp_task rather than a plain gimple.
	(pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
	GIMPLE_OMP_TASK case of switch statement.

	* gimple.c (gimple_build_omp_task): Return a gimple_omp_task
	rather than a plain gimple.

	* omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
	rather than a plain gimple.
	(delete_omp_context): Add checked cast to gimple_omp_task.
	(scan_omp_task): Strengthen local "stmt" from gimple to
	gimple_omp_task.
	(expand_task_call): Require a gimple_omp_task rather than a plain
	gimple.
	(expand_omp_taskreg): Add checked cast to gimple_omp_task.
	(create_task_copyfn): Require a gimple_omp_task rather than a
	plain gimple.
	(lower_omp_taskreg): Add checked cast to gimple_omp_task.
---
 gcc/ChangeLog.gimple-classes | 30 ++++++++++++++++++++++++++++++
 gcc/coretypes.h              |  4 ++++
 gcc/gimple-pretty-print.c    |  4 ++--
 gcc/gimple.c                 |  5 +++--
 gcc/gimple.h                 |  3 ++-
 gcc/omp-low.c                | 14 +++++++-------
 6 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index b030d20..5dfdc22 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,35 @@
 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
 
+	Introduce gimple_omp_task
+
+	* coretypes.h (gimple_omp_task): New typedef.
+	(const_gimple_omp_task): New typedef.
+
+	* gimple.h (gimple_build_omp_task): Return a gimple_omp_task
+	rather than a plain gimple.
+
+	* gimple-pretty-print.c (dump_gimple_omp_task): Require a
+	gimple_omp_task rather than a plain gimple.
+	(pp_gimple_stmt_1): Add checked cast to gimple_omp_task within
+	GIMPLE_OMP_TASK case of switch statement.
+
+	* gimple.c (gimple_build_omp_task): Return a gimple_omp_task
+	rather than a plain gimple.
+
+	* omp-low.c (finalize_task_copyfn): Require a gimple_omp_task
+	rather than a plain gimple.
+	(delete_omp_context): Add checked cast to gimple_omp_task.
+	(scan_omp_task): Strengthen local "stmt" from gimple to
+	gimple_omp_task.
+	(expand_task_call): Require a gimple_omp_task rather than a plain
+	gimple.
+	(expand_omp_taskreg): Add checked cast to gimple_omp_task.
+	(create_task_copyfn): Require a gimple_omp_task rather than a
+	plain gimple.
+	(lower_omp_taskreg): Add checked cast to gimple_omp_task.
+
+2014-10-24  David Malcolm  <dmalcolm@redhat.com>
+
 	tree-cfg.c: Make verify_gimple_call require a gimple_call
 
 	* tree-cfg.c (verify_gimple_call): Require a gimple_call rather
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 641658f..323e23c 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -192,6 +192,10 @@ struct gimple_statement_omp_parallel;
 typedef struct gimple_statement_omp_parallel *gimple_omp_parallel;
 typedef const struct gimple_statement_omp_parallel *const_gimple_omp_parallel;
 
+struct gimple_statement_omp_task;
+typedef struct gimple_statement_omp_task *gimple_omp_task;
+typedef const struct gimple_statement_omp_task *const_gimple_omp_task;
+
 union section;
 typedef union section section;
 struct gcc_options;
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index ea788c2..2cb6fc8 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -1911,7 +1911,7 @@ dump_gimple_omp_parallel (pretty_printer *buffer, gimple_omp_parallel gs,
    dumpfile.h).  */
 
 static void
-dump_gimple_omp_task (pretty_printer *buffer, gimple gs, int spc,
+dump_gimple_omp_task (pretty_printer *buffer, gimple_omp_task gs, int spc,
 		      int flags)
 {
   if (flags & TDF_RAW)
@@ -2142,7 +2142,7 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
       break;
 
     case GIMPLE_OMP_TASK:
-      dump_gimple_omp_task (buffer, gs, spc, flags);
+      dump_gimple_omp_task (buffer, as_a <gimple_omp_task> (gs), spc, flags);
       break;
 
     case GIMPLE_OMP_ATOMIC_LOAD:
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 26bd509..9510014 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -890,12 +890,13 @@ gimple_build_omp_parallel (gimple_seq body, tree clauses, tree child_fn,
    COPY_FN is the optional function for firstprivate initialization.
    ARG_SIZE and ARG_ALIGN are size and alignment of the data block.  */
 
-gimple
+gimple_omp_task
 gimple_build_omp_task (gimple_seq body, tree clauses, tree child_fn,
 		       tree data_arg, tree copy_fn, tree arg_size,
 		       tree arg_align)
 {
-  gimple p = gimple_alloc (GIMPLE_OMP_TASK, 0);
+  gimple_omp_task p =
+    as_a <gimple_omp_task> (gimple_alloc (GIMPLE_OMP_TASK, 0));
   if (body)
     gimple_omp_set_body (p, body);
   gimple_omp_task_set_clauses (p, clauses);
diff --git a/gcc/gimple.h b/gcc/gimple.h
index cc460499..a9903de 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1345,7 +1345,8 @@ gimple_debug gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DE
 gimple_omp_critical gimple_build_omp_critical (gimple_seq, tree);
 gimple_omp_for gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
 gimple_omp_parallel gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
-gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
+gimple_omp_task gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
+				       tree, tree);
 gimple gimple_build_omp_section (gimple_seq);
 gimple gimple_build_omp_master (gimple_seq);
 gimple gimple_build_omp_taskgroup (gimple_seq);
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 46155d6..c51e6da 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1372,7 +1372,7 @@ static gimple_seq maybe_catch_exception (gimple_seq);
 /* Finalize task copyfn.  */
 
 static void
-finalize_task_copyfn (gimple task_stmt)
+finalize_task_copyfn (gimple_omp_task task_stmt)
 {
   struct function *child_cfun;
   tree child_fn;
@@ -1434,7 +1434,7 @@ delete_omp_context (splay_tree_value value)
     }
 
   if (is_task_ctx (ctx))
-    finalize_task_copyfn (ctx->stmt);
+    finalize_task_copyfn (as_a <gimple_omp_task> (ctx->stmt));
 
   XDELETE (ctx);
 }
@@ -2126,7 +2126,7 @@ scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
 {
   omp_context *ctx;
   tree name, t;
-  gimple stmt = gsi_stmt (*gsi);
+  gimple_omp_task stmt = as_a <gimple_omp_task> (gsi_stmt (*gsi));
 
   /* Ignore task directives with empty bodies.  */
   if (optimize > 0
@@ -4566,7 +4566,7 @@ expand_cilk_for_call (basic_block bb, gimple_omp_parallel entry_stmt,
    generate the task operation.  BB is the block where to insert the code.  */
 
 static void
-expand_task_call (basic_block bb, gimple entry_stmt)
+expand_task_call (basic_block bb, gimple_omp_task entry_stmt)
 {
   tree t, t1, t2, t3, flags, cond, c, c2, clauses, depend;
   gimple_stmt_iterator gsi;
@@ -5127,7 +5127,7 @@ expand_omp_taskreg (struct omp_region *region)
     expand_parallel_call (region, new_bb,
 			  as_a <gimple_omp_parallel> (entry_stmt), ws_args);
   else
-    expand_task_call (new_bb, entry_stmt);
+    expand_task_call (new_bb, as_a <gimple_omp_task> (entry_stmt));
   if (gimple_in_ssa_p (cfun))
     update_ssa (TODO_update_ssa_only_virtuals);
 }
@@ -9623,7 +9623,7 @@ task_copyfn_remap_type (struct omp_taskcopy_context *tcctx, tree orig_type)
 /* Create task copyfn.  */
 
 static void
-create_task_copyfn (gimple task_stmt, omp_context *ctx)
+create_task_copyfn (gimple_omp_task task_stmt, omp_context *ctx)
 {
   struct function *child_cfun;
   tree child_fn, t, c, src, dst, f, sf, arg, sarg, decl;
@@ -9954,7 +9954,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
     }
 
   if (ctx->srecord_type)
-    create_task_copyfn (stmt, ctx);
+    create_task_copyfn (as_a <gimple_omp_task> (stmt), ctx);
 
   push_gimplify_context ();
 
-- 
1.8.5.3

  parent reply	other threads:[~2014-10-27 20:35 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 20:35 [gimple-classes, committed 00/92] Initial slew of commits David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 19/92] Introduce gimple_return David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 03/92] Introduce gimple_cond and use it in various places David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 20/92] Introduce gimple_goto David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 22/92] Introduce gimple_transaction David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 27/92] Introduce gimple_resx David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 33/92] Introduce gimple_omp_atomic_store David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 38/92] tree-cfg.c: Make verify_gimple_call require a gimple_call David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 06/92] Introduce gimple_debug and use it in a few places David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 45/92] omp-low.c: Use more concrete types of gimple statement for various locals David Malcolm
2014-10-27 20:35 ` [gimple-classes, committed 14/92] tree-ssa-loop-manip.c: use gimple_phi in three places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 01/92] Introduce gimple_switch and use it in various places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 69/92] Concretize gimple_cond_make_{false|true} David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 04/92] Introduce gimple_assign and use it in various places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 66/92] Concretize three gimple_return_ accessors David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 43/92] Introduce gimple_omp_sections David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 92/92] Update gimple.texi class hierarchy diagram David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 51/92] More gimple_phi David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 40/92] Introduce gimple_omp_single David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 57/92] Make gimple_goto_set_dest require a gimple_goto David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 71/92] Concretize gimple_cond_{true|false}_label David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 05/92] Introduce gimple_label and use it in a few places David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 70/92] Concretize gimple_switch_index and gimple_switch_index_ptr David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 87/92] Convert various gimple to gimple_phi within ssa-iterators.h David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 82/92] Concretize gimple_call_arg_flags David Malcolm
2014-10-27 20:36 ` [gimple-classes, committed 25/92] Introduce gimple_eh_must_not_throw David Malcolm
2014-10-27 20:36 ` David Malcolm [this message]
2014-10-27 20:36 ` [gimple-classes, committed 61/92] Concretize gimple_eh_filter_set_types and gimple_eh_filter_set_failure David Malcolm
2014-10-27 20:37 ` [gimple-classes, committed 83/92] Concretize gimple_assign_nontemporal_move_p David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 84/92] Concretize gimple_call_copy_flags and ipa_modify_call_arguments David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 85/92] Use gimple_call in some places within tree-ssa-dom.c David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 77/92] Concretize gimple_call_nothrow_p David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 86/92] Use gimple_phi in many more places David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 63/92] Concretize three gimple_try_set_ accessors David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 31/92] Use more concrete types for various gimple statements David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 72/92] Concretize gimple_cond_set_code David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 54/92] Various gimple to gimple_call conversions in IPA David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 49/92] Update GRAPHITE to use more concrete gimple statement classes David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 90/92] Automated renaming of gimple subclasses David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 68/92] Concretize locals within expand_omp_for_init_counts David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 73/92] Concretize gimple_cond_set_{lhs|rhs} David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 80/92] Concretize gimple_call_set_fntype David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 75/92] Concretize various expressions from gimple to gimple_cond David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 74/92] Concretize gimple_cond_{lhs|rhs}_ptr David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 88/92] Preparatory work before subclass renaming David Malcolm
2014-10-27 20:38 ` [gimple-classes, committed 02/92] Introduce gimple_bind and use it for accessors David Malcolm
2014-10-27 20:40 ` [gimple-classes, committed 09/92] Update ssa_prop_visit_phi_fn callbacks to take a gimple_phi David Malcolm
2014-10-27 20:47 ` [gimple-classes, committed 89/92] Eliminate subclass typedefs from coretypes.h David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 78/92] Tweak to gimplify_modify_expr David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 15/92] tree-ssa-loop-ivopts.c: use gimple_phi in a few places David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 64/92] Make gimple_phi_arg_location_from_edge require a gimple_phi David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 37/92] Introduce gimple_omp_parallel David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 10/92] tree-parloops.c: use gimple_phi in various places David Malcolm
2014-10-27 20:52 ` [gimple-classes, committed 28/92] Introduce gimple_eh_dispatch David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 35/92] Introduce gimple_omp_critical David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 58/92] Concretize gimple_catch_types David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 13/92] tree-ssa-loop-niter.c: use gimple_phi in a few places David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 23/92] Introduce gimple_catch David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 42/92] Introduce gimple_omp_teams David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 34/92] Introduce gimple_omp_continue David Malcolm
2014-10-27 20:53 ` [gimple-classes, committed 60/92] Concretize gimple_label_label David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 47/92] Make add_phi_arg require a gimple_phi David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 12/92] tree-ssa-phiprop.c: use gimple_phi David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 11/92] tree-predcom.c: use gimple_phi in various places David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 56/92] Make gimple_label_set_label require a gimple_label David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 79/92] Concretize gimple_call_set_fn David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 21/92] Introduce gimple_asm David Malcolm
2014-10-27 20:54 ` [gimple-classes, committed 67/92] Make gimple_cond_set_{true|false}_label require gimple_cond David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 36/92] Introduce gimple_omp_for David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 59/92] Concretize gimple_call_use_set and gimple_call_clobber_set David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 46/92] Make gimple_phi_arg_def_ptr and gimple_phi_arg_has_location require a gimple_phi David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 44/92] tree-parloops.c: Use gimple_phi in various places David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 41/92] Introduce gimple_omp_target David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 48/92] Make gimple_phi_arg_set_location require a gimple_phi David Malcolm
2014-10-27 20:55 ` [gimple-classes, committed 18/92] Introduce gimple_call David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 30/92] Introduce gimple_try David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 07/92] Introduce gimple_phi and use it in various places David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 62/92] Concretize gimple_try_set_catch_is_cleanup David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 52/92] Make gimple_call_return_slot_opt_p require a gimple_call David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 81/92] Concretize gimple_call_set_tail and gimple_call_tail_p David Malcolm
2014-10-27 20:56 ` [gimple-classes, committed 76/92] Concretize gimple_call_set_nothrow David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 91/92] Remove out-of-date references to typedefs David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 50/92] Make gimple_phi_arg_edge require a gimple_phi David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 53/92] Use gimple_call for callgraph edges David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 24/92] Introduce gimple_eh_filter David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 08/92] Introduce gimple_phi_iterator David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 32/92] Introduce gimple_omp_atomic_load David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 29/92] Use subclasses of gimple in various places David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 17/92] Concretize get_loop_exit_condition et al to working on gimple_cond David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 16/92] Update various expressions within tree-scalar-evolution.c to be gimple_phi David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 65/92] Make gimple_phi_arg_location require a gimple_phi David Malcolm
2014-10-27 20:57 ` [gimple-classes, committed 26/92] Introduce gimple_eh_else David Malcolm
2014-10-27 21:32 ` [gimple-classes, committed 55/92] Concretize parameter to gimple_call_copy_skip_args David Malcolm

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=1414442490-14841-40-git-send-email-dmalcolm@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@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).