[PATCH] D83867: [TSan] Add option for emitting compound read-write instrumentation

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 10:11:41 PDT 2020


glider accepted this revision.
glider added inline comments.


================
Comment at: llvm/test/Instrumentation/ThreadSanitizer/read_before_write.ll:78
+; CHECK-COMPOUND-VOLATILE: __tsan_volatile_read
+; CHECK-COMPOUND: __tsan_read_write
+; CHECK-COMPOUND-VOLATILE: __tsan_volatile_write
----------------
melver wrote:
> glider wrote:
> > Don't we want to treat pairs of volatile loads and stores as separate accesses? E.g. a volatile load may be racing with a completely different store somewhere else.
> Yes. Note the difference between CHECK-COMPOUND and CHECK-COMPOUND-VOLATILE.
> 
> For the kernel we'll have the CHECK-COMPOUND-VOLATILE behaviour, i.e. -tsan-distinguish-volatile -tsan-compound-read-before-write is set. And it will treat them separately and not compound them.
> 
> If volatiles are not to be distinguished, it'll just compound them, i.e. revert to the standard behaviour (arguably also perfectly in line with the non-kernel standard, because racing volatiles are still a data race).
This is probably unrelated to this patch, but I suppose that even if -tsan-distinguish-volatile is disabled (i.e. we don't use special functions to instrument volatile accesses), we still must not combine them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83867/new/

https://reviews.llvm.org/D83867





More information about the llvm-commits mailing list