Files
Elsa Keirouz 2376affaab [LifetimeDependenceInsertion] look through _convertPointerToPointerArgument in value-form walker
An implicit pointer conversion, such as UnsafePointer<T> to UnsafeRawPointer,
does not change which lifetime the pointer depends on. Look through it to the
converted pointer, as is done when the conversion's result is written into a
temporary stack location (see the stack initializer case in LifetimeDependenceUseDefAddressWalker).
With opaque values, the conversion's result is an SSA value instead.
Without this case the result of the conversion would be treated as the root of the dependence.
The result is no longer an argument, resulting in an escaping dependence:
      error: lifetime-dependent value escapes its scope

Add regression test,
SILOptimizer/lifetime_dependence/lifetime_dependence_pointer_conversion.swift.

Resolves rdar://191292432.
2026-10-29 16:45:10 +00:00
..