Files
swift-mirror/lib/Serialization/ModuleFormat.h
Dan Zheng 126f1ac6fb [AutoDiff] Disable differentiable_function_extract explicit type as… (#35239)
`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.
2021-01-04 18:40:11 -05:00

63 KiB