summaryrefslogtreecommitdiff
path: root/gcc/hsa-common.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-06-08 14:13:20 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-06-08 12:13:20 +0000
commit0148358a02a230ef250718b13180527701edf3ca (patch)
treec391b8e527f99087eaf0e3f41c22636b16377a53 /gcc/hsa-common.h
parent99353fcfe4f50d131fae9978ce9cd19bcaf243cf (diff)
Add {symbol,call}_summary::get method and use it in HSA.
2018-06-08 Martin Liska <mliska@suse.cz> * hsa-common.h (enum hsa_function_kind): Rename HSA_NONE to HSA_INVALID. (hsa_function_summary::hsa_function_summary): Use the new enum value. (hsa_gpu_implementation_p): Use hsa_summaries::get. * hsa-gen.c (hsa_get_host_function): Likewise. (get_brig_function_name): Likewise. * ipa-hsa.c (process_hsa_functions): Likewise. (ipa_hsa_write_summary): Likewise. * symbol-summary.h (symtab_duplication): Use ::get function/ (get): New function. From-SVN: r261310
Diffstat (limited to 'gcc/hsa-common.h')
-rw-r--r--gcc/hsa-common.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/hsa-common.h b/gcc/hsa-common.h
index 849363c7b49..c72343fbdab 100644
--- a/gcc/hsa-common.h
+++ b/gcc/hsa-common.h
@@ -1208,7 +1208,7 @@ public:
enum hsa_function_kind
{
- HSA_NONE,
+ HSA_INVALID,
HSA_KERNEL,
HSA_FUNCTION
};
@@ -1234,7 +1234,7 @@ struct hsa_function_summary
};
inline
-hsa_function_summary::hsa_function_summary (): m_kind (HSA_NONE),
+hsa_function_summary::hsa_function_summary (): m_kind (HSA_INVALID),
m_bound_function (NULL), m_gpu_implementation_p (false)
{
}
@@ -1244,7 +1244,10 @@ class hsa_summary_t: public function_summary <hsa_function_summary *>
{
public:
hsa_summary_t (symbol_table *table):
- function_summary<hsa_function_summary *> (table) { }
+ function_summary<hsa_function_summary *> (table)
+ {
+ disable_insertion_hook ();
+ }
/* Couple GPU and HOST as gpu-specific and host-specific implementation of
the same function. KIND determines whether GPU is a host-invokable kernel
@@ -1407,10 +1410,8 @@ hsa_gpu_implementation_p (tree decl)
if (hsa_summaries == NULL)
return false;
- hsa_function_summary *s
- = hsa_summaries->get_create (cgraph_node::get_create (decl));
-
- return s->m_gpu_implementation_p;
+ hsa_function_summary *s = hsa_summaries->get (cgraph_node::get_create (decl));
+ return s != NULL && s->m_gpu_implementation_p;
}
#endif /* HSA_H */