@@ -529,6 +529,9 @@ void DSEContext::updateWriteSetForRead(BBState *S, unsigned bit) {
529
529
void DSEContext::updateGenKillSetForRead (BBState *S, unsigned bit) {
530
530
// Start tracking the read to this MemLocation in the killset and update
531
531
// the genset accordingly.
532
+ //
533
+ // Even though, MemLocations are canonicalized, we still need to consult
534
+ // alias analysis to determine whether 2 MemLocations are disjointed.
532
535
MemLocation &R = MemLocationVault[bit];
533
536
for (unsigned i = 0 ; i < S->MemLocationNum ; ++i) {
534
537
MemLocation &L = MemLocationVault[i];
@@ -594,13 +597,14 @@ void DSEContext::processRead(SILInstruction *I, BBState *S, SILValue Mem,
594
597
return ;
595
598
}
596
599
600
+ #ifndef NDEBUG
597
601
// Make sure that the MemLocation getType() returns the same type as the
598
602
// loaded type.
599
603
if (auto *LI = dyn_cast<LoadInst>(I)) {
600
- (void )LI;
601
604
assert (LI->getOperand ().getType ().getObjectType () == L.getType () &&
602
605
" MemLocation returns different type" );
603
606
}
607
+ #endif
604
608
605
609
// Expand the given Mem into individual fields and process them as
606
610
// separate reads.
@@ -643,13 +647,14 @@ void DSEContext::processWrite(SILInstruction *I, BBState *S, SILValue Val,
643
647
if (!L.isValid ())
644
648
return ;
645
649
650
+ #ifndef NDEBUG
646
651
// Make sure that the MemLocation getType() returns the same type as the
647
652
// stored type.
648
653
if (auto *SI = dyn_cast<StoreInst>(I)) {
649
- (void )SI;
650
654
assert (SI->getDest ().getType ().getObjectType () == L.getType () &&
651
655
" MemLocation returns different type" );
652
656
}
657
+ #endif
653
658
654
659
// Expand the given Mem into individual fields and process them as separate
655
660
// writes.
0 commit comments