Skip to content

merge 'swift-DEVELOPMENT-SNAPSHOT-2019-05-26-a' into 'tensorflow' #25110

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 207 commits into from
May 29, 2019

Conversation

marcrasi
Copy link

Very few conflicts that I had to resolve manually:

  • They moved Serializer::writeDeclAttribute from one place in Serialization/Serialization.cpp to another place. We had added cases for differentiable and differentiating attribute. So I moved our cases into the new location.
  • They changed Serializer::writeType from a big switch into a visitor. We had made some modifications to some of the cases. So I ported our modifications to the visitor.

DavidGoldman and others added 30 commits April 18, 2019 11:25
Previously, requests would fail silently by returning an empty struct
in the response.

With this change, responses will properly report fail with the internal
error.
Previously, requests would fail silently by returning an empty struct
in the response.

With this change, responses will properly report fail with the internal
error.
In the Android paths of the spawnChild function, the parent was creating
a pipe that was never closed, which led to FD starvation. In some tests
with a lots of expected crashes, the childs will not spawn anymore since
the linker would not have enough descriptors to open the shared
libraries, while in other tests which closed the child descriptors as
part of the last test, the parent process will hang waiting those
descriptors to be closed, which will never had happened.

The solution is implement the missing parts of the code, which tried to
read from the pipe in the parent side (using select and read, taking
pieces from other parts of the code). This should match the fork/execv
path used by Android and Haiku to the spawn code used by the rest of the
platforms.

This change fixes StdlibUnittest/Stdin.swift,
stdlib/InputStream.swift.gyb,
stdlib/Collection/FlattenCollection.swift.gyb and
stdlib/Collection/LazyFilterCollection.swift.gyb, which were the last 4
tests failing in Android AArch64.
Some of the tests in KVOKeyPaths.swift check problems that were not fixed
until Swift 5.1 so they are not expected to pass when running with the
5.0 libraries.

rdar://problem/50173830
The change replaces 'set bit enumeration' with arithmetic
and bitwise operations. For example, the formula
'(((x & -x) + x) & x) ^ x' can be used to find the rightmost
contiguous bit mask. This is essentially the operation that
SetBitEnumerator.findNext() performed.

Removing this functionality reduces the complexity of the
ClusteredBitVector (a.k.a. SpareBitVector) implementation and,
more importantly, API which will make it easier to modify
the implementation of spare bit masks going forward. My end
goal being to make spare bit operations work more reliably on
big endian systems.

Side note:

This change modifies the emit gather/scatter functions so that
they work with an APInt, rather than a SpareBitVector, which
makes these functions a bit more generic. These functions emit
instructions that are essentially equivalent to the parallel bit
extract/deposit (PEXT and PDEP) instructions in BMI2 on x86_64
(although we don't emit those directly currently). They also map
well to bitwise manipulation instructions on other platforms (e.g.
RISBG on IBM Z). So we might find uses for them outside spare bit
manipulation in the future.
This makes it easier to ignore them programmatically.
The previous commit moved the note containing the output to stderr. This change prints it on stdout again, but now with no human-consumption prefix so it can be directly executed by tools.
If passed, build-script doesn’t build anything; it just prints the full path to the directory the invocation would have built its products in. This is intended to allow you to build tools which take build-script options like --debug and --xcode and use them to determine the build directory you’re currently using.
…f we actually have uses since we may not delete the actual destructure.

The specific case where this happened here is:

```
  // Worklist = [
  %0 = struct $Int (...)
  %1 = $Klass
  %2 = tuple (%0, %1)
  (%3, %4) = destructure_tuple %2
  store %3 to [trivial] %3stack
  store %4 to [init] %4stack
```

What would happen is we would visit the destructure_tuple, replace %3 with %0
but fail to propagate %4:

```
  %0 = struct $Int (...)
  %1 = $Klass
  %2 = tuple (%0, %1)
  (%3, %4) = destructure_tuple %2
  store %0 to [trivial] %3stack
  store %4 to [init] %4stack
```

This then causes the tuple to be added to the worklist. When we visit the tuple,
we see that we have a destructure_tuple that is a user of the tuple, we see that
it still has that Struct as a user despite us having constant propagated that
component of the tuple. This then causes us to add the struct back to the
worklist despite that tuple component having no uses. Then when we visit the
struct. Which causes us to visit the tuple, etc.

rdar://49947112
Adds an --expand-invocation argument, which is now the preferred name for this feature. Leaves the original name in place in case someone is using it in a script.
The --dump-config option prints a recursive JSON dump of the BuildScriptInvocation object’s properties, which gives access to essentially all of the knowledge build-script has about the build before it starts performing it. This makes the output more flexible and extensible without severely convoluting the implementation, but doesn’t really give us a stable representation of that data.
The smoke test preset tests sourcekit-lsp, and the full test should too.
Note: on Linux this was already working.
… compensating releases, if we find a double use due to a loop, do not insert an apply at that call site.

Otherwise, one will get use after frees. I added an interpreter test as wlel as
an end to end test.

rdar://50884462
gottesmm and others added 24 commits May 24, 2019 09:58
…hat resulted in invalid IR being emitted.

The specific problem here is that we are setting the insertion point of a
SILBuilder and not unsetting it. I fixed the problem by creating a separate
builder so the original builder stays put.

I originally came across this in my work on moving ownership stripping after the
diagnostic passes. This patch fixes it without my other changes to ease
cherry-picking to 5.1.

I also added more test coverage by expanding the test case to also handle
copy_on_success and take_always.

rdar://51093557
This was failing alongside inherits_ObjCClasses.swift (they were failing at the
same time).

Until MikeA has time to look at this disable this as well.

rdar://problem/50898688
…82945941cc9e6e

[test] Disable inherits_NSObject.swift on watchOS.
[Serialization] Factor TypeSerializer out of writeType
api-digester: keep track of the introduced platforms and language versions for all APIs
…rnal module

To incorporate extensions to types from other modules, the tool sometimes needs
to pull type declaration from external modules even though these modules
are not under checking. We need a flag to explicitly mark such case.
swift-api-digester: mark if a type declaration is pulled from an external module
This improves the detection of syntax so that the identifier for a
typealias is identified as an identifier, the `=` is identified as a
delimiter, and the type that is aliased is identified as a type.
[IRGen] Simplify constant occupied/spare bit interleaving
…adb34e72d9f355

[cast-opt] Fix miscompile when we tried to optimize take_on_success t…
These are super-important in certain circumstances, paritculalry benchmarking, and deserve a shorthand.
This makes the modifier highlighting stand out against the definition
keyword.
Add build-script -a/-A to control assertions
The attribute can be applied to a typename or a type declaration.
Correct the handling for the second case.
@marcrasi marcrasi requested a review from burmako May 29, 2019 17:15
@marcrasi
Copy link
Author

@swift-ci please clean test tensorflow

@marcrasi marcrasi requested a review from bgogul May 29, 2019 17:17
@marcrasi marcrasi merged commit 57a92b1 into tensorflow May 29, 2019
@marcrasi marcrasi deleted the tensorflow-merge branch May 29, 2019 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.