summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-11 10:35:31 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2017-01-11 10:35:31 +0000
commit86814365f6a4e5972c9014c1ad95187e8d7e6b87 (patch)
treef2d05c5ca8dd4a860cc74dd72658a92146d66d22
parent7b70b1b591089c70243a9e03a0962186f8d7a5a3 (diff)
downloadgcc-86814365f6a4e5972c9014c1ad95187e8d7e6b87.tar.gz
[hsa] Fix hsa function cloning test
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244308 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/hsa.c5
-rw-r--r--gcc/ipa-hsa.c5
3 files changed, 12 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caa26f8ea55..3c8f977e317 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/hsa.c b/gcc/hsa.c
index c0ed9f82bf3..2035ce446a1 100644
--- 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
diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c
index 4391b580566..6a3f660672e 100644
--- a/gcc/ipa-hsa.c
+++ b/gcc/ipa-hsa.c
@@ -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;