[llvm] [msan] Fix "Add optional flag to improve instrumentation of disjoint OR (#145990)" (PR #146799)

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 17:00:57 PDT 2025


================
@@ -2525,11 +2525,10 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
 
     Value *S = IRB.CreateOr({S1S2, V1S2, S1V2});
     if (ClPreciseDisjointOr && cast<PossiblyDisjointInst>(&I)->isDisjoint()) {
-      // "V1" and "V2" were NOT'ed above, but we still want to reuse them
-      // because they were IntCast'ed to the same type as the shadows.
-      //
-      // (V1 & V2) == ~(~V1 | ~V2) (de Morgan)
-      Value *V1V2 = IRB.CreateNot(IRB.CreateOr(V1, V2));
+      // "V1" and "V2" were NOT'ed above
+      V1 = IRB.CreateIntCast(I.getOperand(0), S1->getType(), false);
----------------
thurstond wrote:

Renamed the earlier variables NotV1 / NotV2

https://github.com/llvm/llvm-project/pull/146799


More information about the llvm-commits mailing list