During gimplification omp_finish_clause langhook is called in several places to add the language specific info to the clause like what default/copy ctors, dtors and assignment operators should be used. Unfortunately, if it refers to some not yet instantiated method, during gimplification it is too late and the methods will not be instantiated anymore. For other cases, the genericizer has code to detect those and instantiate whatever is needed, this change adds the same for distribute parallel for class iterators where we under the hood need a copy constructor for the iterator to implement it. 2020-05-26 Jakub Jelinek <jakub@redhat.com> PR c++/95197 * gimplify.c (find_combined_omp_for): Move to omp-general.c. * omp-general.h (find_combined_omp_for): Declare. * omp-general.c: Include tree-iterator.h. (find_combined_omp_for): New function, moved from gimplify.c. * cp-gimplify.c: Include omp-general.h. (cp_genericize_r) <case OMP_DISTRIBUTE>: For class iteration variables in composite distribute parallel for, instantiate copy ctor of their types.
118 lines
4.3 KiB
C
118 lines
4.3 KiB
C
/* General types and functions that are uselful for processing of OpenMP,
|
|
OpenACC and similar directivers at various stages of compilation.
|
|
|
|
Copyright (C) 2005-2020 Free Software Foundation, Inc.
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 3, or (at your option) any later
|
|
version.
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GCC; see the file COPYING3. If not see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef GCC_OMP_GENERAL_H
|
|
#define GCC_OMP_GENERAL_H
|
|
|
|
#include "gomp-constants.h"
|
|
|
|
/* Flags for an OpenACC loop. */
|
|
|
|
enum oacc_loop_flags {
|
|
OLF_SEQ = 1u << 0, /* Explicitly sequential */
|
|
OLF_AUTO = 1u << 1, /* Compiler chooses axes. */
|
|
OLF_INDEPENDENT = 1u << 2, /* Iterations are known independent. */
|
|
OLF_GANG_STATIC = 1u << 3, /* Gang partitioning is static (has op). */
|
|
OLF_TILE = 1u << 4, /* Tiled loop. */
|
|
|
|
/* Explicitly specified loop axes. */
|
|
OLF_DIM_BASE = 5,
|
|
OLF_DIM_GANG = 1u << (OLF_DIM_BASE + GOMP_DIM_GANG),
|
|
OLF_DIM_WORKER = 1u << (OLF_DIM_BASE + GOMP_DIM_WORKER),
|
|
OLF_DIM_VECTOR = 1u << (OLF_DIM_BASE + GOMP_DIM_VECTOR),
|
|
|
|
OLF_MAX = OLF_DIM_BASE + GOMP_DIM_MAX
|
|
};
|
|
|
|
/* A structure holding the elements of:
|
|
for (V = N1; V cond N2; V += STEP) [...] */
|
|
|
|
struct omp_for_data_loop
|
|
{
|
|
tree v, n1, n2, step;
|
|
enum tree_code cond_code;
|
|
};
|
|
|
|
/* A structure describing the main elements of a parallel loop. */
|
|
|
|
struct omp_for_data
|
|
{
|
|
struct omp_for_data_loop loop;
|
|
tree chunk_size;
|
|
gomp_for *for_stmt;
|
|
tree pre, iter_type;
|
|
tree tiling; /* Tiling values (if non null). */
|
|
int collapse; /* Collapsed loops, 1 for a non-collapsed loop. */
|
|
int ordered;
|
|
bool have_nowait, have_ordered, simd_schedule, have_reductemp;
|
|
bool have_pointer_condtemp, have_scantemp, have_nonctrl_scantemp;
|
|
int lastprivate_conditional;
|
|
unsigned char sched_modifiers;
|
|
enum omp_clause_schedule_kind sched_kind;
|
|
struct omp_for_data_loop *loops;
|
|
};
|
|
|
|
#define OACC_FN_ATTRIB "oacc function"
|
|
|
|
extern tree omp_find_clause (tree clauses, enum omp_clause_code kind);
|
|
extern bool omp_is_allocatable_or_ptr (tree decl);
|
|
extern tree omp_check_optional_argument (tree decl, bool for_present_check);
|
|
extern bool omp_is_reference (tree decl);
|
|
extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code,
|
|
tree *n2, tree v, tree step);
|
|
extern tree omp_get_for_step_from_incr (location_t loc, tree incr);
|
|
extern void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
|
|
struct omp_for_data_loop *loops);
|
|
extern gimple *omp_build_barrier (tree lhs);
|
|
extern tree find_combined_omp_for (tree *, int *, void *);
|
|
extern poly_uint64 omp_max_vf (void);
|
|
extern int omp_max_simt_vf (void);
|
|
extern int omp_constructor_traits_to_codes (tree, enum tree_code *);
|
|
extern int omp_context_selector_matches (tree);
|
|
extern int omp_context_selector_set_compare (const char *, tree, tree);
|
|
extern tree omp_get_context_selector (tree, const char *, const char *);
|
|
extern tree omp_resolve_declare_variant (tree);
|
|
extern tree oacc_launch_pack (unsigned code, tree device, unsigned op);
|
|
extern tree oacc_replace_fn_attrib_attr (tree attribs, tree dims);
|
|
extern void oacc_replace_fn_attrib (tree fn, tree dims);
|
|
extern void oacc_set_fn_attrib (tree fn, tree clauses, vec<tree> *args);
|
|
extern int oacc_verify_routine_clauses (tree, tree *, location_t,
|
|
const char *);
|
|
extern tree oacc_build_routine_dims (tree clauses);
|
|
extern tree oacc_get_fn_attrib (tree fn);
|
|
extern bool offloading_function_p (tree fn);
|
|
extern int oacc_get_fn_dim_size (tree fn, int axis);
|
|
extern int oacc_get_ifn_dim_arg (const gimple *stmt);
|
|
|
|
enum omp_requires {
|
|
OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER = 0xf,
|
|
OMP_REQUIRES_UNIFIED_ADDRESS = 0x10,
|
|
OMP_REQUIRES_UNIFIED_SHARED_MEMORY = 0x20,
|
|
OMP_REQUIRES_DYNAMIC_ALLOCATORS = 0x40,
|
|
OMP_REQUIRES_REVERSE_OFFLOAD = 0x80,
|
|
OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER_USED = 0x100,
|
|
OMP_REQUIRES_TARGET_USED = 0x200
|
|
};
|
|
|
|
extern GTY(()) enum omp_requires omp_requires_mask;
|
|
|
|
#endif /* GCC_OMP_GENERAL_H */
|