public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Tom de Vries <tdevries@suse.de>, Jakub Jelinek <jakub@redhat.com>,
	Tobias Burnus <tobias@codesourcery.com>
Subject: In 'libgomp.c/declare-variant-{3,4}-*.c', restrict 'scan-offload-tree-dump's to 'only_for_offload_target [...]' (was: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c)
Date: Thu, 30 Nov 2023 15:57:30 +0100	[thread overview]
Message-ID: <87a5qv5lwl.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <0ce14ee6-a677-76a9-7e7a-d99d3927bd8a@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]

Hi!

On 2022-02-24T11:32:53+0100, Tom de Vries via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
> @@ -0,0 +1,7 @@
> +/* { dg-do run { target { offload_target_nvptx } } } */

This means, the test case is active if nvptx offloading compilation is
enabled.  But, consider the case that GCN offloading compilation also
is enabled:

| +/* { dg-additional-options -foffload=nvptx-none } */
> +/* { dg-additional-options "-foffload=-misa=sm_30" } */

This means, the test cases is restricted to nvptx offloading compilation,
but not GCN.

> +/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */

This will thus produce a dump file for nvptx, only.  No dump file
produced for GCN.

> +[...]
> +/* { dg-final { scan-offload-tree-dump "= f30 \\(\\);" "optimized" } } */

..., and this will try to scan dump files for both GCN and nvptx.  The
former doesn't exist, resulting in UNRESOLVEDs for GCN.  Etc.  I've
pushed to master branch commit 186e22c5de8eb49603bb1e74ac5d0eba6cc40480
"In 'libgomp.c/declare-variant-{3,4}-*.c', restrict 'scan-offload-tree-dump's to 'only_for_offload_target [...]'",
see attached.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-In-libgomp.c-declare-variant-3-4-.c-restrict-scan-of.patch --]
[-- Type: text/x-diff, Size: 8897 bytes --]

From 186e22c5de8eb49603bb1e74ac5d0eba6cc40480 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
Date: Tue, 21 Nov 2023 17:31:37 +0100
Subject: [PATCH] In 'libgomp.c/declare-variant-{3,4}-*.c', restrict
 'scan-offload-tree-dump's to 'only_for_offload_target [...]'

... to care for the case where not just one but both of GCN and nvptx
offloading are enabled.  In that case, we currently get:

    UNRESOLVED: libgomp.c/declare-variant-3-sm30.c scan-amdgcn-amdhsa-offload-tree-dump optimized "= f30 \\(\\);"

... in addition to:

    PASS: libgomp.c/declare-variant-3-sm30.c scan-nvptx-none-offload-tree-dump optimized "= f30 \\(\\);"

Etc.

Fix-up for commit 59b8ade88774b4dcf1691a8f650cdbb86cc30862
"[libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c",
and commit 1fd508744eccda9ad9c6d6fcce5b2ea9c568818d
"amdgcn: Support AMD-specific 'isa' traits in OpenMP context selectors".

	libgomp/
	* testsuite/libgomp.c/declare-variant-3-sm30.c: Restrict
	'scan-offload-tree-dump' to 'only_for_offload_target nvptx-none'.
	* testsuite/libgomp.c/declare-variant-3-sm35.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm53.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm70.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm75.c: Likewise.
	* testsuite/libgomp.c/declare-variant-3-sm80.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-fiji.c: Restrict
	'scan-offload-tree-dump' to
	'only_for_offload_target amdgcn-amdhsa'.
	* testsuite/libgomp.c/declare-variant-4-gfx803.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx900.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx906.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx908.c: Likewise.
	* testsuite/libgomp.c/declare-variant-4-gfx90a.c: Likewise.
---
 libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c   | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c | 2 +-
 libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
index be5edbaf0fd..a373647bb33 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm30.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f30 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f30 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
index 79cd8fc940d..bf8dc3e2441 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm35.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f35 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f35 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
index 8d05e9efc62..1864a7a9277 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm53.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f53 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f53 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
index e102c11ab44..2249cd4c24d 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm70.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f70 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f70 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
index 7122ccc22d1..18ede59c541 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm75.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f75 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f75 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
index 5e13d876500..20048f1d702 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-3-sm80.c
@@ -5,4 +5,4 @@
 
 #include "declare-variant-3.h"
 
-/* { dg-final { scan-offload-tree-dump "= f80 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f80 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c b/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c
index ae2af1cc00c..8a4e0f4728c 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-fiji.c
@@ -5,4 +5,4 @@
 #define USE_FIJI_FOR_GFX803
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c
index e0437a04d65..050d7c9dd79 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx803.c
@@ -4,4 +4,4 @@
 
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx803 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
index 8de03725dec..2eeb4a248c1 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx900.c
@@ -4,4 +4,4 @@
 
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx900 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx900 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
index be6f193ed3a..73a670dcc2a 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx906.c
@@ -4,4 +4,4 @@
 
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx906 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx906 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
index 311fad9074d..ead330f9f2c 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx908.c
@@ -4,4 +4,4 @@
 
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx908 \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx908 \\(\\);" "optimized" } } */
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
index 96cc14ca0a3..a9b2d62a49d 100644
--- a/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
+++ b/libgomp/testsuite/libgomp.c/declare-variant-4-gfx90a.c
@@ -4,4 +4,4 @@
 
 #include "declare-variant-4.h"
 
-/* { dg-final { scan-offload-tree-dump "= gfx90a \\(\\);" "optimized" } } */
+/* { dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump "= gfx90a \\(\\);" "optimized" } } */
-- 
2.34.1


  parent reply	other threads:[~2023-11-30 14:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 17:24 [Patch] nvptx: Add -mptx=6.0 + -misa=sm_70 Tobias Burnus
2022-02-22 14:26 ` Tom de Vries
2022-02-22 14:39 ` Tom de Vries
2022-02-22 14:43 ` Tom de Vries
2022-02-22 16:03   ` Tobias Burnus
2022-02-24  8:29     ` Tom de Vries
2022-02-24 10:01       ` [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c Tom de Vries
2022-02-24 10:09         ` Jakub Jelinek
2022-02-24 10:32           ` Tom de Vries
2022-02-24 10:38             ` Jakub Jelinek
2023-11-30 14:48             ` Fix 'libgomp.c/declare-variant-3-*.c' compilation for configurations where GCN offloading is enabled in addition to nvptx (was: [PATCH][libgomp, testsuite, nvptx] Add libgomp.c/declare-variant-3-sm*.c) Thomas Schwinge
2023-11-30 14:49               ` Thomas Schwinge
2023-11-30 14:57             ` Thomas Schwinge [this message]
2023-11-30 14:59             ` Spin 'dg-do run' part of 'libgomp.c/declare-variant-3-sm30.c' off into new 'libgomp.c/declare-variant-3.c' " Thomas Schwinge

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=87a5qv5lwl.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=tdevries@suse.de \
    --cc=tobias@codesourcery.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).