[PATCH] D133678: [msan] Check mask and pointers shadow

Kevin Athey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 13:58:45 PDT 2022


kda added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3270
+
+    // TODO: Check loaded shadow.
+  }
----------------
"Store shadow"?


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3276-3277
+    Value *Ptrs = I.getArgOperand(0);
+    const Align Alignment(
+        cast<ConstantInt>(I.getArgOperand(1))->getZExtValue());
+    Value *Mask = I.getArgOperand(2);
----------------
What is this for?
It does not seem to be used.


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3298
+    Value *Ptrs = I.getArgOperand(1);
+    Value *Mask = I.getArgOperand(3);
+
----------------
not 2?


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3309
+
+    // TODO: Store shadow.
+  }
----------------
"Check Loaded shadow"?


================
Comment at: llvm/test/Instrumentation/MemorySanitizer/masked-store-load.ll:359-370
+; ADDR-NEXT:    [[TMP1:%.*]] = load i64, i64* getelementptr inbounds ([100 x i64], [100 x i64]* @__msan_param_tls, i32 0, i32 0), align 8
+; ADDR-NEXT:    [[TMP2:%.*]] = load <16 x i1>, <16 x i1>* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__msan_param_tls to i64), i64 8) to <16 x i1>*), align 8
 ; ADDR-NEXT:    call void @llvm.donothing()
+; ADDR-NEXT:    [[_MSCMP:%.*]] = icmp ne i64 [[TMP1]], 0
+; ADDR-NEXT:    [[TMP3:%.*]] = bitcast <16 x i1> [[TMP2]] to i16
+; ADDR-NEXT:    [[_MSCMP1:%.*]] = icmp ne i16 [[TMP3]], 0
+; ADDR-NEXT:    [[_MSOR:%.*]] = or i1 [[_MSCMP]], [[_MSCMP1]]
----------------
I thought this would have been swept into the implementation (as it was elsewhere).
What am I missing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133678



More information about the llvm-commits mailing list