HSA: simplify partitioning of HSA kernels and host impls.
authorMartin Liska <mliska@suse.cz>
Wed, 27 Jan 2016 12:50:05 +0000 (13:50 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Wed, 27 Jan 2016 12:50:05 +0000 (12:50 +0000)
* lto-partition.c (add_symbol_to_partition_1): Remove usage
of hsa_summaries.
* hsa.c (hsa_summary_t::link_functions): Create IPA_REF_ADDR
reference for an HSA kernel and its host function.

From-SVN: r232871

gcc/ChangeLog
gcc/hsa.c
gcc/lto/ChangeLog
gcc/lto/lto-partition.c

index 12a2583610d5ad5a10eda885ecda71d67bcab01f..cffba0239736e4d239ca366bfd2856a0af0725f9 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-27  Martin Liska  <mliska@suse.cz>
+
+       * hsa.c (hsa_summary_t::link_functions): Create IPA_REF_ADDR
+       reference for an HSA kernel and its host function.
+
 2016-01-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/69399
index ec23f8126f0160e866a86a5e533ddec678726f01..f0b320573bff24eecd36fcaecbefcab1a8e899b7 100644 (file)
--- a/gcc/hsa.c
+++ b/gcc/hsa.c
@@ -781,6 +781,11 @@ hsa_summary_t::link_functions (cgraph_node *gpu, cgraph_node *host,
   TREE_OPTIMIZATION (fn_opts)->x_flag_tree_loop_vectorize = false;
   TREE_OPTIMIZATION (fn_opts)->x_flag_tree_slp_vectorize = false;
   DECL_FUNCTION_SPECIFIC_OPTIMIZATION (gdecl) = fn_opts;
+
+  /* Create reference between a kernel and a corresponding host implementation
+     to quarantee LTO streaming to a same LTRANS.  */
+  if (kind == HSA_KERNEL)
+    gpu->create_reference (host, IPA_REF_ADDR);
 }
 
 /* Add a HOST function to HSA summaries.  */
index 952ebd4090a5c2dc04b8b908abea1c9c801a904b..43faaf4cb30327f5156dc64d33c984b0f5ddda3f 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-27  Martin Liska  <mliska@suse.cz>
+
+       * lto-partition.c (add_symbol_to_partition_1): Remove usage
+       of hsa_summaries.
+
 2016-01-19  Jan Hubicka  <hubicka@ucw.cz>
 
        PR lto/69136
index eb28fed625c7cc3b6c1f0de9add709f99fe6da79..9eb63c27f33213c8e9a050bc5a57efb41be385d0 100644 (file)
@@ -34,7 +34,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-prop.h"
 #include "ipa-inline.h"
 #include "lto-partition.h"
-#include "hsa.h"
 
 vec<ltrans_partition> ltrans_partitions;
 
@@ -171,24 +170,6 @@ add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
         Therefore put it into the same partition.  */
       if (cnode->instrumented_version)
        add_symbol_to_partition_1 (part, cnode->instrumented_version);
-
-      /* Add an HSA associated with the symbol.  */
-      if (hsa_summaries != NULL)
-       {
-         hsa_function_summary *s = hsa_summaries->get (cnode);
-         if (s->m_kind == HSA_KERNEL)
-           {
-             /* Add binded function.  */
-             bool added = add_symbol_to_partition_1 (part,
-                                                     s->m_binded_function);
-             gcc_assert (added);
-             if (symtab->dump_file)
-               fprintf (symtab->dump_file,
-                        "adding an HSA function (host/gpu) to the "
-                        "partition: %s\n",
-                        s->m_binded_function->name ());
-           }
-       }
     }
 
   add_references_to_partition (part, node);