Skip to content

Commit

Permalink
HSA: simplify partitioning of HSA kernels and host impls.
Browse files Browse the repository at this point in the history
	* 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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232871 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
marxin committed Jan 27, 2016
1 parent 220112f commit 874e154
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
5 changes: 5 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions gcc/hsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 5 additions & 0 deletions gcc/lto/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
19 changes: 0 additions & 19 deletions gcc/lto/lto-partition.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 874e154

Please sign in to comment.