forked from OSchip/llvm-project
[OpenMP] allow loc to be NULL in __kmp_determine_reduction_method for MSVC
MSVC may not supply source location information to kmpc_reduce passing NULL for the value. The patch adds a check for the loc value being NULL in kmp_determine_reduction_method. Differential Revision: https://reviews.llvm.org/D126564
This commit is contained in:
parent
210c851327
commit
f58fe2e186
|
@ -2222,11 +2222,11 @@ int __kmp_fork_call(ident_t *loc, int gtid,
|
|||
} else
|
||||
// only one notification scheme (either "submit" or "forking/joined", not both)
|
||||
#endif /* USE_ITT_NOTIFY */
|
||||
if ((__itt_frame_begin_v3_ptr || KMP_ITT_DEBUG) &&
|
||||
__kmp_forkjoin_frames && !__kmp_forkjoin_frames_mode) {
|
||||
// Mark start of "parallel" region for Intel(R) VTune(TM) analyzer.
|
||||
__kmp_itt_region_forking(gtid, team->t.t_nproc, 0);
|
||||
}
|
||||
if ((__itt_frame_begin_v3_ptr || KMP_ITT_DEBUG) &&
|
||||
__kmp_forkjoin_frames && !__kmp_forkjoin_frames_mode) {
|
||||
// Mark start of "parallel" region for Intel(R) VTune(TM) analyzer.
|
||||
__kmp_itt_region_forking(gtid, team->t.t_nproc, 0);
|
||||
}
|
||||
}
|
||||
#endif /* USE_ITT_BUILD */
|
||||
|
||||
|
@ -3276,7 +3276,7 @@ static void __kmp_initialize_root(kmp_root_t *root) {
|
|||
__kmp_nested_proc_bind.bind_types[0], &r_icvs,
|
||||
0 // argc
|
||||
USE_NESTED_HOT_ARG(NULL) // primary thread is unknown
|
||||
);
|
||||
);
|
||||
#if USE_DEBUGGER
|
||||
// Non-NULL value should be assigned to make the debugger display the root
|
||||
// team.
|
||||
|
@ -3313,7 +3313,7 @@ static void __kmp_initialize_root(kmp_root_t *root) {
|
|||
__kmp_nested_proc_bind.bind_types[0], &r_icvs,
|
||||
0 // argc
|
||||
USE_NESTED_HOT_ARG(NULL) // primary thread is unknown
|
||||
);
|
||||
);
|
||||
KF_TRACE(10, ("__kmp_initialize_root: after hot_team = %p\n", hot_team));
|
||||
|
||||
root->r.r_hot_team = hot_team;
|
||||
|
@ -8707,7 +8707,8 @@ __kmp_determine_reduction_method(
|
|||
KMP_DEBUG_ASSERT(lck); // it would be nice to test ( lck != 0 )
|
||||
|
||||
#define FAST_REDUCTION_ATOMIC_METHOD_GENERATED \
|
||||
((loc->flags & (KMP_IDENT_ATOMIC_REDUCE)) == (KMP_IDENT_ATOMIC_REDUCE))
|
||||
(loc && \
|
||||
((loc->flags & (KMP_IDENT_ATOMIC_REDUCE)) == (KMP_IDENT_ATOMIC_REDUCE)))
|
||||
#define FAST_REDUCTION_TREE_METHOD_GENERATED ((reduce_data) && (reduce_func))
|
||||
|
||||
retval = critical_reduce_block;
|
||||
|
|
Loading…
Reference in New Issue