Skip to content

Commit 8d01378

Browse files
authored
Merge pull request swiftlang#61257 from kavon/definiteinit-availability-flow
[DI] sink injectActorHops() after processing destroys
2 parents b44ee77 + 7719582 commit 8d01378

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,9 +1142,6 @@ void LifetimeChecker::doIt() {
11421142
// If we emitted an error, there is no reason to proceed with load promotion.
11431143
if (!EmittedErrorLocs.empty()) return;
11441144

1145-
// Insert hop_to_executor instructions for actor initializers, if needed.
1146-
injectActorHops();
1147-
11481145
// If the memory object has nontrivial type, then any destroy/release of the
11491146
// memory object will destruct the memory. If the memory (or some element
11501147
// thereof) is not initialized on some path, the bad things happen. Process
@@ -1155,6 +1152,15 @@ void LifetimeChecker::doIt() {
11551152
processNonTrivialRelease(i);
11561153
}
11571154

1155+
/// At this point, we should have computed enough liveness information to
1156+
/// provide accurate information about initialization points, even for
1157+
/// local variables within a function, because we've now processed the
1158+
/// destroy/releases.
1159+
1160+
// Insert hop_to_executor instructions for actor initializers, if needed.
1161+
injectActorHops();
1162+
1163+
11581164
// If the memory object had any non-trivial stores that are init or assign
11591165
// based on the control flow path reaching them, then insert dynamic control
11601166
// logic and CFG diamonds to handle this.

0 commit comments

Comments
 (0)