File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -180,9 +180,16 @@ class PrunedLiveBlocks {
180
180
protected:
181
181
void markBlockLive (SILBasicBlock *bb, IsLive isLive) {
182
182
assert (isLive != Dead && " erasing live blocks isn't implemented." );
183
- liveBlocks[bb] = (isLive == LiveOut);
184
- if (discoveredBlocks)
185
- discoveredBlocks->push_back (bb);
183
+ bool isLiveOut = (isLive == LiveOut);
184
+ auto iterAndInserted =
185
+ liveBlocks.insert (std::make_pair (bb, isLiveOut));
186
+ if (iterAndInserted.second ) {
187
+ if (discoveredBlocks)
188
+ discoveredBlocks->push_back (bb);
189
+ } else if (isLiveOut) {
190
+ // Update the existing entry to be live-out.
191
+ iterAndInserted.first ->getSecond () = true ;
192
+ }
186
193
}
187
194
188
195
void computeUseBlockLiveness (SILBasicBlock *userBB);
You can’t perform that action at this time.
0 commit comments