[PATCH] D117274: [NFC][msan] Reorder branches in complex if
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 13 23:55:49 PST 2022
vitalybuka updated this revision to Diff 399908.
vitalybuka added a comment.
update
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117274/new/
https://reviews.llvm.org/D117274
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
@@ -1706,21 +1706,13 @@
continue;
}
- bool FArgByVal = FArg.hasByValAttr();
- unsigned Size = FArgByVal
+ unsigned Size = FArg.hasByValAttr()
? DL.getTypeAllocSize(FArg.getParamByValType())
: DL.getTypeAllocSize(FArg.getType());
if (A == &FArg) {
bool Overflow = ArgOffset + Size > kParamTLSSize;
- bool FArgEagerCheck = MS.EagerChecks && !FArgByVal &&
- FArg.hasAttribute(Attribute::NoUndef);
-
- if (FArgEagerCheck) {
- *ShadowPtr = getCleanShadow(V);
- setOrigin(A, getCleanOrigin());
- break;
- } else if (FArgByVal) {
+ if (FArg.hasByValAttr()) {
// ByVal pointer itself has clean shadow. We copy the actual
// argument shadow to the underlying memory.
// Figure out maximal valid memcpy alignment.
@@ -1745,6 +1737,10 @@
(void)Cpy;
}
*ShadowPtr = getCleanShadow(V);
+ } else if (MS.EagerChecks && FArg.hasAttribute(Attribute::NoUndef)) {
+ *ShadowPtr = getCleanShadow(V);
+ setOrigin(A, getCleanOrigin());
+ break;
} else {
if (Overflow) {
// ParamTLS overflow.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117274.399908.patch
Type: text/x-patch
Size: 1603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220114/60d6b4c0/attachment-0001.bin>
More information about the llvm-commits
mailing list