From 5cea7320f5c6987a8fea77e2b8ee6e838fdba8b2 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 22 Oct 2024 13:29:02 -0700 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.4 --- .../Transforms/Instrumentation/MemorySanitizer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 9e174e2415e71..63810e875ae0a 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -2750,12 +2750,12 @@ struct MemorySanitizerVisitor : public InstVisitor { // its undefined bits. Let [b0, b1] be the interval of possible values of B. // Then (A cmp B) is defined iff (a0 cmp b1) == (a1 cmp b0). bool IsSigned = I.isSigned(); - Value *S1 = IRB.CreateICmp(I.getPredicate(), - getLowestPossibleValue(IRB, A, Sa, IsSigned), - getHighestPossibleValue(IRB, B, Sb, IsSigned)); - Value *S2 = IRB.CreateICmp(I.getPredicate(), - getHighestPossibleValue(IRB, A, Sa, IsSigned), - getLowestPossibleValue(IRB, B, Sb, IsSigned)); + Value *Amin = getLowestPossibleValue(IRB, A, Sa, IsSigned); + Value *Bmax = getHighestPossibleValue(IRB, B, Sb, IsSigned); + Value *S1 = IRB.CreateICmp(I.getPredicate(), Amin, Bmax); + Value *Amax = getHighestPossibleValue(IRB, A, Sa, IsSigned); + Value *Bmin = getLowestPossibleValue(IRB, B, Sb, IsSigned); + Value *S2 = IRB.CreateICmp(I.getPredicate(), Amax, Bmin); Value *Si = IRB.CreateXor(S1, S2); setShadow(&I, Si); setOriginForNaryOp(I);