@@ -198,6 +198,17 @@ class PrunedLiveBlocks {
198
198
assert (!discoveredBlocks || discoveredBlocks->empty ());
199
199
}
200
200
201
+ PrunedLiveBlocks (PrunedLiveBlocks const &other,
202
+ SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
203
+ : liveBlocks(other.liveBlocks.getFunction(), 2 ),
204
+ discoveredBlocks (discoveredBlocks) {
205
+ assert (!discoveredBlocks || other.discoveredBlocks );
206
+ for (auto &block : *other.liveBlocks .getFunction ()) {
207
+ liveBlocks.set (&block, other.liveBlocks .get (&block));
208
+ }
209
+ initializedFlag = other.initializedFlag ;
210
+ }
211
+
201
212
bool isInitialized () const { return initializedFlag; }
202
213
203
214
void initializeDiscoveredBlocks (
@@ -361,6 +372,10 @@ class PrunedLiveness {
361
372
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
362
373
: liveBlocks(function, discoveredBlocks) {}
363
374
375
+ PrunedLiveness (PrunedLiveness const &other,
376
+ SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
377
+ : liveBlocks(other.liveBlocks, discoveredBlocks), users(other.users) {}
378
+
364
379
bool isInitialized () const { return liveBlocks.isInitialized (); }
365
380
366
381
bool empty () const { return users.empty (); }
@@ -529,6 +544,10 @@ class PrunedLiveRange : public PrunedLiveness {
529
544
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
530
545
: PrunedLiveness(function, discoveredBlocks) {}
531
546
547
+ PrunedLiveRange (PrunedLiveRange const &other,
548
+ SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
549
+ : PrunedLiveness(other, discoveredBlocks) {}
550
+
532
551
LiveRangeSummary recursivelyUpdateForDef (SILValue initialDef,
533
552
ValueSet &visited,
534
553
SILValue value);
@@ -626,6 +645,14 @@ class SSAPrunedLiveness : public PrunedLiveRange<SSAPrunedLiveness> {
626
645
SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
627
646
: PrunedLiveRange(function, discoveredBlocks) {}
628
647
648
+ SSAPrunedLiveness (
649
+ SSAPrunedLiveness const &other,
650
+ SmallVectorImpl<SILBasicBlock *> *discoveredBlocks = nullptr )
651
+ : PrunedLiveRange(other, discoveredBlocks) {
652
+ def = other.def ;
653
+ defInst = other.defInst ;
654
+ }
655
+
629
656
SILValue getDef () const { return def; }
630
657
631
658
void initializeDef (SILValue def) {
0 commit comments