Skip to content

Commit 3b9945c

Browse files
committed
[RLE-DSE] Remove an unneeded parameter in DSE functions
1 parent ae478c0 commit 3b9945c

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

lib/SILPasses/Scalar/DeadStoreElimination.cpp

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,20 @@ class DSEContext {
287287
/// MemLocation read has been extracted, expanded and mapped to the bit
288288
/// position in the bitvector. update the gen kill set using the bit
289289
/// position.
290-
void updateGenKillSetForRead(SILInstruction *I, BBState *S, unsigned bit);
290+
void updateGenKillSetForRead(BBState *S, unsigned bit);
291291

292292
/// MemLocation written has been extracted, expanded and mapped to the bit
293293
/// position in the bitvector. update the gen kill set using the bit
294294
/// position.
295-
void updateGenKillSetForWrite(SILInstruction *I, BBState *S, unsigned bit);
295+
void updateGenKillSetForWrite(BBState *S, unsigned bit);
296296

297297
/// MemLocation read has been extracted, expanded and mapped to the bit
298298
/// position in the bitvector. process it using the bit position.
299-
void updateWriteSetForRead(SILInstruction *Inst, BBState *State,
300-
unsigned Bit);
299+
void updateWriteSetForRead(BBState *S, unsigned Bit);
301300

302301
/// MemLocation written has been extracted, expanded and mapped to the bit
303302
/// position in the bitvector. process it using the bit position.
304-
bool updateWriteSetForWrite(SILInstruction *Inst, BBState *State,
305-
unsigned Bit);
303+
bool updateWriteSetForWrite(BBState *S, unsigned Bit);
306304

307305
/// There is a read to a location, expand the location into individual fields
308306
/// before processing them.
@@ -494,11 +492,9 @@ void DSEContext::invalidateMemLocationBase(SILInstruction *I,
494492
}
495493
}
496494

497-
void DSEContext::updateWriteSetForRead(SILInstruction *I, BBState *S,
498-
unsigned bit) {
495+
void DSEContext::updateWriteSetForRead(BBState *S, unsigned bit) {
499496
// Remove any may/must-aliasing stores to the MemLocation, as they cant be
500-
// used
501-
// to kill any upward visible stores due to the intefering load.
497+
// used to kill any upward visible stores due to the intefering load.
502498
MemLocation &R = MemLocationVault[bit];
503499
for (unsigned i = 0; i < S->MemLocationCount; ++i) {
504500
if (!S->isTrackingMemLocation(i))
@@ -507,13 +503,12 @@ void DSEContext::updateWriteSetForRead(SILInstruction *I, BBState *S,
507503
if (!L.isMayAliasMemLocation(R, AA))
508504
continue;
509505
DEBUG(llvm::dbgs() << "Loc Removal: " << MemLocationVault[i].getBase()
510-
<< "Instruction: " << *I << "\n");
506+
<< "\n");
511507
S->stopTrackingMemLocation(i);
512508
}
513509
}
514510

515-
void DSEContext::updateGenKillSetForRead(SILInstruction *I, BBState *S,
516-
unsigned bit) {
511+
void DSEContext::updateGenKillSetForRead(BBState *S, unsigned bit) {
517512
// Start tracking the read to this MemLocation in the killset and update
518513
// the genset accordingly.
519514
MemLocation &R = MemLocationVault[bit];
@@ -528,8 +523,7 @@ void DSEContext::updateGenKillSetForRead(SILInstruction *I, BBState *S,
528523
}
529524
}
530525

531-
bool DSEContext::updateWriteSetForWrite(SILInstruction *I, BBState *S,
532-
unsigned bit) {
526+
bool DSEContext::updateWriteSetForWrite(BBState *S, unsigned bit) {
533527
// If a tracked store must aliases with this store, then this store is dead.
534528
bool IsDead = false;
535529
MemLocation &R = MemLocationVault[bit];
@@ -548,13 +542,12 @@ bool DSEContext::updateWriteSetForWrite(SILInstruction *I, BBState *S,
548542

549543
// Track this new store.
550544
DEBUG(llvm::dbgs() << "Loc Insertion: " << MemLocationVault[bit].getBase()
551-
<< "Instruction: " << *I << "\n");
545+
<< "\n");
552546
S->startTrackingMemLocation(bit);
553547
return IsDead;
554548
}
555549

556-
void DSEContext::updateGenKillSetForWrite(SILInstruction *I, BBState *S,
557-
unsigned bit) {
550+
void DSEContext::updateGenKillSetForWrite(BBState *S, unsigned bit) {
558551
// Start tracking the store to this MemLoation.
559552
S->BBGenSet.set(bit);
560553
}
@@ -598,13 +591,13 @@ void DSEContext::processRead(SILInstruction *I, BBState *S, SILValue Mem,
598591
if (BuildGenKillSet) {
599592
for (auto &E : Locs) {
600593
// Only building the gen and kill sets for now.
601-
updateGenKillSetForRead(I, S, getMemLocationBit(E));
594+
updateGenKillSetForRead(S, getMemLocationBit(E));
602595
}
603596
} else {
604597
for (auto &E : Locs) {
605598
// This is the last iteration, compute WriteSetOut and perform the dead
606599
// store elimination.
607-
updateWriteSetForRead(I, S, getMemLocationBit(E));
600+
updateWriteSetForRead(S, getMemLocationBit(E));
608601
}
609602
}
610603
}
@@ -649,14 +642,14 @@ void DSEContext::processWrite(SILInstruction *I, BBState *S, SILValue Val,
649642
if (BuildGenKillSet) {
650643
for (auto &E : Locs) {
651644
// Only building the gen and kill sets here.
652-
updateGenKillSetForWrite(I, S, getMemLocationBit(E));
645+
updateGenKillSetForWrite(S, getMemLocationBit(E));
653646
}
654647
} else {
655648
unsigned idx = 0;
656649
for (auto &E : Locs) {
657650
// This is the last iteration, compute WriteSetOut and perform the dead
658651
// store elimination.
659-
if (updateWriteSetForWrite(I, S, getMemLocationBit(E)))
652+
if (updateWriteSetForWrite(S, getMemLocationBit(E)))
660653
V.set(idx);
661654
Dead &= V.test(idx);
662655
++idx;

0 commit comments

Comments
 (0)