aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h81
1 files changed, 74 insertions, 7 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 7e3086f..da32651 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -682,11 +682,14 @@ struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
};
/* GIMPLE_OMP_TARGET */
-struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
+struct GTY((tag("GSS_OMP_TARGET")))
gomp_target : public gimple_statement_omp_parallel_layout
{
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_TARGET. */
+ /* [ WORD 1-10 ] : base class */
+
+ /* [ WORD 11 ]
+ Iterator loops. */
+ gimple_seq iterator_loops;
};
/* GIMPLE_OMP_TASK */
@@ -865,7 +868,7 @@ struct GTY((tag("GSS_ASSUME")))
tell the runtime that it should begin the transaction in
serial-irrevocable mode. */
#define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
-/* The transaction contains no instrumentation code whatsover, most
+/* The transaction contains no instrumentation code whatsoever, most
likely because it is guaranteed to go irrevocable upon entry. */
#define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
@@ -1607,7 +1610,7 @@ gomp_scan *gimple_build_omp_scan (gimple_seq, tree);
gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
gimple *gimple_build_omp_sections_switch (void);
gomp_single *gimple_build_omp_single (gimple_seq, tree);
-gomp_target *gimple_build_omp_target (gimple_seq, int, tree);
+gomp_target *gimple_build_omp_target (gimple_seq, int, tree, gimple_seq = NULL);
gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree,
enum omp_memory_order);
@@ -1667,7 +1670,8 @@ 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, tree * = NULL);
+extern bool infer_nonnull_range_by_attribute (gimple *, tree, tree * = NULL,
+ tree * = NULL);
extern void sort_case_labels (vec<tree> &);
extern void preprocess_case_label_vec_for_gimple (vec<tree> &, tree, tree *);
extern void gimple_seq_set_location (gimple_seq, location_t);
@@ -3561,7 +3565,7 @@ gimple_call_set_nothrow (gcall *s, bool nothrow_p)
/* Return true if S is a nothrow call. */
inline bool
-gimple_call_nothrow_p (gcall *s)
+gimple_call_nothrow_p (const gcall *s)
{
return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
}
@@ -3716,6 +3720,7 @@ gimple_cond_code (const gimple *gs)
inline void
gimple_cond_set_code (gcond *gs, enum tree_code code)
{
+ gcc_gimple_checking_assert (TREE_CODE_CLASS (code) == tcc_comparison);
gs->subcode = code;
}
@@ -3875,6 +3880,21 @@ gimple_cond_true_p (const gcond *gs)
return false;
}
+/* Check if conditional statement GS is in the caonical form of 'if (1 != 0)'. */
+
+inline bool
+gimple_cond_true_canonical_p (const gcond *gs)
+{
+ tree lhs = gimple_cond_lhs (gs);
+ tree rhs = gimple_cond_rhs (gs);
+ tree_code code = gimple_cond_code (gs);
+ if (code == NE_EXPR
+ && lhs == boolean_true_node
+ && rhs == boolean_false_node)
+ return true;
+ return false;
+}
+
/* Check if conditional statement GS is of the form 'if (1 != 1)',
'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
@@ -3900,6 +3920,21 @@ gimple_cond_false_p (const gcond *gs)
return false;
}
+/* Check if conditional statement GS is in the caonical form of 'if (0 != 0)'. */
+
+inline bool
+gimple_cond_false_canonical_p (const gcond *gs)
+{
+ tree lhs = gimple_cond_lhs (gs);
+ tree rhs = gimple_cond_rhs (gs);
+ tree_code code = gimple_cond_code (gs);
+ if (code == NE_EXPR
+ && lhs == boolean_false_node
+ && rhs == boolean_false_node)
+ return true;
+ return false;
+}
+
/* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
inline void
@@ -6348,6 +6383,38 @@ gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
}
+/* Return the Gimple sequence used to store loops for OpenMP iterators used
+ by OMP_TARGET_STMT. */
+
+inline gimple_seq
+gimple_omp_target_iterator_loops (const gomp_target *omp_target_stmt)
+{
+ return omp_target_stmt->iterator_loops;
+}
+
+
+/* Return a pointer to the Gimple sequence used to store loops for OpenMP
+ iterators used by OMP_TARGET GS. */
+
+inline gimple_seq *
+gimple_omp_target_iterator_loops_ptr (gimple *gs)
+{
+ gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
+ return &omp_target_stmt->iterator_loops;
+}
+
+
+/* Set ITERATOR_LOOPS to be the Gimple sequence used to store loops
+ constructed for OpenMP iterators in OMP_TARGET_STMT. */
+
+inline void
+gimple_omp_target_set_iterator_loops (gomp_target *omp_target_stmt,
+ gimple_seq iterator_loops)
+{
+ omp_target_stmt->iterator_loops = iterator_loops;
+}
+
+
/* Return the clauses associated with OMP_TEAMS GS. */
inline tree