[llvm] 4959708 - [NFC][msan] Consolidate clean shadow handling
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 14 17:06:45 PST 2022
Author: Vitaly Buka
Date: 2022-01-14T17:06:39-08:00
New Revision: 49597085022efca21caa7c8becbefe0a3436cf67
URL: https://github.com/llvm/llvm-project/commit/49597085022efca21caa7c8becbefe0a3436cf67
DIFF: https://github.com/llvm/llvm-project/commit/49597085022efca21caa7c8becbefe0a3436cf67.diff
LOG: [NFC][msan] Consolidate clean shadow handling
Depends on D117276
Reviewed By: kda, eugenis
Differential Revision: https://reviews.llvm.org/D117277
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 ef60fb74447d5..b0728df5ee5f1 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1736,27 +1736,21 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
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()
More information about the llvm-commits
mailing list