mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
`differentiability_function_extract` instruction has an optional explicit extractee type. This is currently used by TypeSubstCloner and the LoadableByAddress transform to rewrite `differentiability_function_extract` instructions while preserving `@differentiable` function type invariants. There is an assertion that `differentiability_function_extract` instructions do not have explicit extractee types outside of canonical/lowered SIL. However, this does not handle the SIL deserialization case above: when a function containing a `differentiable_function_extract` instruction with an explicit type is deserialized into a raw SIL module (which happens when optimizations are enabled). Removing the assertion unblocks this encountered use case. A more robust longer-term solution may be to change SIL `@differentiable` function types to explicitly store component original/JVP/VJP function types. Also fix `differentiable_function_extract` extractee type serialization. Resolves SR-14004.
63 KiB
63 KiB