DEF_GOMP_BUILTIN (BUILT_IN_GOMP_HAS_MASKED_THREAD_NUM,
"GOMP_has_masked_thread_num", BT_FN_BOOL_INT,
ATTR_CONST_NOTHROW_LEAF_LIST)
+DEF_GOMP_BUILTIN (BUILT_IN_GOMP_HAS_MASKED_THREAD_NUM_WITH_END,
+ "GOMP_has_masked_thread_num_with_end", BT_FN_BOOL_INT,
+ ATTR_CONST_NOTHROW_LEAF_LIST)
DEF_GOMP_BUILTIN (BUILT_IN_GOMP_MASKED_END, "GOMP_masked_end", BT_FN_VOID,
ATTR_NOTHROW_LEAF_LIST)
/* TODO review these function attributes once OMPT implementation done */
gsi_replace (gsi_p, bind, true);
gimple_bind_add_stmt (bind, stmt);
- bfn_decl = builtin_decl_explicit (BUILT_IN_GOMP_HAS_MASKED_THREAD_NUM);
+ bfn_decl = builtin_decl_explicit (
+ flag_openmp_ompt ? BUILT_IN_GOMP_HAS_MASKED_THREAD_NUM_WITH_END
+ : BUILT_IN_GOMP_HAS_MASKED_THREAD_NUM);
x = build_call_expr_loc (loc, bfn_decl, 1, filter);
x = build3 (COND_EXPR, void_type_node, x, NULL, build_and_jump (&lab));
tseq = NULL;
}
/* { dg-final { scan-tree-dump "GOMP_has_masked_thread_num" "omplower" } } */
+/* { dg-final { scan-tree-dump-not "GOMP_has_masked_thread_num_with_end" "omplower" } } */
/* { dg-final { scan-tree-dump-not "GOMP_masked_end" "omplower" } } */
/* { dg-final { scan-tree-dump-not "omp_get_thread_num" "omplower" } } */
/* { dg-do compile } */
/* { dg-additional-options "-fopenmp-ompt -fdump-tree-omplower" } */
+/* Check that OMPT variants of libgomp calls are emitted. */
+
void bar (void);
void
bar ();
}
-/* { dg-final { scan-tree-dump-times "GOMP_has_masked_thread_num" 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "GOMP_has_masked_thread_num_with_end" 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "GOMP_masked_end" 1 "omplower" } } */
/* { dg-final { scan-tree-dump-not "omp_get_thread_num" "omplower" } } */
GOMP_6.0.2 {
global:
GOMP_has_masked_thread_num;
+ GOMP_has_masked_thread_num_with_end;
GOMP_masked_end;
GOMP_loop_static_worksharing;
GOMP_loop_static_worksharing_start;
@code{GOMP_has_masked_thread_num} encapsulates the following check, so that OMPT
can distinguish the compiler-generated code from user-level thread-number
-queries:
+queries; with @option{-fopenmp-ompt}, a paired call to
+@code{GOMP_has_masked_thread_num_with_end} and @code{GOMP_masked_end} is
+generated instead.
@smallexample
omp_get_thread_num() == @var{thread_num}
extern bool GOMP_cancel (int, bool);
extern bool GOMP_cancellation_point (int);
extern bool GOMP_has_masked_thread_num (int);
+extern bool GOMP_has_masked_thread_num_with_end (int);
extern void GOMP_masked_end (void);
/* task.c */
return tid == gomp_thread ()->ts.team_id;
}
+/* OMPT variant enabled by -fopenmp-ompt. */
+
+bool
+GOMP_has_masked_thread_num_with_end (int tid)
+{
+ return tid == gomp_thread ()->ts.team_id;
+}
+
/* Stub for OMPT callback enabled by -fopenmp-ompt. */
void