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)
Checks
Commit Message
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
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(-)
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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" } } */
@@ -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