Skip to content

Commit 3cb5f07

Browse files
authored
Merge pull request #29876 from gottesmm/pr-45a44022ce758198b24f6ffe93c2ff7e4b73271a
[gardening] Update a bit-rotted header.
2 parents aac282b + 3d88fa1 commit 3cb5f07

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

lib/SILOptimizer/Mandatory/SemanticARCOpts.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,20 +277,12 @@ bool IsAddressWrittenToDefUseAnalysis::isWrittenToHelper(SILValue initialValue)
277277

278278
namespace {
279279

280-
/// A two stage visitor that optimizes ownership instructions and eliminates any
281-
/// trivially dead code that results after optimization. The two stages are used
282-
/// to avoid iterator invalidation. Specifically:
283-
///
284-
/// 1. We first process the CFG instruction by instruction, only eliminating
285-
/// instructions that are guaranteed to be dominated by the visited
286-
/// instrution. While we do that, we add the operands of any instruction that we
287-
/// successfully optimize to the worklist. NOTE: We do not process arguments
288-
/// here to get SSA guarantees around dominance.
289-
///
290-
/// 2. Once we have processed the CFG and done some initial optimization, we
291-
/// enter phase 2 where we process the worklist. Here we are allowed to process
292-
/// arbitrary values and instructions, removing things that we are erasing from
293-
/// the worklist before we delete them.
280+
/// A visitor that optimizes ownership instructions and eliminates any trivially
281+
/// dead code that results after optimization. It uses an internal worklist that
282+
/// is initialized on construction with targets to avoid iterator invalidation
283+
/// issues. Rather than revisit the entire CFG like SILCombine and other
284+
/// visitors do, we maintain a visitedSinceLastMutation list to ensure that we
285+
/// revisit all interesting instructions in between mutations.
294286
struct SemanticARCOptVisitor
295287
: SILInstructionVisitor<SemanticARCOptVisitor, bool> {
296288
/// Our main worklist. We use this after an initial run through.

0 commit comments

Comments
 (0)