Adjust 'libgomp.c/declare-variant-{3,4}-[...]' for inter-procedural value range propagation

..., that is, commit 53ba8d6695
"inter-procedural value range propagation", after which we see:

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

Etc.  That's due to:

    @@ -144,13 +144,11 @@
     __attribute__((omp target entrypoint, noclone))
     void main._omp_fn.0 (const struct .omp_data_t.3 & restrict .omp_data_i)
     {
    -  int _3;
       int * _5;

       <bb 2> [local count: 1073741824]:
    -  _3 = f30 ();
       _5 = *.omp_data_i_4(D).v;
    -  *_5 = _3;
    +  *_5 = 30;
       return;

It's nice to see this optimization work here, too, but it does interfere with
how we're currently testing OpenMP 'declare variant'.

	libgomp/
	* testsuite/libgomp.c/declare-variant-3.h (f30, f35, f53, f70)
	(f75, f80, f): Add '__attribute__ ((noipa))'.
	* testsuite/libgomp.c/declare-variant-4.h (gfx803, gfx900, gfx906)
	(gfx908, gfx90a, f): Likewise.
This commit is contained in:
Thomas Schwinge 2023-11-21 22:42:49 +01:00
parent e9b39df933
commit a53da3a213
2 changed files with 15 additions and 0 deletions

View File

@ -1,34 +1,41 @@
#pragma omp declare target #pragma omp declare target
__attribute__ ((noipa))
int int
f30 (void) f30 (void)
{ {
return 30; return 30;
} }
__attribute__ ((noipa))
int int
f35 (void) f35 (void)
{ {
return 35; return 35;
} }
__attribute__ ((noipa))
int int
f53 (void) f53 (void)
{ {
return 53; return 53;
} }
__attribute__ ((noipa))
int int
f70 (void) f70 (void)
{ {
return 70; return 70;
} }
__attribute__ ((noipa))
int int
f75 (void) f75 (void)
{ {
return 75; return 75;
} }
__attribute__ ((noipa))
int int
f80 (void) f80 (void)
{ {
@ -41,6 +48,7 @@ f80 (void)
#pragma omp declare variant (f70) match (device={isa("sm_70")}) #pragma omp declare variant (f70) match (device={isa("sm_70")})
#pragma omp declare variant (f75) match (device={isa("sm_75")}) #pragma omp declare variant (f75) match (device={isa("sm_75")})
#pragma omp declare variant (f80) match (device={isa("sm_80")}) #pragma omp declare variant (f80) match (device={isa("sm_80")})
__attribute__ ((noipa))
int int
f (void) f (void)
{ {

View File

@ -1,28 +1,34 @@
#pragma omp declare target #pragma omp declare target
__attribute__ ((noipa))
int int
gfx803 (void) gfx803 (void)
{ {
return 0x803; return 0x803;
} }
__attribute__ ((noipa))
int int
gfx900 (void) gfx900 (void)
{ {
return 0x900; return 0x900;
} }
__attribute__ ((noipa))
int int
gfx906 (void) gfx906 (void)
{ {
return 0x906; return 0x906;
} }
__attribute__ ((noipa))
int int
gfx908 (void) gfx908 (void)
{ {
return 0x908; return 0x908;
} }
__attribute__ ((noipa))
int int
gfx90a (void) gfx90a (void)
{ {
@ -38,6 +44,7 @@ gfx90a (void)
#pragma omp declare variant(gfx906) match(device = {isa("gfx906")}) #pragma omp declare variant(gfx906) match(device = {isa("gfx906")})
#pragma omp declare variant(gfx908) match(device = {isa("gfx908")}) #pragma omp declare variant(gfx908) match(device = {isa("gfx908")})
#pragma omp declare variant(gfx90a) match(device = {isa("gfx90a")}) #pragma omp declare variant(gfx90a) match(device = {isa("gfx90a")})
__attribute__ ((noipa))
int int
f (void) f (void)
{ {