[PATCH] D85559: [MSAN] Reintroduce libatomic load/store instrumentation
    Evgenii Stepanov via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Aug  7 16:04:00 PDT 2020
    
    
  
eugenis added inline comments.
================
Comment at: clang/lib/CodeGen/CGAtomic.cpp:315
+  llvm::FunctionCallee fn =
+      CGF.CGM.CreateRuntimeFunction(fnTy, fnName, fnAttrs);
   auto callee = CGCallee::forDirect(fn);
----------------
This needs a clang test, and better move it to a separate change.
================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3509
+    Instruction *InsPoint = CB.getNextNode();
+    if (!InsPoint) {
+      llvm::errs() << "MSAN -- cannot instrument libatomic call with no "
----------------
Better explicitly check that this an invoke and not call. Call always has a next instruction.
And move this check to the parent function to apply  regular call instrumentation to the unrecognized call.
================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3511
+      llvm::errs() << "MSAN -- cannot instrument libatomic call with no "
+                      "successor. Ignoring!\n";
+      return;
----------------
It has a successor. Two successors, actually.
I'd rather say something like "invoke of __atomic_load".
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85559/new/
https://reviews.llvm.org/D85559
    
    
More information about the llvm-commits
mailing list