Commit 0ba886d
authored
[AutoDiff] Fix adjoint for
Since `move_value` is a destroying operation, the adjoint of `y = move_value x` should be `adj[x] += adj[y]; adj[y] = 0` instead of just `adj[x] += adj[y]`.move_value (swiftlang#78286)1 parent 26b2f7b commit 0ba886d
File tree
2 files changed
+41
-3
lines changed- lib/SILOptimizer/Differentiation
- test/AutoDiff/SILOptimizer
2 files changed
+41
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
| 1740 | + | |
1740 | 1741 | | |
1741 | 1742 | | |
1742 | 1743 | | |
1743 | 1744 | | |
1744 | 1745 | | |
1745 | 1746 | | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1746 | 1754 | | |
1747 | 1755 | | |
1748 | 1756 | | |
| |||
1768 | 1776 | | |
1769 | 1777 | | |
1770 | 1778 | | |
1771 | | - | |
1772 | | - | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
1773 | 1789 | | |
1774 | 1790 | | |
1775 | 1791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
0 commit comments