@@ -287,22 +287,20 @@ class DSEContext {
287
287
// / MemLocation read has been extracted, expanded and mapped to the bit
288
288
// / position in the bitvector. update the gen kill set using the bit
289
289
// / position.
290
- void updateGenKillSetForRead (SILInstruction *I, BBState *S, unsigned bit);
290
+ void updateGenKillSetForRead (BBState *S, unsigned bit);
291
291
292
292
// / MemLocation written has been extracted, expanded and mapped to the bit
293
293
// / position in the bitvector. update the gen kill set using the bit
294
294
// / position.
295
- void updateGenKillSetForWrite (SILInstruction *I, BBState *S, unsigned bit);
295
+ void updateGenKillSetForWrite (BBState *S, unsigned bit);
296
296
297
297
// / MemLocation read has been extracted, expanded and mapped to the bit
298
298
// / 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);
301
300
302
301
// / MemLocation written has been extracted, expanded and mapped to the bit
303
302
// / 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);
306
304
307
305
// / There is a read to a location, expand the location into individual fields
308
306
// / before processing them.
@@ -494,11 +492,9 @@ void DSEContext::invalidateMemLocationBase(SILInstruction *I,
494
492
}
495
493
}
496
494
497
- void DSEContext::updateWriteSetForRead (SILInstruction *I, BBState *S,
498
- unsigned bit) {
495
+ void DSEContext::updateWriteSetForRead (BBState *S, unsigned bit) {
499
496
// 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.
502
498
MemLocation &R = MemLocationVault[bit];
503
499
for (unsigned i = 0 ; i < S->MemLocationCount ; ++i) {
504
500
if (!S->isTrackingMemLocation (i))
@@ -507,13 +503,12 @@ void DSEContext::updateWriteSetForRead(SILInstruction *I, BBState *S,
507
503
if (!L.isMayAliasMemLocation (R, AA))
508
504
continue ;
509
505
DEBUG (llvm::dbgs () << " Loc Removal: " << MemLocationVault[i].getBase ()
510
- << " Instruction: " << *I << " \n " );
506
+ << " \n " );
511
507
S->stopTrackingMemLocation (i);
512
508
}
513
509
}
514
510
515
- void DSEContext::updateGenKillSetForRead (SILInstruction *I, BBState *S,
516
- unsigned bit) {
511
+ void DSEContext::updateGenKillSetForRead (BBState *S, unsigned bit) {
517
512
// Start tracking the read to this MemLocation in the killset and update
518
513
// the genset accordingly.
519
514
MemLocation &R = MemLocationVault[bit];
@@ -528,8 +523,7 @@ void DSEContext::updateGenKillSetForRead(SILInstruction *I, BBState *S,
528
523
}
529
524
}
530
525
531
- bool DSEContext::updateWriteSetForWrite (SILInstruction *I, BBState *S,
532
- unsigned bit) {
526
+ bool DSEContext::updateWriteSetForWrite (BBState *S, unsigned bit) {
533
527
// If a tracked store must aliases with this store, then this store is dead.
534
528
bool IsDead = false ;
535
529
MemLocation &R = MemLocationVault[bit];
@@ -548,13 +542,12 @@ bool DSEContext::updateWriteSetForWrite(SILInstruction *I, BBState *S,
548
542
549
543
// Track this new store.
550
544
DEBUG (llvm::dbgs () << " Loc Insertion: " << MemLocationVault[bit].getBase ()
551
- << " Instruction: " << *I << " \n " );
545
+ << " \n " );
552
546
S->startTrackingMemLocation (bit);
553
547
return IsDead;
554
548
}
555
549
556
- void DSEContext::updateGenKillSetForWrite (SILInstruction *I, BBState *S,
557
- unsigned bit) {
550
+ void DSEContext::updateGenKillSetForWrite (BBState *S, unsigned bit) {
558
551
// Start tracking the store to this MemLoation.
559
552
S->BBGenSet .set (bit);
560
553
}
@@ -598,13 +591,13 @@ void DSEContext::processRead(SILInstruction *I, BBState *S, SILValue Mem,
598
591
if (BuildGenKillSet) {
599
592
for (auto &E : Locs) {
600
593
// Only building the gen and kill sets for now.
601
- updateGenKillSetForRead (I, S, getMemLocationBit (E));
594
+ updateGenKillSetForRead (S, getMemLocationBit (E));
602
595
}
603
596
} else {
604
597
for (auto &E : Locs) {
605
598
// This is the last iteration, compute WriteSetOut and perform the dead
606
599
// store elimination.
607
- updateWriteSetForRead (I, S, getMemLocationBit (E));
600
+ updateWriteSetForRead (S, getMemLocationBit (E));
608
601
}
609
602
}
610
603
}
@@ -649,14 +642,14 @@ void DSEContext::processWrite(SILInstruction *I, BBState *S, SILValue Val,
649
642
if (BuildGenKillSet) {
650
643
for (auto &E : Locs) {
651
644
// Only building the gen and kill sets here.
652
- updateGenKillSetForWrite (I, S, getMemLocationBit (E));
645
+ updateGenKillSetForWrite (S, getMemLocationBit (E));
653
646
}
654
647
} else {
655
648
unsigned idx = 0 ;
656
649
for (auto &E : Locs) {
657
650
// This is the last iteration, compute WriteSetOut and perform the dead
658
651
// store elimination.
659
- if (updateWriteSetForWrite (I, S, getMemLocationBit (E)))
652
+ if (updateWriteSetForWrite (S, getMemLocationBit (E)))
660
653
V.set (idx);
661
654
Dead &= V.test (idx);
662
655
++idx;
0 commit comments