[PATCH] D150460: [gcov] Add nosanitize metadata to memory access instructions inserted by emitProfileNotes()

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 13:53:03 PDT 2023


MaskRay added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp:922
               Counters->getValueType(), Counters, 0, I);
           if (Options.Atomic) {
+            AtomicRMWInst *RMW = Builder.CreateAtomicRMW(
----------------
Enna1 wrote:
> nickdesaulniers wrote:
> > MaskRay wrote:
> > > Define `Instruction *Inst` outside before `if`. Call `Inst->setNoSanitizemetadata()` just once after `if`.
> > > 
> > > Add a comment `// Disable sanitizers to decrease size bloat. We don't expect sanitizers to catch interesting issues.`
> > It's either 1 or 2 instructions that need the metadata set.
> > 
> > The comment SGTM though that this is intentional/deliberate and not a bug.
> > Define `Instruction *Inst` outside before `if`. Call `Inst->setNoSanitizemetadata()` just once after `if`.
> 
> There are 2 instructions in `else` block, so I think can not call `Inst->setNoSanitizemetadata()` just once after `if`.
My idea is the factor out one instruction to apply `Inst->setNoSanitizemetadata()`. The else branch has one more instruction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150460



More information about the llvm-commits mailing list