[llvm] 6fc3171 - [msan] Relax handling of llvm.masked.expandload and llvm.masked.gather

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 10 12:23:00 PDT 2022


Author: Vitaly Buka
Date: 2022-09-10T12:19:16-07:00
New Revision: 6fc31712f1c3339cf3d48eb9d7b12c6c9ccc78ce

URL: https://github.com/llvm/llvm-project/commit/6fc31712f1c3339cf3d48eb9d7b12c6c9ccc78ce
DIFF: https://github.com/llvm/llvm-project/commit/6fc31712f1c3339cf3d48eb9d7b12c6c9ccc78ce.diff

LOG: [msan] Relax handling of llvm.masked.expandload and llvm.masked.gather

This is work around for new false positives. Real implementation will
follow.

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 8ab0296e7647f..3a804fbee0d22 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -3228,6 +3228,20 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
     insertShadowCheck(Shadow, Origin, &I);
   }
 
+  void handleMaskedExpandLoad(IntrinsicInst &I) {
+    // PassThru can be undef, so default visitInstruction is too strict.
+    // TODO: Provide real implementation.
+    setShadow(&I, getCleanShadow(&I));
+    setOrigin(&I, getCleanOrigin());
+  }
+
+  void handleMaskedGather(IntrinsicInst &I) {
+    // PassThru can be undef, so default visitInstruction is too strict.
+    // TODO: Provide real implementation.
+    setShadow(&I, getCleanShadow(&I));
+    setOrigin(&I, getCleanOrigin());
+  }
+
   void handleMaskedStore(IntrinsicInst &I) {
     IRBuilder<> IRB(&I);
     Value *V = I.getArgOperand(0);
@@ -3429,6 +3443,12 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
     case Intrinsic::bswap:
       handleBswap(I);
       break;
+    case Intrinsic::masked_expandload:
+      handleMaskedExpandLoad(I);
+      break;
+    case Intrinsic::masked_gather:
+      handleMaskedGather(I);
+      break;
     case Intrinsic::masked_store:
       handleMaskedStore(I);
       break;


        


More information about the llvm-commits mailing list