From e3dac9e93fa5ce04f2be2900c352592940cdeee9 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Wed, 15 Mar 2023 10:15:17 -0700 Subject: [PATCH] [MSAN] Replace another open-coded convertToBool instance [nfc] Note that getCleanShadow always returns Constant::getNullValue so the prior code is equivalent to convertToBool. --- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index e4de395..75cb9e0 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2364,9 +2364,7 @@ struct MemorySanitizerVisitor : public InstVisitor { Constant *ConstOrigin = dyn_cast(OpOrigin); // No point in adding something that might result in 0 origin value. if (!ConstOrigin || !ConstOrigin->isNullValue()) { - Value *FlatShadow = MSV->convertShadowToScalar(OpShadow, IRB); - Value *Cond = - IRB.CreateICmpNE(FlatShadow, MSV->getCleanShadow(FlatShadow)); + Value *Cond = MSV->convertToBool(OpShadow, IRB); Origin = IRB.CreateSelect(Cond, OpOrigin, Origin); } } -- 2.7.4