Skip to content

Commit cb94f5f

Browse files
committed
Update some comments and remove dead code in dead store elimination
1 parent 4491d86 commit cb94f5f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

lib/SILOptimizer/Transforms/DeadStoreElimination.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class DSEContext {
422422
/// Compute the genset and killset for the current basic block.
423423
void processBasicBlockForGenKillSet(SILBasicBlock *BB);
424424

425-
/// Compute the genset and killset for the current basic block.
425+
/// Compute the max store set for the current basic block.
426426
void processBasicBlockForMaxStoreSet(SILBasicBlock *BB);
427427

428428
/// Compute the WriteSetOut and WriteSetIn for the current basic
@@ -626,7 +626,6 @@ bool DSEContext::updateWriteSetForWrite(BlockState *S, unsigned bit) {
626626
}
627627

628628
void DSEContext::updateGenKillSetForWrite(BlockState *S, unsigned bit) {
629-
// Start tracking the store to this MemLoation.
630629
S->BBGenSet.set(bit);
631630
}
632631

@@ -667,9 +666,6 @@ void DSEContext::processRead(SILInstruction *I, BlockState *S, SILValue Mem,
667666
}
668667
#endif
669668

670-
if (isComputeMaxStoreSet(Kind))
671-
return;
672-
673669
// Expand the given Mem into individual fields and process them as
674670
// separate reads.
675671
LSLocationList Locs;
@@ -720,7 +716,7 @@ void DSEContext::processWrite(SILInstruction *I, BlockState *S, SILValue Val,
720716

721717
if (isComputeMaxStoreSet(Kind)) {
722718
for (auto &E : Locs) {
723-
// Only building the gen and kill sets here.
719+
// Update the max store set for the basic block.
724720
updateMaxStoreSetForWrite(S, getLSLocationBit(E));
725721
}
726722
return;
@@ -835,7 +831,7 @@ void DSEContext::processUnknownReadMemInst(SILInstruction *I,
835831
if (isBuildingGenKillSet(Kind)) {
836832
for (unsigned i = 0; i < S->LSLocationNum; ++i) {
837833
// 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.
839835
// as there can NOT be a store that reaches the end of this basic block.
840836
if (!S->BBMaxStoreSet.test(i))
841837
continue;
@@ -909,8 +905,9 @@ bool DSEContext::run() {
909905
// Compute the max store set at the beginning of the basic block.
910906
//
911907
// 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.
914911
//
915912
// Turning on the genset and killset can be costly as it involves querying
916913
// the AA interface.

0 commit comments

Comments
 (0)