[PATCH] D134698: [WIP][msan] Use !noundef of load instruction
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 15 13:02:02 PDT 2022
vitalybuka updated this revision to Diff 468031.
vitalybuka added a comment.
fixes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134698/new/
https://reviews.llvm.org/D134698
Files:
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -2135,10 +2135,19 @@
Value *ShadowPtr = nullptr, *OriginPtr = nullptr;
const Align Alignment = I.getAlign();
if (PropagateShadow) {
- std::tie(ShadowPtr, OriginPtr) =
+ if (I.getMetadata(LLVMContext::MD_noundef)) {
+ IRBuilder<> IRB2(&I);
+ std::tie(ShadowPtr, OriginPtr) =
+ getShadowOriginPtr(Addr, IRB2, ShadowTy, Alignment, /*isStore*/ false);
+ insertShadowCheck(
+ IRB2.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"), OriginPtr, &I);
+ setShadow(&I, getCleanShadow(&I));
+ } else {
+ std::tie(ShadowPtr, OriginPtr) =
getShadowOriginPtr(Addr, IRB, ShadowTy, Alignment, /*isStore*/ false);
- setShadow(&I,
- IRB.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"));
+ setShadow(
+ &I, IRB.CreateAlignedLoad(ShadowTy, ShadowPtr, Alignment, "_msld"));
+ }
} else {
setShadow(&I, getCleanShadow(&I));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134698.468031.patch
Type: text/x-patch
Size: 1233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221015/444826b2/attachment.bin>
More information about the llvm-commits
mailing list