[PATCH] D68236: Handle llvm.launder.invariant.group in msan.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 13:16:03 PDT 2019


eugenis added a comment.

Thank you.
Do you mind handling llvm.strip.invariant.group in the same change?

I'm not sure if llvm.invariant.start and llvm.invariant.end need any handling. It kind of makes sense to ignore the shadow of their pointer arguments, since (a) it will be used in an actual load/store where uninit would be detected and (b) we don't want to raise an alarm in the case the intrinsic call is speculated.



================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:2567
+    IRBuilder<> IRB(&I);
+    setShadow(&I, IRB.CreateBitCast(getShadow(&I, 0), getShadowTy(&I)));
+    setOrigin(&I, getOrigin(&I, 0));
----------------
Why bitcast? From the intrinsic definition, the types must match.


================
Comment at: llvm/test/Instrumentation/MemorySanitizer/msan_llvm_launder_invariant.ll:26
+  ret %class.Foo* %retval.0
+}
+
----------------
The test could be a lot simpler, something like

i8* f(i8 *p) {
return @llvm.launder.invariant.group(p);
}



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

https://reviews.llvm.org/D68236





More information about the llvm-commits mailing list