@@ -422,7 +422,7 @@ class DSEContext {
422
422
// / Compute the genset and killset for the current basic block.
423
423
void processBasicBlockForGenKillSet (SILBasicBlock *BB);
424
424
425
- // / Compute the genset and killset for the current basic block.
425
+ // / Compute the max store set for the current basic block.
426
426
void processBasicBlockForMaxStoreSet (SILBasicBlock *BB);
427
427
428
428
// / Compute the WriteSetOut and WriteSetIn for the current basic
@@ -626,7 +626,6 @@ bool DSEContext::updateWriteSetForWrite(BlockState *S, unsigned bit) {
626
626
}
627
627
628
628
void DSEContext::updateGenKillSetForWrite (BlockState *S, unsigned bit) {
629
- // Start tracking the store to this MemLoation.
630
629
S->BBGenSet .set (bit);
631
630
}
632
631
@@ -667,9 +666,6 @@ void DSEContext::processRead(SILInstruction *I, BlockState *S, SILValue Mem,
667
666
}
668
667
#endif
669
668
670
- if (isComputeMaxStoreSet (Kind))
671
- return ;
672
-
673
669
// Expand the given Mem into individual fields and process them as
674
670
// separate reads.
675
671
LSLocationList Locs;
@@ -720,7 +716,7 @@ void DSEContext::processWrite(SILInstruction *I, BlockState *S, SILValue Val,
720
716
721
717
if (isComputeMaxStoreSet (Kind)) {
722
718
for (auto &E : Locs) {
723
- // Only building the gen and kill sets here .
719
+ // Update the max store set for the basic block .
724
720
updateMaxStoreSetForWrite (S, getLSLocationBit (E));
725
721
}
726
722
return ;
@@ -835,7 +831,7 @@ void DSEContext::processUnknownReadMemInst(SILInstruction *I,
835
831
if (isBuildingGenKillSet (Kind)) {
836
832
for (unsigned i = 0 ; i < S->LSLocationNum ; ++i) {
837
833
// If BBMaxStoreSet is not turned on, then there is no reason to turn
838
- // on the kill set nor the gen set for this store for this basic block.
834
+ // on the kill set nor the gen set for this location in this basic block.
839
835
// as there can NOT be a store that reaches the end of this basic block.
840
836
if (!S->BBMaxStoreSet .test (i))
841
837
continue ;
@@ -909,8 +905,9 @@ bool DSEContext::run() {
909
905
// Compute the max store set at the beginning of the basic block.
910
906
//
911
907
// This helps generating the genset and killset. If there is no way a
912
- // location can have an upward store at a particular point in the basic block,
913
- // we do not need to turn on the genset and killset for the location.
908
+ // location can have an upward visible store at a particular point in the
909
+ // basic block, we do not need to turn on the genset and killset for the
910
+ // location.
914
911
//
915
912
// Turning on the genset and killset can be costly as it involves querying
916
913
// the AA interface.
0 commit comments