@@ -513,12 +512,7 @@ cgraph_node::create (tree decl)
if ((flag_openacc || flag_openmp)
&& lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)))
- {
- node->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
- g->have_offload = true;
-#endif
- }
+ node->offloadable = 1;
node->register_symbol ();
@@ -2226,13 +2226,15 @@ ipa_passes (void)
if (!in_lto_p)
{
- if (g->have_offload)
+#ifdef ENABLE_OFFLOADING
+ if (flag_openacc || flag_openmp)
{
section_name_prefix = OFFLOAD_SECTION_NAME_PREFIX;
lto_stream_offload_p = true;
ipa_write_summaries ();
lto_stream_offload_p = false;
}
+#endif
if (flag_lto)
{
section_name_prefix = LTO_SECTION_NAME_PREFIX;
@@ -2323,9 +2325,11 @@ symbol_table::compile (void)
fprintf (stderr, "Performing interprocedural optimizations\n");
state = IPA;
+#ifdef ENABLE_OFFLOADING
/* Offloading requires LTO infrastructure. */
- if (!in_lto_p && g->have_offload)
+ if (!in_lto_p && (flag_openacc || flag_openmp))
flag_generate_offload = 1;
+#endif
/* If LTO is enabled, initialize the streamer hooks needed by GIMPLE. */
if (flag_generate_lto || flag_generate_offload)
@@ -29,8 +29,6 @@ gcc::context *g;
gcc::context::context ()
{
- have_offload = false;
-
/* The pass manager's constructor uses the dump manager (to set up
dumps for the various passes), so the dump manager must be set up
before the pass manager. */
@@ -34,9 +34,6 @@ public:
context ();
~context ();
- /* The flag shows if there are symbols to be streamed for offloading. */
- bool have_offload;
-
/* Pass-management. */
pass_manager *get_passes () { gcc_assert (m_passes); return m_passes; }
@@ -1122,8 +1122,10 @@ read_string (struct lto_input_block *ib)
void
output_offload_tables (void)
{
+#if 0
if (vec_safe_is_empty (offload_funcs) && vec_safe_is_empty (offload_vars))
return;
+#endif
struct lto_simple_output_block *ob
= lto_create_simple_output_block (LTO_section_offload_table);
@@ -2288,9 +2287,6 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
if (is_gimple_omp_offloaded (octx->stmt))
{
cgraph_node::get_create (decl)->offloadable = 1;
-#ifdef ENABLE_OFFLOADING
- g->have_offload = true;
-#endif
break;
}
}
@@ -149,7 +148,6 @@ make_offloadable_1 (varpool_node *node, tree decl ATTRIBUTE_UNUSED)
{
node->offloadable = 1;
#ifdef ENABLE_OFFLOADING
- g->have_offload = true;
if (!in_lto_p)
vec_safe_push (offload_vars, decl);
node->force_output = 1;