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.
Cherry-pick of https://github.com/apple/swift/pull/35239 during the holiday freeze.
differentiability_function_extract
instruction has an optional explicit extractee type. This is currently used by TypeSubstCloner and the LoadableByAddress transform to rewritedifferentiability_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 adifferentiable_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.
Resolves SR-14004.