Commit Graph

9 Commits

Author SHA1 Message Date
Becca Royal-Gordon
b6be85222f Standardize serialization of DeclNameRefs
There are four attributes which serialize out a DeclNameRef, sometimes by dropping some of its components. Standardize them with a representation that can handle module selectors.
2025-05-14 11:16:30 -07:00
Dan Zheng
bf47403162 [AutoDiff] Serialize and print @derivative and @transpose accessor kind. (#32839)
Serialize and print the optional accessor kind in `@derivative` and `@transpose`
attributes.

Resolves TF-1293.
2020-07-12 15:04:49 -07:00
Hamish Knight
b3dcef9796 Avoid unnecessary linking in SIL tools
Previously we were linking in all SIL entities
if the input was a serialized non-SIB AST, and
`-disable-sil-linking` wasn't specified. However
none of the tests appear to want this behaviour.

Stop calling `SerializedSILLoader::getAll`, and
remove the `-disable-sil-linking` option, as this
is now the default behaviour.
2020-07-01 23:14:01 -07:00
Dan Zheng
1308fc69c5 [AutoDiff] Simplify conditions enabling differentiable programming. (#30765)
Previously, two conditions were necessary to enable differentiable programming:
- Using the `-enable-experimental-differentiable-programming` frontend flag.
- Importing the `_Differentiation` module.

Importing the `_Differentiation` module is the true condition because it
contains the required compiler-known `Differentiable` protocol. The frontend
flag is redundant and cumbersome.

Now, the frontend flag is removed.
Importing `_Differentiation` is the only condition.
2020-04-02 03:24:03 -07:00
ematejska
9082dd48b3 [Autodiff upstream] Finishing @transpose attr serialization (#30683)
* Adding @transpose attr deserialization support

* Turning on the transpose serialization test
2020-03-27 16:20:48 -07:00
Dan Zheng
6dd557a557 [AutoDiff] NFC: garden tests. (#30588)
Add test/AutoDiff/lit.local.cfg: run tests only when `differentiable_programming`
is enabled in lit. With this, individual tests no longer need
`REQUIRES: differentiable_programming`.

Move multi-functionality SIL tests from test/AutoDiff/SIL/Serialization to
test/AutoDiff/SIL.

Garden test filenames.
2020-03-23 15:22:27 -07:00
Karoy Lorentey
f2ed81b763 Revert "[test] Mark _Differentiable tests as unsupported in Swift-in-the-OS configurations" 2019-12-19 19:16:00 -08:00
Karoy Lorentey
216d02f84d [test] Mark _Differentiable tests as unsupported in Swift-in-the-OS configuration
The new _Differentiable module is not available in any shipping OS release, but its public API currently doesn’t have availability, either.

Temporarily disable tests that import it when we’re testing with OS-provided libraries.

The typecheck test test/AutoDiff/stdlib/differentiable_protocol.swift imports _Differentable but still somehow succeeds in these configs, so leave that one enabled.

rdar://57975086
2019-12-19 12:53:23 -08:00
Dan Zheng
c842fee0a4 [AutoDiff upstream] Add @transpose(of:) attribute.
The `@transpose(of:)` attribute registers a function as a transpose of another
function. This patch adds the `@transpose(of:)` attribute definition, syntax,
parsing, and printing.

Resolves TF-827.

Todos:
- Type-checking (TF-830, TF-1060).
- Enable serialization (TF-838).
- Use module-qualified names instead of custom qualified name syntax/parsing
  (TF-1066).
2019-12-16 12:23:08 -08:00