The idea of the new annotation functions is to work very similar to AnnotateIgnoreWriteBegin/End.
The difference is, that the memory accesses should not be ignored but they should be treated like atomic accesses.
I want to use the new annotation to improve the modeling of OpenMP reduction semantics. With this patch, I can detect the data race between the increment of var by the master thread and the other threads performing the reduction.
Without this patch I miss the data race, because the current strategy for OpenMP reduction is to ignore the accesses performed by the OpenMP runtime library (see the changes in ompt-tsan.cpp).
The presence of the reduction does not introduce any synchronization other than ensuring that the consistently reduced result is available at the next synchronization point.
Does this patch make sense to you, or do you think it goes into a completely wrong direction?
I must admit that this patch as it is causes ~10% runtime increase for one of my benchmarks that doesn't even use this annotation. If the patch is in general ok, we can optimize the performance.
I can separate out the OpenMP specific changes into a separate patch.
clang-tidy: warning: invalid case style for parameter 'file' [readability-identifier-naming]
not useful
clang-tidy: warning: invalid case style for parameter 'line' [readability-identifier-naming]
not useful