swift
2cf7d63a - [AutoDiff] Fix ownership error in `VJPCloner::visitApplyInst`. (#35003)

Commit
5 years ago
[AutoDiff] Fix ownership error in `VJPCloner::visitApplyInst`. (#35003) Change the following code pattern: ``` %x1 = convert_function %x0 : $@differentiable (...) -> ... %x2 = begin_borrow %x1 ... // use %x2 %x3 = end_borrow %x2 destroy_value %x0 ``` To the following: ``` %x1 = begin_borrow %x0 : $@differentiable (...) -> ... %x2 = convert_function %x0 ... // use %x2 %x3 = end_borrow %x1 destroy_value %x0 ``` Resolves SR-13933: "multiple consuming users" ownership error caused by `VJPCloner::visitApply` related to `@differentiable`-function-typed callees. Also upstream test/AutoDiff/SILOptimizer/generics.swift from tensorflow branch.
Author
Parents
Loading