[PATCH] D117277: [NFC][msan] Consolidate clean shadow handling
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 13 22:06:37 PST 2022
vitalybuka created this revision.
vitalybuka added reviewers: kda, eugenis.
Herald added a subscriber: hiraditya.
vitalybuka requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Depends on D117276 <https://reviews.llvm.org/D117276>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117277
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
@@ -1736,27 +1736,21 @@
LLVM_DEBUG(dbgs() << " ByValCpy: " << *Cpy << "\n");
(void)Cpy;
}
+ }
+
+ if (Overflow || FArg.hasByValAttr() ||
+ (MS.EagerChecks && FArg.hasAttribute(Attribute::NoUndef))) {
*ShadowPtr = getCleanShadow(V);
setOrigin(A, getCleanOrigin());
- } else if (MS.EagerChecks && FArg.hasAttribute(Attribute::NoUndef)) {
- *ShadowPtr = getCleanShadow(V);
- setOrigin(A, getCleanOrigin());
- break;
} else {
- if (Overflow) {
- // ParamTLS overflow.
- *ShadowPtr = getCleanShadow(V);
- setOrigin(A, getCleanOrigin());
- } else {
- // Shadow over TLS
- Value *Base = getShadowPtrForArgument(&FArg, EntryIRB, ArgOffset);
- *ShadowPtr = EntryIRB.CreateAlignedLoad(getShadowTy(&FArg), Base,
- kShadowTLSAlignment);
- if (MS.TrackOrigins) {
- Value *OriginPtr =
- getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
- setOrigin(A, EntryIRB.CreateLoad(MS.OriginTy, OriginPtr));
- }
+ // Shadow over TLS
+ Value *Base = getShadowPtrForArgument(&FArg, EntryIRB, ArgOffset);
+ *ShadowPtr = EntryIRB.CreateAlignedLoad(getShadowTy(&FArg), Base,
+ kShadowTLSAlignment);
+ if (MS.TrackOrigins) {
+ Value *OriginPtr =
+ getOriginPtrForArgument(&FArg, EntryIRB, ArgOffset);
+ setOrigin(A, EntryIRB.CreateLoad(MS.OriginTy, OriginPtr));
}
}
LLVM_DEBUG(dbgs()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117277.399892.patch
Type: text/x-patch
Size: 2063 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220114/78964045/attachment.bin>
More information about the llvm-commits
mailing list