From 13b00728f4b3e114fb20da69cc853e97eed3424e Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 25 Nov 2015 11:05:06 +0100
Subject: [PATCH 6/6] HSA: remove hsa_symbol::global_var_p predicate
gcc/ChangeLog:
2015-11-25 Martin Liska <mliska@suse.cz>
* hsa-brig.c (emit_directive_variable): Replace the predicate
with test of linkage.
* hsa-gen.c (hsa_symbol::global_var_p): Remove.
(hsa_function_representation::~hsa_function_representation): Replace
the predicate with test of linkage.
* hsa.h (struct hsa_symbol): Remove declaration.
---
gcc/hsa-brig.c | 2 +-
gcc/hsa-gen.c | 8 +-------
gcc/hsa.h | 4 ----
3 files changed, 2 insertions(+), 12 deletions(-)
@@ -528,7 +528,7 @@ emit_directive_variable (struct hsa_symbol *symbol)
dirvar.dim.hi = (uint32_t) ((unsigned long long) symbol->m_dim >> 32);
/* Global variables are just declared and linked via HSA runtime. */
- if (!symbol->global_var_p ())
+ if (symbol->m_linkage != BRIG_ALLOCATION_PROGRAM)
dirvar.modifier.allBits |= BRIG_VARIABLE_DEFINITION;
dirvar.reserved = 0;
@@ -203,12 +203,6 @@ hsa_symbol::fillup_for_decl (tree decl)
m_seen_error = true;
}
-bool
-hsa_symbol::global_var_p ()
-{
- return m_decl && is_global_var (m_decl);
-}
-
/* Constructor of class representing global HSA function/kernel information and
state. FNDECL is function declaration, KERNEL_P is true if the function
is going to become a HSA kernel. If the function has body, SSA_NAMES_COUNT
@@ -250,7 +244,7 @@ hsa_function_representation::~hsa_function_representation ()
hsa_symbol *sym;
for (unsigned i = 0; i < m_global_symbols.iterate (i, &sym); i++)
- if (!sym->global_var_p ())
+ if (sym->m_linkage != BRIG_ALLOCATION_PROGRAM)
delete sym;
m_global_symbols.release ();
@@ -70,10 +70,6 @@ struct hsa_symbol
or a variable, local or global. */
void fillup_for_decl (tree decl);
- /* Return true if the symbol is a global variable that should be preserved
- after a function is emitted to BRIG. */
- bool global_var_p ();
-
/* Pointer to the original tree, which is PARM_DECL for input parameters and
RESULT_DECL for the output parameters. */
tree m_decl;
--
2.6.3