From a98ac8ea554823c05f89c72fcfc7caa691cf1fa7 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Tue, 14 Mar 2023 13:18:05 -0700 Subject: [PATCH] [MSAN] Minor refactor to reduce future diff [nfc] --- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index bfc0a2b..472df13 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1546,8 +1546,7 @@ struct MemorySanitizerVisitor : public InstVisitor { for (unsigned Idx = 0; Idx < Struct->getNumElements(); Idx++) { // Combine by ORing together each element's bool shadow Value *ShadowItem = IRB.CreateExtractValue(Shadow, Idx); - Value *ShadowInner = convertShadowToScalar(ShadowItem, IRB); - Value *ShadowBool = convertToBool(ShadowInner, IRB); + Value *ShadowBool = convertToBool(ShadowItem, IRB); if (Aggregator != FalseVal) Aggregator = IRB.CreateOr(Aggregator, ShadowBool); @@ -3525,8 +3524,7 @@ struct MemorySanitizerVisitor : public InstVisitor { Value *MaskedPassThruShadow = IRB.CreateAnd( getShadow(PassThru), IRB.CreateSExt(IRB.CreateNeg(Mask), ShadowTy)); - Value *ConvertedShadow = convertShadowToScalar(MaskedPassThruShadow, IRB); - Value *NotNull = convertToBool(ConvertedShadow, IRB, "_mscmp"); + Value *NotNull = convertToBool(MaskedPassThruShadow, IRB, "_mscmp"); Value *PtrOrigin = IRB.CreateLoad(MS.OriginTy, OriginPtr); Value *Origin = IRB.CreateSelect(NotNull, getOrigin(PassThru), PtrOrigin); -- 2.7.4