/* Gimple IR definitions.
- Copyright (C) 2007-2015 Free Software Foundation, Inc.
+ Copyright (C) 2007-2016 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>
This file is part of GCC.
GF_CALL_CTRL_ALTERING = 1 << 7,
GF_CALL_WITH_BOUNDS = 1 << 8,
GF_OMP_PARALLEL_COMBINED = 1 << 0,
- GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
+ GF_OMP_TASK_TASKLOOP = 1 << 0,
+ GF_OMP_FOR_KIND_MASK = (1 << 4) - 1,
GF_OMP_FOR_KIND_FOR = 0,
GF_OMP_FOR_KIND_DISTRIBUTE = 1,
- GF_OMP_FOR_KIND_CILKFOR = 2,
- GF_OMP_FOR_KIND_OACC_LOOP = 3,
+ GF_OMP_FOR_KIND_TASKLOOP = 2,
+ GF_OMP_FOR_KIND_CILKFOR = 3,
+ GF_OMP_FOR_KIND_OACC_LOOP = 4,
/* Flag for SIMD variants of OMP_FOR kinds. */
- GF_OMP_FOR_SIMD = 1 << 2,
+ GF_OMP_FOR_SIMD = 1 << 3,
GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0,
GF_OMP_FOR_KIND_CILKSIMD = GF_OMP_FOR_SIMD | 1,
- GF_OMP_FOR_COMBINED = 1 << 3,
- GF_OMP_FOR_COMBINED_INTO = 1 << 4,
- GF_OMP_TARGET_KIND_MASK = (1 << 3) - 1,
+ GF_OMP_FOR_COMBINED = 1 << 4,
+ GF_OMP_FOR_COMBINED_INTO = 1 << 5,
+ GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1,
GF_OMP_TARGET_KIND_REGION = 0,
GF_OMP_TARGET_KIND_DATA = 1,
GF_OMP_TARGET_KIND_UPDATE = 2,
- GF_OMP_TARGET_KIND_OACC_PARALLEL = 3,
- GF_OMP_TARGET_KIND_OACC_KERNELS = 4,
- GF_OMP_TARGET_KIND_OACC_DATA = 5,
- GF_OMP_TARGET_KIND_OACC_UPDATE = 6,
- GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 7,
+ GF_OMP_TARGET_KIND_ENTER_DATA = 3,
+ GF_OMP_TARGET_KIND_EXIT_DATA = 4,
+ GF_OMP_TARGET_KIND_OACC_PARALLEL = 5,
+ GF_OMP_TARGET_KIND_OACC_KERNELS = 6,
+ GF_OMP_TARGET_KIND_OACC_DATA = 7,
+ GF_OMP_TARGET_KIND_OACC_UPDATE = 8,
+ GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 9,
+ GF_OMP_TARGET_KIND_OACC_DECLARE = 10,
+ GF_OMP_TARGET_KIND_OACC_HOST_DATA = 11,
/* True on an GIMPLE_OMP_RETURN statement if the return does not require
a thread synchronization via some sort of barrier. The exact barrier
{
/* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ]
+ /* [ WORD 8 ] */
+ tree clauses;
+
+ /* [ WORD 9 ]
Critical section name. */
tree name;
};
tree control_use;
};
-/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
+/* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS, GIMPLE_OMP_ORDERED */
struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
gimple_statement_omp_single_layout : public gimple_statement_omp
stmt->code == GIMPLE_OMP_TEAMS. */
};
+struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
+ gomp_ordered : public gimple_statement_omp_single_layout
+{
+ /* No extra fields; adds invariant:
+ stmt->code == GIMPLE_OMP_ORDERED. */
+};
+
/* GIMPLE_OMP_ATOMIC_LOAD.
Note: This is based on gimple, not g_s_omp, because g_s_omp
/* [ WORD 10 ] */
gimple_seq body;
- /* [ WORD 11 ] */
- tree label;
+ /* [ WORD 11-13 ] */
+ tree label_norm;
+ tree label_uninst;
+ tree label_over;
};
#define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
return gs->code == GIMPLE_OMP_CRITICAL;
}
+template <>
+template <>
+inline bool
+is_a_helper <gomp_ordered *>::test (gimple *gs)
+{
+ return gs->code == GIMPLE_OMP_ORDERED;
+}
+
template <>
template <>
inline bool
return gs->code == GIMPLE_OMP_CRITICAL;
}
+template <>
+template <>
+inline bool
+is_a_helper <const gomp_ordered *>::test (const gimple *gs)
+{
+ return gs->code == GIMPLE_OMP_ORDERED;
+}
+
template <>
template <>
inline bool
gdebug *gimple_build_debug_source_bind_stat (tree, tree, gimple * MEM_STAT_DECL);
#define gimple_build_debug_source_bind(var,val,stmt) \
gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
-gomp_critical *gimple_build_omp_critical (gimple_seq, tree);
+gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
gimple *gimple_build_omp_master (gimple_seq);
gimple *gimple_build_omp_taskgroup (gimple_seq);
gomp_continue *gimple_build_omp_continue (tree, tree);
-gimple *gimple_build_omp_ordered (gimple_seq);
+gomp_ordered *gimple_build_omp_ordered (gimple_seq, tree);
gimple *gimple_build_omp_return (bool);
gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
gimple *gimple_build_omp_sections_switch (void);
gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree);
gomp_atomic_store *gimple_build_omp_atomic_store (tree);
-gtransaction *gimple_build_transaction (gimple_seq, tree);
+gtransaction *gimple_build_transaction (gimple_seq);
extern void gimple_seq_add_stmt (gimple_seq *, gimple *);
extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple *);
void gimple_seq_add_seq (gimple_seq *, gimple_seq);
extern alias_set_type gimple_get_alias_set (tree);
extern bool gimple_ior_addresses_taken (bitmap, gimple *);
extern bool gimple_builtin_call_types_compatible_p (const gimple *, tree);
+extern combined_fn gimple_call_combined_fn (const gimple *);
extern bool gimple_call_builtin_p (const gimple *);
extern bool gimple_call_builtin_p (const gimple *, enum built_in_class);
extern bool gimple_call_builtin_p (const gimple *, enum built_in_function);
extern bool gimple_asm_clobbers_memory_p (const gasm *);
extern void dump_decl_set (FILE *, bitmap);
extern bool nonfreeing_call_p (gimple *);
+extern bool nonbarrier_call_p (gimple *);
extern bool infer_nonnull_range (gimple *, tree);
extern bool infer_nonnull_range_by_dereference (gimple *, tree);
extern bool infer_nonnull_range_by_attribute (gimple *, tree);
static inline void
gimple_set_block (gimple *g, tree block)
{
- if (block)
- g->location =
- COMBINE_LOCATION_DATA (line_table, g->location, block);
- else
- g->location = LOCATION_LOCUS (g->location);
+ g->location = set_block (g->location, block);
}
return gimple_call_internal_fn (gc);
}
+/* Return true, if this internal gimple call is unique. */
+
+static inline bool
+gimple_call_internal_unique_p (const gcall *gs)
+{
+ return gimple_call_internal_fn (gs) == IFN_UNIQUE;
+}
+
+static inline bool
+gimple_call_internal_unique_p (const gimple *gs)
+{
+ const gcall *gc = GIMPLE_CHECK2<const gcall *> (gs);
+ return gimple_call_internal_unique_p (gc);
+}
+
/* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
that could alter control flow. */
}
-/* Return a pointer to the name associated with OMP critical statement GS. */
+/* Return a pointer to the name associated with OMP critical statement
+ CRIT_STMT. */
static inline tree *
gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
}
-/* Set NAME to be the name associated with OMP critical statement GS. */
+/* Set NAME to be the name associated with OMP critical statement
+ CRIT_STMT. */
static inline void
gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
}
+/* Return the clauses associated with OMP_CRITICAL statement CRIT_STMT. */
+
+static inline tree
+gimple_omp_critical_clauses (const gomp_critical *crit_stmt)
+{
+ return crit_stmt->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP critical statement
+ CRIT_STMT. */
+
+static inline tree *
+gimple_omp_critical_clauses_ptr (gomp_critical *crit_stmt)
+{
+ return &crit_stmt->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP critical statement
+ CRIT_STMT. */
+
+static inline void
+gimple_omp_critical_set_clauses (gomp_critical *crit_stmt, tree clauses)
+{
+ crit_stmt->clauses = clauses;
+}
+
+
+/* Return the clauses associated with OMP_ORDERED statement ORD_STMT. */
+
+static inline tree
+gimple_omp_ordered_clauses (const gomp_ordered *ord_stmt)
+{
+ return ord_stmt->clauses;
+}
+
+
+/* Return a pointer to the clauses associated with OMP ordered statement
+ ORD_STMT. */
+
+static inline tree *
+gimple_omp_ordered_clauses_ptr (gomp_ordered *ord_stmt)
+{
+ return &ord_stmt->clauses;
+}
+
+
+/* Set CLAUSES to be the clauses associated with OMP ordered statement
+ ORD_STMT. */
+
+static inline void
+gimple_omp_ordered_set_clauses (gomp_ordered *ord_stmt, tree clauses)
+{
+ ord_stmt->clauses = clauses;
+}
+
+
/* Return the kind of the OMP_FOR statemement G. */
static inline int
}
+/* Return true if OMP task statement G has the
+ GF_OMP_TASK_TASKLOOP flag set. */
+
+static inline bool
+gimple_omp_task_taskloop_p (const gimple *g)
+{
+ GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+ return (gimple_omp_subcode (g) & GF_OMP_TASK_TASKLOOP) != 0;
+}
+
+
+/* Set the GF_OMP_TASK_TASKLOOP field in G depending on the boolean
+ value of TASKLOOP_P. */
+
+static inline void
+gimple_omp_task_set_taskloop_p (gimple *g, bool taskloop_p)
+{
+ GIMPLE_CHECK (g, GIMPLE_OMP_TASK);
+ if (taskloop_p)
+ g->subcode |= GF_OMP_TASK_TASKLOOP;
+ else
+ g->subcode &= ~GF_OMP_TASK_TASKLOOP;
+}
+
+
/* Return the child function used to hold the body of OMP_TASK GS. */
static inline tree
static inline gimple_seq
gimple_transaction_body (gtransaction *transaction_stmt)
{
- return *gimple_transaction_body_ptr (transaction_stmt);
+ return transaction_stmt->body;
}
/* Return the label associated with a GIMPLE_TRANSACTION. */
static inline tree
-gimple_transaction_label (const gtransaction *transaction_stmt)
+gimple_transaction_label_norm (const gtransaction *transaction_stmt)
+{
+ return transaction_stmt->label_norm;
+}
+
+static inline tree *
+gimple_transaction_label_norm_ptr (gtransaction *transaction_stmt)
+{
+ return &transaction_stmt->label_norm;
+}
+
+static inline tree
+gimple_transaction_label_uninst (const gtransaction *transaction_stmt)
+{
+ return transaction_stmt->label_uninst;
+}
+
+static inline tree *
+gimple_transaction_label_uninst_ptr (gtransaction *transaction_stmt)
+{
+ return &transaction_stmt->label_uninst;
+}
+
+static inline tree
+gimple_transaction_label_over (const gtransaction *transaction_stmt)
{
- return transaction_stmt->label;
+ return transaction_stmt->label_over;
}
static inline tree *
-gimple_transaction_label_ptr (gtransaction *transaction_stmt)
+gimple_transaction_label_over_ptr (gtransaction *transaction_stmt)
{
- return &transaction_stmt->label;
+ return &transaction_stmt->label_over;
}
/* Return the subcode associated with a GIMPLE_TRANSACTION. */
/* Set the label associated with a GIMPLE_TRANSACTION. */
static inline void
-gimple_transaction_set_label (gtransaction *transaction_stmt, tree label)
+gimple_transaction_set_label_norm (gtransaction *transaction_stmt, tree label)
{
- transaction_stmt->label = label;
+ transaction_stmt->label_norm = label;
+}
+
+static inline void
+gimple_transaction_set_label_uninst (gtransaction *transaction_stmt, tree label)
+{
+ transaction_stmt->label_uninst = label;
+}
+
+static inline void
+gimple_transaction_set_label_over (gtransaction *transaction_stmt, tree label)
+{
+ transaction_stmt->label_over = label;
}
/* Set the subcode associated with a GIMPLE_TRANSACTION. */
transaction_stmt->subcode = subcode;
}
-
/* Return a pointer to the return value for GIMPLE_RETURN GS. */
static inline tree *
case GF_OMP_TARGET_KIND_OACC_DATA:
case GF_OMP_TARGET_KIND_OACC_UPDATE:
case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA:
+ case GF_OMP_TARGET_KIND_OACC_DECLARE:
+ case GF_OMP_TARGET_KIND_OACC_HOST_DATA:
return true;
default:
return false;