On 26/06/2020 8:35 am, Christophe Lyon wrote:
Hi,
I've noticed a regression since your commit, on arm aarch64 and x86:
for instance on arm-linux-gnueabi:
PASS: gfortran.dg/gomp/combined-if.f90 -O (test for excess errors)
PASS: gfortran.dg/gomp/combined-if.f90 -O scan-tree-dump-times
omplower "(?n)#pragma omp target.* if\\(" 9
gfortran.dg/gomp/combined-if.f90 -O : pattern found 4 times
FAIL: gfortran.dg/gomp/combined-if.f90 -O scan-tree-dump-times
omplower "(?n)#pragma omp simd.* if\\(" 7
PASS: gfortran.dg/gomp/combined-if.f90 -O scan-tree-dump-times
omplower "(?n)#pragma omp parallel.* if\\(" 6
Not sure why you didn't see it?
Hello
I was working with a compiler built with offloading support for nvptx, and that
emits extra '#pragma omp simd' statements with an extra _simt_:
#pragma omp simd _simduid_(simduid.21) _looptemp_(D.4127) _looptemp_(D.4128)
_simt_ linear(i.13:1) linear(i:1) if(D.4108)
#pragma omp simd _simduid_(simduid.22) _looptemp_(D.4127) _looptemp_(D.4128)
linear(i.13:1) linear(i:1) if(D.4108)
#pragma omp simd _simduid_(simduid.64) _looptemp_(D.4437) _looptemp_(D.4438)
_simt_ linear(i.58:1) linear(i:1) if(D.3977)
#pragma omp simd _simduid_(simduid.65) _looptemp_(D.4437) _looptemp_(D.4438)
linear(i.58:1) linear(i:1) if(D.3977)
#pragma omp simd _simduid_(simduid.106) _simt_ linear(i.101:1) linear(i:1)
if(D.4681)
#pragma omp simd _simduid_(simduid.107) linear(i.101:1) linear(i:1) if(D.4681)
#pragma omp simd _simduid_(simduid.170) _looptemp_(D.5081) _looptemp_(D.5082)
linear(i.164:1) linear(i:1) if(D.4069)
If offloading is disabled, or targeted for amdgcn, the lines sith _simt_ do not
appear. This appears to be controlled by omp_max_simt_vf() in omp-general.c, and
is currently only non-zero for nvptx.
I think the easiest fix would be to expect different numbers of matches
depending on whether nvptx offloading is enabled. This requires an extra
function in gcc/testsuite/lib/target-supports.exp.
Okay for master/OG10?
Thanks
Kwok
commit 04bdcaa20827d814c323847630c59ee843c51408
Author: Kwok Cheung Yeung <k...@codesourcery.com>
Date: Fri Jun 26 10:35:36 2020 -0700
Fix failure in gfortran.dg/gomp/combined-if.f90 test
Enabling nvptx offloading results in extra '#pragma omp simd' statements
in the tree dump with an extra '_simt_'.
2020-06-26 Kwok Cheung Yeung <k...@codesourcery.com>
gcc/testsuite/
* testsuite/gfortran.dg/gomp/combined-if.f90: Adjust expected number
of matches depending on whether nvptx offloading is supported.
* testsuite/lib/target-supports.exp
(check_effective_target_offload_nvptx): New.
diff --git a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
index bf4a9a8..0bb6c28 100644
--- a/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/combined-if.f90
@@ -104,5 +104,6 @@ contains
end module
! { dg-final { scan-tree-dump-times "(?n)#pragma omp target.* if\\(" 9
"omplower" } }
-! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7
"omplower" } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 4
"omplower" { target { ! offload_nvptx } } } }
+! { dg-final { scan-tree-dump-times "(?n)#pragma omp simd.* if\\(" 7
"omplower" { target { offload_nvptx } } } }
! { dg-final { scan-tree-dump-times "(?n)#pragma omp parallel.* if\\(" 6
"omplower" } }
diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index cf0cfa1..2279361 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -9820,6 +9820,14 @@ proc check_effective_target_vect_max_reduc { } {
return 0
}
+# Return 1 if the compiler has been configured with nvptx offloading.
+
+proc check_effective_target_offload_nvptx { } {
+ return [check_no_compiler_messages offload_nvptx assembly {
+ int main () {return 0;}
+ } "-foffload=nvptx-none" ]
+}
+
# Return 1 if the compiler has been configured with hsa offloading.
proc check_effective_target_offload_hsa { } {
@@ -9828,7 +9836,7 @@ proc check_effective_target_offload_hsa { } {
} "-foffload=hsa" ]
}
-# Return 1 if the compiler has been configured with hsa offloading.
+# Return 1 if the compiler has been configured with gcn offloading.
proc check_effective_target_offload_gcn { } {
return [check_no_compiler_messages offload_gcn assembly {