diff options
author | Martin Jambor <mjambor@suse.cz> | 2016-03-07 19:31:53 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2016-03-07 19:31:53 +0100 |
commit | 4bf1cec711415449e6c604b9da5142853572b52f (patch) | |
tree | 55b94d15f9b30b1f8259bd8e5bd89d53399bac83 /gcc/hsa.c | |
parent | 94156b3f3796d1fe59a48c3dab36aa5a2254f8f9 (diff) | |
download | gcc-4bf1cec711415449e6c604b9da5142853572b52f.zip gcc-4bf1cec711415449e6c604b9da5142853572b52f.tar.gz gcc-4bf1cec711415449e6c604b9da5142853572b52f.tar.bz2 |
[hsa] Consodlidate GTY roots for trees used during expansion to HSA
2016-03-07 Martin Jambor <mjambor@suse.cz>
* hsa.h (hsa_get_ctor_statements): Declare.
(hsa_get_dtor_statements): Likewise.
(hsa_get_kernel_dispatch_type): Likewise.
* hsa.c (hsa_get_ctor_statements): New function.
(hsa_get_dtor_statements): Likewise.
(hsa_get_kernel_dispatch_type): Likewise.
* hsa-brig.c (hsa_cdtor_statements): Removed.
(hsa_output_libgomp_mapping): Use hsa_get_ctor_statements and
hsa_get_dtor_statements.
* hsa-gen.c (hsa_kernel_dispatch_type): Removed.
(get_hsa_kernel_dispatch_offset): Use hsa_get_kernel_dispatch_type.
From-SVN: r234042
Diffstat (limited to 'gcc/hsa.c')
-rw-r--r-- | gcc/hsa.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -712,6 +712,31 @@ hsa_add_kernel_dependency (tree caller, const char *called_function) s->safe_push (called_function); } +/* Expansion to HSA needs a few gc roots to hold types, constructors etc. In + order to minimize the number of GTY roots, we'll root them all in the + following array. The individual elements should only be accessed by the + very simple getters (of a pointer-to-tree) below. */ + +static GTY(()) tree hsa_tree_gt_roots[3]; + +tree * +hsa_get_ctor_statements (void) +{ + return &hsa_tree_gt_roots[0]; +} + +tree * +hsa_get_dtor_statements (void) +{ + return &hsa_tree_gt_roots[1]; +} + +tree * +hsa_get_kernel_dispatch_type (void) +{ + return &hsa_tree_gt_roots[2]; +} + /* Modify the name P in-place so that it is a valid HSA identifier. */ void |