[hsa] Fix hsa function cloning test
authorMartin Jambor <mjambor@suse.cz>
Wed, 11 Jan 2017 10:35:31 +0000 (11:35 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Wed, 11 Jan 2017 10:35:31 +0000 (11:35 +0100)
2017-01-11  Martin Jambor  <mjambor@suse.cz>

* hsa.c (hsa_callable_function_p): Revert addition of DECL_ARTIFICIAL
test.
* ipa-hsa.c (process_hsa_functions): Only duplicate non-artificial
decorated functions.

From-SVN: r244308

gcc/ChangeLog
gcc/hsa.c
gcc/ipa-hsa.c

index caa26f8ea5562cb475b4401ec9e57599e85e0726..3c8f977e317d95da3f1a15bea3f1747e7c8c0b82 100644 (file)
@@ -1,3 +1,10 @@
+2017-01-11  Martin Jambor  <mjambor@suse.cz>
+
+       * hsa.c (hsa_callable_function_p): Revert addition of DECL_ARTIFICIAL
+       test.
+       * ipa-hsa.c (process_hsa_functions): Only duplicate non-artificial
+       decorated functions.
+
 2017-01-11  Richard Biener  <rguenther@suse.de>
 
        * tree-vrp.c (evrp_dom_walker::before_dom_children): Also
index c0ed9f82bf3f31df083f1ed5c8af119fff57b21b..2035ce446a15f14bd9fa0ddb9b29bebb1032957b 100644 (file)
--- a/gcc/hsa.c
+++ b/gcc/hsa.c
@@ -90,10 +90,7 @@ bool
 hsa_callable_function_p (tree fndecl)
 {
   return (lookup_attribute ("omp declare target", 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));
+         && !lookup_attribute ("oacc function", DECL_ATTRIBUTES (fndecl)));
 }
 
 /* Allocate HSA structures that are are used when dealing with different
index 4391b580566936b6306878f29e0f2ec2538ad76d..6a3f660672e7d234962d6f21dae8897836c335c6 100644 (file)
@@ -100,7 +100,10 @@ process_hsa_functions (void)
                     clone->name (),
                     s->m_kind == HSA_KERNEL ? "kernel" : "function");
        }
-      else if (hsa_callable_function_p (node->decl))
+      else if (hsa_callable_function_p (node->decl)
+              /* At this point, this is enough to identify clones for
+                 parallel, which for HSA would need to be kernels anyway.  */
+              && !DECL_ARTIFICIAL (node->decl))
        {
          if (!check_warn_node_versionable (node))
            continue;