Paul-Antoine Arras wrote:
When lowering reduction clauses, the compiler brackets the critical section
around the accumulation step with calls to GOMP_atomic_start and
GOMP_atomic_end. These are the same entry points used for `#pragma omp atomic'
constructs, so OMPT cannot distinguish reductions from user atomics.

Introduce dedicated GOMP_reduction_start and GOMP_reduction_end entry
points in libgomp. Update omp-low to emit calls to the new builtins
instead.

Also register the new builtins as memory barriers to avoid illegal optimisations
in later passes.

LGTM. However, can you also add a -fdump-tree-… test to check for GOMP_atomic_{start,end}?

I wonder whether we should also document the new function at https://gcc.gnu.org/onlinedocs/libgomp/The-libgomp-ABI.html (or just fix the atomic entry, cf. my previous email). In any case, this is by now that much out of date that just fixing the existing entries should be sufficient for now.

Tobias

Reply via email to