mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
It hoists `destroy_value` instructions without shrinking an object's lifetime. This is done if it can be proved that another copy of a value (either in an SSA value or in memory) keeps the referenced object(s) alive until the original position of the `destroy_value`. ``` %1 = copy_value %0 ... last_use_of %0 // other instructions destroy_value %0 // %1 is still alive here ``` -> ``` %1 = copy_value %0 ... last_use_of %0 destroy_value %0 // other instructions ``` The benefit of this optimization is that it can enable copy-propagation by moving destroys above deinit barries and access scopes.
11 KiB
11 KiB