diff mbox

[GOMP4] Fix OpenACC async clause

Message ID 530F0B98.20906@samsung.com
State New
Headers show

Commit Message

Ilmir Usmanov Feb. 27, 2014, 9:55 a.m. UTC
Hi Thomas!

Fixed patch and ChangeLog in attachment.

On 27.02.2014 12:59, Thomas Schwinge wrote:
> GANG/ASYNC/WAIT, for consistency?
Fixed.
> For consistency, also move OMP_CLAUSE_ASYNC_EXPR in gcc/tree.h, and also
> adapt OMP_CLAUSE_ASYNC in gcc/tree-pretty-print.c:dump_omp_clause?
It is already adapted:
>     case OMP_CLAUSE_ASYNC:
>       pp_string (buffer, "async");
>       if (OMP_CLAUSE_DECL (clause))
>         {
>           pp_character(buffer, '(');
>           dump_generic_node (buffer, OMP_CLAUSE_DECL (clause),
>                              spc, flags, false);
>           pp_character(buffer, ')');
>         }
>       break;

Comments

Thomas Schwinge Feb. 27, 2014, 10:29 a.m. UTC | #1
Hi Ilmir!

On Thu, 27 Feb 2014 13:55:36 +0400, Ilmir Usmanov <i.usmanov@samsung.com> wrote:
> Fixed patch and ChangeLog in attachment.

By the way, what I usually do is to put a change's ChangeLog snippet into
that Git commit's commit message, and then once I get to the point where
I push something upstream, I can just take it from there, and put it into
the respective ChangeLog file(s).  Just a suggestions -- no idea whether
that fits your workflow.


> On 27.02.2014 12:59, Thomas Schwinge wrote:
> > For consistency, also move OMP_CLAUSE_ASYNC_EXPR in gcc/tree.h, and also
> > adapt OMP_CLAUSE_ASYNC in gcc/tree-pretty-print.c:dump_omp_clause?
> It is already adapted:
> >     case OMP_CLAUSE_ASYNC:

Move between handling of OMP_CLAUSE_GANG and OMP_CLAUSE_ASYNC?

> 2014-02-27  Ilmir Usmanov  <i.usmanov@samsung.com>
> 
> 	Fix OpenACC ASYNC clause: it can contain integer-expression-list.

s%can%cannot, I think?

> 	* gcc/
> 	tree-core.h (enum omp_clause_code): Likewise.
> 	tree.h (OMP_CLAUSE_ASYNC_EXPR): Reorder.
> 	tree.c (omp_clause_num_ops, omp_clause_code_name): Reorder clauses.
> 	omp-low.c (scan_sharing_clauses): Likewise.
> 	gimplify.c (gimplify_scan_omp_clauses): Likewise.

Can't start that with »Likewise« ;-), so change that or reorder the
entries.

With that changed, it's OK to commit (don't need to repost), thanks!


Grüße,
 Thomas
Ilmir Usmanov Feb. 27, 2014, 10:57 a.m. UTC | #2
Committed as r208197.
diff mbox

Patch

From bff6eb6dd930316bab91f222c1673e699fa97b96 Mon Sep 17 00:00:00 2001
From: Ilmir Usmanov <i.usmanov@samsung.com>
Date: Thu, 27 Feb 2014 13:46:24 +0400
Subject: [PATCH] Fix ASYNC

---
 gcc/gimplify.c  | 4 ++--
 gcc/omp-low.c   | 4 ++--
 gcc/tree-core.h | 6 +++---
 gcc/tree.c      | 6 +++---
 gcc/tree.h      | 6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index fd4305c..d0a4779 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6186,10 +6186,10 @@  gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
 	case OMP_CLAUSE_DEVICE_RESIDENT:
 	case OMP_CLAUSE_USE_DEVICE:
 	case OMP_CLAUSE_GANG:
+	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WAIT:
 	case OMP_NO_CLAUSE_CACHE:
 	case OMP_CLAUSE_INDEPENDENT:
-	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WORKER:
 	case OMP_CLAUSE_VECTOR:
 	case OMP_CLAUSE_NUM_GANGS:
@@ -6546,10 +6546,10 @@  gimplify_adjust_omp_clauses (tree *list_p)
 	case OMP_CLAUSE_DEVICE_RESIDENT:
 	case OMP_CLAUSE_USE_DEVICE:
 	case OMP_CLAUSE_GANG:
+	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WAIT:
 	case OMP_NO_CLAUSE_CACHE:
 	case OMP_CLAUSE_INDEPENDENT:
-	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WORKER:
 	case OMP_CLAUSE_VECTOR:
 	case OMP_CLAUSE_NUM_GANGS:
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 6dec687..eec862e 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1776,10 +1776,10 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	case OMP_CLAUSE_DEVICE_RESIDENT:
 	case OMP_CLAUSE_USE_DEVICE:
 	case OMP_CLAUSE_GANG:
