Commit Graph

5 Commits

Author SHA1 Message Date
Slava Pestov
b57be6dbf1 Revert "AutoDiff: Disable requirement machine when building or testing Differentiation library"
This reverts commit 4f6ba29715.
2021-09-23 13:24:40 -04:00
Slava Pestov
4f6ba29715 AutoDiff: Disable requirement machine when building or testing Differentiation library
The SIL type lowering logic for AutoDiff gets the substituted generic signature
mixed up with the invocation generic signature, so it tries to ask questions
about DependentMemberTypes in a signature with no requirements. This triggers
assertions when the requirement machine is enabled.

Disable the requirement machine until this is fixed.
2021-07-30 19:42:31 -04:00
Dan Zheng
bab23d8298 SILOptimizer: fix partial_apply optimization. (#31552)
`partial_apply` can be rewritten to `thin_to_thick_function` only if the
specialized callee is `@convention(thin)`.

This condition is newly exercised by the differentiation transform:
`{JVP,VJP}Emitter::visitApplyInst` generates argument-less `partial_apply`
with `@convention(method)` callees.

Resolves SR-12732.
2020-05-05 09:09:42 -07:00
Andrew Trick
2f1b21d64c Temporarily disable 3 AutoDiff tests: SR-12732
https://bugs.swift.org/browse/SR-12732
3 AutoDiff test failures: crashing in SIL verification

Failing Tests (3):
06:26:12     Swift(macosx-x86_64) :: AutoDiff/validation-test/derivative_registration.swift
06:26:12     Swift(macosx-x86_64) :: AutoDiff/validation-test/custom_derivatives.swift
06:26:12     Swift(macosx-x86_64) :: AutoDiff/stdlib/derivative_customization.swift

Possibly from:

commit 738ef730e8
Author: Dan Zheng <danielzheng@google.com>
Date:   Mon May 4 00:44:48 2020 -0700

    [AutoDiff] Fix `@differentiable` attribute derivative configurations. (#31524)
2020-05-04 14:34:51 -07:00
Dan Zheng
a864a57c9a [AutoDiff upstream] Add Differentiable.withDerivative(_:). (#30945)
Add `Differentiable.withDerivative(_:)`, a "derivative surgery" API.

`Differentiable.withDerivative(_:)` is an identity function returning `self`.
It takes a closure and applies it to the derivative of the return value, in
contexts where the return value is differentiated with respect to.
2020-04-10 12:22:56 -07:00