@@ -32,7 +32,6 @@ class DominanceAnalysis;
3232// / This class is a simple wrapper around an identity cache.
3333class RCIdentityFunctionInfo {
3434 llvm::DenseSet<SILArgument *> VisitedArgs;
35- llvm::DenseMap<SILValue, SILValue> Cache;
3635 DominanceAnalysis *DA;
3736
3837 // / This number is arbitrary and conservative. At some point if compile time
@@ -51,16 +50,6 @@ class RCIdentityFunctionInfo {
5150 // / unchecked_trivial_bit_cast.
5251 void getRCUsers (SILValue V, llvm::SmallVectorImpl<SILInstruction *> &Users);
5352
54- void handleDeleteNotification (SILInstruction *I) {
55- // Check the cache. If we don't find it, there is nothing to do.
56- auto Iter = Cache.find (SILValue (I));
57- if (Iter == Cache.end ())
58- return ;
59-
60- // Then erase Iter from the cache.
61- Cache.erase (Iter);
62- }
63-
6453private:
6554 SILValue getRCIdentityRootInner (SILValue V, unsigned RecursionDepth);
6655 SILValue stripRCIdentityPreservingOps (SILValue V, unsigned RecursionDepth);
@@ -95,23 +84,6 @@ class RCIdentityAnalysis : public FunctionAnalysisBase<RCIdentityFunctionInfo> {
9584 return true ;
9685 }
9786
98- virtual void handleDeleteNotification (ValueBase *V) override {
99- auto *I = dyn_cast<SILInstruction>(V);
100- // We are only interesting in SILInstructions.
101- if (!I || !I->getParentBB ())
102- return ;
103-
104- // If the parent function of this instruction was just turned into an
105- // external declaration, bail. This happens during SILFunction destruction,
106- // when
107- SILFunction *F = I->getFunction ();
108- if (F->isExternalDeclaration ()) {
109- return ;
110- }
111- get (F)->handleDeleteNotification (I);
112- }
113-
114- virtual bool needsNotifications () override { return true ; }
11587 };
11688
11789} // end swift namespace
0 commit comments