+	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WAIT:
 	case OMP_NO_CLAUSE_CACHE:
 	case OMP_CLAUSE_INDEPENDENT:
-	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WORKER:
 	case OMP_CLAUSE_VECTOR:
 	case OMP_CLAUSE_NUM_GANGS:
@@ -1916,10 +1916,10 @@  scan_sharing_clauses (tree clauses, omp_context *ctx)
 	case OMP_CLAUSE_DEVICE_RESIDENT:
 	case OMP_CLAUSE_USE_DEVICE:
 	case OMP_CLAUSE_GANG:
+	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WAIT:
 	case OMP_NO_CLAUSE_CACHE:
 	case OMP_CLAUSE_INDEPENDENT:
-	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WORKER:
 	case OMP_CLAUSE_VECTOR:
 	case OMP_CLAUSE_NUM_GANGS:
diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index fcdeb44..e9aeb65 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -286,6 +286,9 @@  enum omp_clause_code {
       size-expression: * | integer-expression.  */
   OMP_CLAUSE_GANG,
 
+  /* OpenACC clause: async [(integer-expression)].  */
+  OMP_CLAUSE_ASYNC,
+
   /* OpenACC clause/directive: wait [(integer-expression-list)].  */
   OMP_CLAUSE_WAIT,
 
@@ -372,9 +375,6 @@  enum omp_clause_code {
   /* OpenACC clause: independent.  */
   OMP_CLAUSE_INDEPENDENT,
 
-  /* OpenACC clause: async [(integer-expression)].  */
-  OMP_CLAUSE_ASYNC,
-
   /* OpenACC clause: worker [( [num:] integer-expression)].  */
   OMP_CLAUSE_WORKER,
 
diff --git a/gcc/tree.c b/gcc/tree.c
index 0655db0..d9a577b 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -264,6 +264,7 @@  unsigned const char omp_clause_num_ops[] =
   1, /* OMP_CLAUSE_DEVICE_RESIDENT  */
   1, /* OMP_CLAUSE_USE_DEVICE  */
   1, /* OMP_CLAUSE_GANG  */
+  1, /* OMP_CLAUSE_ASYNC  */
   1, /* OMP_CLAUSE_WAIT  */
   1, /* OMP_NO_CLAUSE_CACHE  */
   1, /* OMP_CLAUSE__LOOPTEMP_  */
@@ -292,7 +293,6 @@  unsigned const char omp_clause_num_ops[] =
   0, /* OMP_CLAUSE_TASKGROUP  */
   1, /* OMP_CLAUSE__SIMDUID_  */
   0, /* OMP_CLAUSE_INDEPENDENT  */
-  1, /* OMP_CLAUSE_ASYNC  */
   1, /* OMP_CLAUSE_WORKER  */
   1, /* OMP_CLAUSE_VECTOR  */
   1, /* OMP_CLAUSE_NUM_GANGS  */
@@ -322,6 +322,7 @@  const char * const omp_clause_code_name[] =
   "device_resident",
   "use_device",
   "gang",
+  "async",
   "wait",
   "_cache_",
   "_looptemp_",
@@ -350,7 +351,6 @@  const char * const omp_clause_code_name[] =
   "taskgroup",
   "_simduid_",
   "independent",
-  "async",
   "worker",
   "vector",
   "num_gangs",
@@ -11062,9 +11062,9 @@  walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
 	case OMP_CLAUSE_DEVICE_RESIDENT:
 	case OMP_CLAUSE_USE_DEVICE:
 	case OMP_CLAUSE_GANG:
+	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WAIT:
 	case OMP_NO_CLAUSE_CACHE:
-	case OMP_CLAUSE_ASYNC:
 	case OMP_CLAUSE_WORKER:
 	case OMP_CLAUSE_VECTOR:
 	case OMP_CLAUSE_NUM_GANGS:
diff --git a/gcc/tree.h b/gcc/tree.h
index 4d598d1..84801ff 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -1315,15 +1315,15 @@  extern void protected_set_expr_location (tree, location_t);
 #define OMP_CLAUSE_GANG_EXPR(NODE) \
   OMP_CLAUSE_OPERAND ( \
     OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GANG), 0)
+#define OMP_CLAUSE_ASYNC_EXPR(NODE) \
+  OMP_CLAUSE_OPERAND ( \
+    OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ASYNC), 0)
 #define OMP_WAIT_EXPR(NODE) \
   OMP_CLAUSE_OPERAND ( \
     OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WAIT), 0)
 #define OMP_CLAUSE_VECTOR_EXPR(NODE) \
   OMP_CLAUSE_OPERAND ( \
     OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_VECTOR_LENGTH), 0)
-#define OMP_CLAUSE_ASYNC_EXPR(NODE) \
-  OMP_CLAUSE_OPERAND ( \
-    OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ASYNC), 0)
 #define OMP_CLAUSE_WORKER_EXPR(NODE) \
   OMP_CLAUSE_OPERAND ( \
     OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WORKER), 0)
-- 
1.8.3.2