File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
lib/Transforms/Instrumentation
test/Instrumentation/MemorySanitizer Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -2525,11 +2525,10 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
25252525
25262526 Value *S = IRB.CreateOr ({S1S2, V1S2, S1V2});
25272527 if (ClPreciseDisjointOr && cast<PossiblyDisjointInst>(&I)->isDisjoint ()) {
2528- // "V1" and "V2" were NOT'ed above, but we still want to reuse them
2529- // because they were IntCast'ed to the same type as the shadows.
2530- //
2531- // (V1 & V2) == ~(~V1 | ~V2) (de Morgan)
2532- Value *V1V2 = IRB.CreateNot (IRB.CreateOr (V1, V2));
2528+ // "V1" and "V2" were NOT'ed above
2529+ V1 = IRB.CreateIntCast (I.getOperand (0 ), S1->getType (), false );
2530+ V2 = IRB.CreateIntCast (I.getOperand (1 ), S2->getType (), false );
2531+ Value *V1V2 = IRB.CreateAnd (V1, V2);
25332532 S = IRB.CreateOr ({S, V1V2});
25342533 }
25352534
Original file line number Diff line number Diff line change @@ -45,11 +45,10 @@ define i8 @test_disjoint_or(i8 %a, i8 %b) sanitize_memory {
4545; CHECK-IMPRECISE: [[C:%.*]] = or disjoint i8 [[A]], [[B]]
4646; CHECK-IMPRECISE-NEXT: store i8 [[TMP11]], ptr @__msan_retval_tls, align 8
4747;
48- ; CHECK-PRECISE: [[TMP10:%.*]] = or i8 [[TMP3]], [[TMP4]]
49- ; CHECK-PRECISE-NEXT: [[TMP11:%.*]] = xor i8 [[TMP10]], -1
50- ; CHECK-PRECISE-NEXT: [[TMP12:%.*]] = or i8 [[TMP9]], [[TMP11]]
48+ ; CHECK-PRECISE: [[TMP10:%.*]] = and i8 [[A]], [[B]]
49+ ; CHECK-PRECISE-NEXT: [[TMP11:%.*]] = or i8 [[TMP9]], [[TMP10]]
5150; CHECK-PRECISE-NEXT: [[C:%.*]] = or disjoint i8 [[A]], [[B]]
52- ; CHECK-PRECISE-NEXT: store i8 [[TMP12 ]], ptr @__msan_retval_tls, align 8
51+ ; CHECK-PRECISE-NEXT: store i8 [[TMP11 ]], ptr @__msan_retval_tls, align 8
5352;
5453; CHECK-NEXT: ret i8 [[C]]
5554;
You can’t perform that action at this time.
0 commit comments