summaryrefslogtreecommitdiff
path: root/gcc/brig/brigfrontend/brig-branch-inst-handler.cc
diff options
context:
space:
mode:
authorPekka Jääskeläinen <pekka.jaaskelainen@parmance.com>2018-05-04 16:44:02 +0000
committerPekka Jääskeläinen <visit0r@gcc.gnu.org>2018-05-04 16:44:02 +0000
commit637f3cdec3168c4acf42b067cf511e0aecfcfcae (patch)
tree80d215262b7bd5f8483b0fb4fd5c18c1c691b01b /gcc/brig/brigfrontend/brig-branch-inst-handler.cc
parent1b40975c87503035f4a1647f959740369f9f3aed (diff)
downloadgcc-637f3cdec3168c4acf42b067cf511e0aecfcfcae.tar.gz
[BRIGFE] Enable whole program optimizations
HSA assumes all program scope HSAIL symbols can be queried from the host runtime API, thus cannot be removed by the IPA. Getting some inlining happening in the finalized binary required: * explicitly marking the 'prog' scope functions and the launcher function "externally_visible" to avoid the inliner removing it * also the host_def ptr is set to externally visible, otherwise IPA assumes it's never set * adding the 'inline' keyword to functions to enable inlining, otherwise GCC defaults to replaceable functions (one can link over the previous one) which cannot be inlined * replacing all calls to declarations with calls to definitions to enable the inliner to find the definition * to fix missing hidden argument types in the generated functions. These were ignored silently until GCC started to be able to inline calls to such functions. * do not gimplify before fixing the call targets. Otherwise the calls get detached and the definitions are not found. The reason why this happens is not clear, but gimplifying only after call target decl->def conversion fixes this. From-SVN: r259943
Diffstat (limited to 'gcc/brig/brigfrontend/brig-branch-inst-handler.cc')
-rw-r--r--gcc/brig/brigfrontend/brig-branch-inst-handler.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/brig/brigfrontend/brig-branch-inst-handler.cc b/gcc/brig/brigfrontend/brig-branch-inst-handler.cc
index a766a997200..1340b74dd35 100644
--- a/gcc/brig/brigfrontend/brig-branch-inst-handler.cc
+++ b/gcc/brig/brigfrontend/brig-branch-inst-handler.cc
@@ -150,6 +150,8 @@ brig_branch_inst_handler::operator () (const BrigBase *base)
}
m_parent.m_cf->m_called_functions.push_back (func_ref);
+ if (DECL_EXTERNAL (func_ref))
+ m_parent.add_decl_call (call);
return base->byteCount;
}