diff mbox

[hsa] Exclude parallel outlines from hsa_callable_functions_p

Message ID 20161202135546.thd5qiepimc4gvou@virgil.suse.cz
State New
Headers show

Commit Message

Martin Jambor Dec. 2, 2016, 1:55 p.m. UTC
Hi,

after the merge of nvidia OpenMP implementation, the normal parallel
outline functions were also marked as "omp declare target" which lead
to them being cloned and compiled to HSA which is not only unnecessary
but often leads to a lot of useless HSA warning noise.  The following
patch deal with this issue by making sure they are not considered
callable from HSA.

Bootstrapped and tested on x86_64-linux.  I will commit it to trunk in
a few moments (it is already part of my most recent merge from trunk
to the hsa branch.

Thanks,

Martin

Exclude parallel outlines from hsa_callable_functions_p

2016-11-29  Martin Jambor  <mjambor@suse.cz>

	    * hsa.c (hsa_callable_function_p): Return false for artificial
	      functions.
---
 gcc/hsa.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gcc/hsa.c b/gcc/hsa.c
index f881e78..31e3252 100644
--- a/gcc/hsa.c
+++ b/gcc/hsa.c
@@ -90,7 +90,10 @@  bool
 hsa_callable_function_p (tree fndecl)
 {
   return (lookup_attribute ("omp declare target", DECL_ATTRIBUTES (fndecl))
-	  && !lookup_attribute ("oacc function", DECL_ATTRIBUTES (fndecl)));
+	  && !lookup_attribute ("oacc function", DECL_ATTRIBUTES (fndecl))
+	  /* At this point, this is enough to identify clones for
+	     parallel, which for HSA would need to be kernels anyway.  */
+	  && !DECL_ARTIFICIAL (fndecl));
 }
 
 /* Allocate HSA structures that are are used when dealing with different