Skip to content

Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a' into tensorflow #28924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 209 commits into from
Dec 22, 2019

Conversation

dan-zheng
Copy link
Contributor

No description provided.

marcrasi and others added 30 commits October 3, 2019 10:37
is_pod is getting deprecated. All we really care about is that the type stay trivial. (And that's just a performance thing, I don't think we rely on that anywhere).
…lyDefinedIn

Combined with @available attribute, we could infer the OS versions that a particular
symbol doesn't exist in the current framework (LowLevel framework). For these OS versions,
we need to emit $ld$hide directives to avoid the LowLevel framework to be linked against.

Need this for rdar://55268186
…otocols

When Protocol P and Struct S are in a same module and S conforms to P, the protocol
witness table is emitted directly as a symbol. If we move P to a lower-level module,
the protocol witness table symbol isn't emitted, breaking users' existing executable as
a result.

This change checks whether the protocol used to be defined in the same
module and marks it as non-resilient if so. The compiler will continue
emitting witness table as symbols to maintain cross-module ABI stability.
…mbols.

When symbols are moved to this module, this module declares them as HIDE
for the OS versions prior to when the move happened. On the other hand, the
original module should declare ADD them for these OS versions. An executable
can choose the right library to link against depending on the deployment target.
This is a walk-around that linker directives cannot specify other install
name per symbol, we should eventually remove this.
Gives this functionality a more self-documenting interface.
Fixes SR-9207 / rdar://problem/45961622, SR-10478 / rdar://problem/49906841,
and rdar://problem/50665156.
Change the locator for the applicable fn
constraint for the inner subscript reference in an
implicit `outer[dynamicMember: \Inner.[0]]` expr
such that it uses the member locator with a
KeyPathDynamicMember element.

Then add a case to `getCalleeLocator` to handle
these locators. We also need to handle this
specially in `getArgumentInfoLocator` due to the
fact that the argument labels for the inner
subscript reference correspond to those written
by the user for the outer subscript reference.

Resolves SR-11933.
Resolves rdar://problem/57824025.
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).
This is primarily meant to used for testing LLDB's DWARFImporterDelegate,
however, this could become the default option for LLDB once
DWARFImporterDelegate is sufficiently mature.

<rdar://problem/57880844>
…ntain compatibility with existing code passing NSArrays into this function
Categorize three kinds of pointers:

