When the differentiating a function containing loops, we allocate a linear map context object on the heap. This context object may store non-trivial objects, such as closures, that need to be released explicitly. Fix the autodiff linear map context allocation builtins to correctly release such objects and not just free the memory they occupy.
The runtime support functions are currently vended by
swiftCore.{dll,dylib,so} rather than
swift_Differentiation.{dll,dylib,so}. This corrects the annotations to
indicate that reality. This never could have worked as declared in the
first place. swift_Differentiation never links against swiftRuntime
and swiftCore effectively whole-archives swiftRuntime into itself. This
change is now reflecting that reality. If the desire is to move this
(even on Darwin, where this may have already shipped and thus would
break ABI), we could split up the swiftRuntime into swiftRuntime and
swiftDifferentiationRuntime and link that as we do with the runtime into
swiftCore.
In derivatives of loops, no longer allocate boxes for indirect case payloads. Instead, use a custom pullback context in the runtime which contains a bump-pointer allocator.
When a function contains a differentiated loop, the closure context is a `Builtin.NativeObject`, which contains a `swift::AutoDiffLinearMapContext` and a tail-allocated top-level linear map struct (which represents the linear map struct that was previously directly partial-applied into the pullback). In branching trace enums, the payloads of previously indirect cases will be allocated by `swift::AutoDiffLinearMapContext::allocate` and stored as a `Builtin.RawPointer`.