[PATCH] D142982: [SanitizerBinaryMetadata] Pretend compiler-generated loads/stores are atomic

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 23:53:44 PST 2023


dvyukov added a comment.

TSan pass has these checks, probably can just copy-paste these:

    if (addrPointsToConstantData(Addr)) {
      // Addr points to some constant data -- it can not race with any writes.
      continue;
    }
  
  if (isa<AllocaInst>(getUnderlyingObject(Addr)) &&
      !PointerMayBeCaptured(Addr, true, true)) {
    // The variable is addressable but not captured, so it cannot be
    // referenced from a different thread and participate in a data race
    // (see llvm/Analysis/CaptureTracking.h for details).
    NumOmittedNonCaptured++;
    continue;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142982



More information about the llvm-commits mailing list