NoPointer (don't create a node)

ReferenceOnly (safe to make normal assumptions)

AnyPointer (may have addresses, rawpointers, or any mix of thoses with references)

Flag ConnectionGraph nodes as
- hasReferenceOnly
- isInterior

An interior node always has an additional content node.

All sorts of arbitrary node merging is supported. Nodes with totally
different properties can be safely merged. Interior nodes can safely
be merged with their field content (which does happen surprisingly
often).

Alias analysis will use these flags to safely make assumptions about
properties of the connection graph.
…ent node only.

For alias analysis query to be generally correct, we need to
effectively merge the escape state and use points for everything in a
defer web.

It was unclear from the current design whether the "escaping" property
applied to the pointer value or its content. The implementation is
inconsistent in how it was treated. It appears that some bugs have
been worked around by propagating forward through defer edges, some
have been worked around by querying the content instead of the
pointer, and others have been worked around be creating fake use
points at block arguments.

If we always simply query the content for escape state and use points,
then we never need to propagate along defer edges. The current code
that propagates escape state along defer edges in one direction is
simply incorrect from the perspective of alias analysis.

One very attractive solution is to merge nodes eagerly without
creating any defer edges, but that would be a much more radical change
even than what I've done here. It would also pose some new issues: how
to resolve the current "node types" when merging and how to deal with
missing content nodes.

This solution of applying escape state to content nodes solves all
these problems without too radical of a change at the expense of
eagerly creating content nodes. (The potential graph memory usage is
not really an issue because it's possible to drastically shrink the
size of the graph anyway in a future commit--I've been able to fit a
node within one cache line). This solution nicely preserves graph
structure which makes it easy to debug and relate to the IR.

Eagerly creating content nodes also solves the missing content node
problem. For example, when querying canEscapeTo, we need to know
whether to look at the escape state for just the pointer value itself,
or also for its content. It may be possible the its content node is
actually part of the same object at the IR level. If the content node
is missing, then we don't know if the object's interior address is not
recognizable/representable or whether we simply never saw an access to
the interior address. We can't simply look at whether the current IR
value happens to be a reference, because that doesn't tell us whether
the graph node may have been merged with a non-reference node or even
with it's own content node. To be correct in general, this query would
need to be extremely conservative. However, if content nodes are
always created for references, then we only need to query the escape
state of a pointer's content node. The content node's flag tells us if
it's an interior node, in which case it will always point to another
content node which also needs to be queried.
slavapestov and others added 23 commits December 19, 2019 23:51
…unction

We need this to uphold the invariant that in the performance pipeline
before SIL serialization occurs, a function has ownership iff it is
transparent.
#28892)

Enable qualified declaration names in `@derivative` attribute, just like
`@transpose` attribute.

`DerivativeAttr` now stores a base type `TypeRepr *`, which is non-null for
parsed attributes that reference a qualified original declaration.

Add `TypeResolutionFlags::AllowModule` flag to enable module lookup via
`TypeChecker::lookupMember` given a `ModuleType`.

Add tests for type-qualified and module-qualified declaration names.

Resolves TF-1058.
Revert "[test] Mark _Differentiable tests as unsupported in Swift-in-the-OS configurations"
Fix build error introduced in #28892.

Caused by not re-running CI after #28879
was merged.
Fix various problems with top-level 'guard' statements and captures
Preparations for building curry thunks in Sema
Well, this does nothing. It just set the parser position twice and calls
the consumer's 'handleResults()' without any reason.
It seems it was intended to be a "fallback" completion, but it was never
implemented properly. So just remove it for now.

rdar://problem/58102910
Driver: mark test as XFAIL on windows
* [Typechecker] resolveAttributedType() should invalidate the type repr after emitting a diagnostic, to prevent duplicate diagnostics later

* [Test] Update '@NoEscape' attribute diagnostics

* [Typechecker] Add a special diagnose method to TypeResolver that accepts a TypeRepr and invalidates it

* [Typechecker] Rename the special 'diagnose' method to 'diagnoseInvalid' for clarity
[CodeCompletion] Eliminate CodeCompletionCallbacks::completeExpr()
Parameter evaluation order is unspecified, and MSVC happens to do it in
the opposite order than Clang.

Move the evaluation of the parameters outside the invocation, so the
order is clear, and the token consuming happens in the right order.
This was just to confirm that the re-entrancy problem still exists on
the bots.  There's something OS-dependent (probably the SDKs) that
causes this to only reproduce on 10.14.5 and not 10.15.

rdar://58116531
…order-evaluation

[MSVC] Evaluate parameters in the right order.
Remove re-entrancy assertion
[Driver, Incremental] Make dummy make-file dependencies path OK for Windows
Revert "Driver: mark test as XFAIL on windows"
Tag build swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a

Merge conflicts intentionally unresolved to faciliate reviewing.
@dan-zheng dan-zheng added the tensorflow This is for "tensorflow" branch PRs. label Dec 22, 2019
@dan-zheng
Copy link
Contributor Author

@swift-ci Please test tensorflow

@@ -1013,9 +1000,11 @@ void SwiftLangSupport::codeComplete(
auto options = provider->addFileSystem(FS);
vfsOptions.options =
llvm::make_unique<DirectlyPassedFileSystemProvider::Options>(options);
codeComplete(InputBuf, Offset, Consumer, Args, std::move(vfsOptions));
codeComplete(InputBuf, Offset, vfsOptions.options.get(), Consumer, Args,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#28727 (fast code completion within function bodies) adds a new OptionsDictionary * argument (third) to SwiftLangSupport::codeComplete.

@marcrasi: could you please review this merge fix for SwiftLangSupport::codeComplete?
I simply passed vfsOptions.options.get() as the new OptionsDictionary * argument, rather than adding/propagating a new OptionsDictionary * argument to SwiftLangSupport::codeComplete.

@dan-zheng
Copy link
Contributor Author

Extended test suite passes, and macOS toolchains have not regressed.
Merging now to downstream AutoDiff changes to tensorflow branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.