Skip to content
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

Merge 2020-06-30 into tensorflow #32623

Merged
merged 271 commits into from
Jul 3, 2020
Merged

Merge 2020-06-30 into tensorflow #32623

merged 271 commits into from
Jul 3, 2020

Conversation

texasmichelle
Copy link
Contributor

No description provided.

xedin and others added 30 commits June 22, 2020 10:15
Use TangentStoredPropertyRequest in differentiation transform.

Improve non-differentiability diagnostics regarding invalid stored
property projection instructions:
`struct_extract`, `struct_element_addr`, `ref_element_addr`.

Diagnose the following cases:
- Original property's type does not conform to `Differentiable`.
- Base type's `TangentVector` is not a struct.
- Tangent property not found: base type's `TangentVector` does not have a
  stored property with the same name as the original property.
- Tangent property's type is not equal to the original property's
  `TangentVector` type.
- Tangent property is not a stored property.

Resolves TF-969 and TF-970.
This adjusts the target specific argument handling to use the same logic
as the toolchain, and in doing so, silences the spurious warnings when
building with a MSVC toolchain.
This dependency is already recorded in the
`importInfo`'s `ModuleNames`.
The new function swift_compareProtocolConformanceDescriptors calls
through to the preexisting code in MetadataCacheKey which has been
extracted out from MetadataCacheKey::compareWitnessTables into a new
public static function
MetadataCacheKey::compareProtocolConformanceDescriptors.

The new function's availability is "future" for now.
…uring testing.

Seems that Android ARM 32 bits, which uses linux-androideabi as OS
generates code that is ABI stable. Mark the OS as ABI stable, as it was
already for Android ARM 64 bits.

There's also some white space removal in unrelated lines.
…erty

[AutoDiff] Improve invalid stored property projection diagnostics.
[DepScan] NFC: Remove check for OnoneSupport
…nsparent stdlib vs non-stdlib functions.

I am going to be moving back ownership lowering first in the stdlib so that we
can bring up the optimizer on ownership without needing to deal with
serialization issues (the stdlib doesn't deserialize SIL from any other
modules).

This patch just begins the mechanical process with a nice commit message. Should
be NFC.
Previously, the metadata accessor for a generic type for which some
metadata prespecialization was done only tested that the type metadata
arguments were equal to those of the prespecialization.  If the generic
type had an argument which was constrained to conform to a protocol, the
particular conformance to that protocol was determined at compile time,
but the conformance was ignored in the metadata accessor.  As a result
it was possible--in certain multi-module cases--for the metadata
accessor to incorrectly return a prespecialized metadata record whose
type arguments matched the type arguments passed to the accessor but
whose conformance arguments did not.

For example, given the following,

  Base:
    struct K {}
    protocol P {}

  Conformance1:
    import Base
    struct G<T : P> {}
    extension K : P {} // first conformance
    prespecialize( G<K>.self )

  Conformance2:
    import Base
    extension K : P {} // second conformance

the metadata accessor for G defined in Conformance1 would behave like

  MetadataResponse `metadata accessor for G`(
      MetadataRequest request,
      const Metadata *M,
      const WitnessTable *WT) {
    if (M == `type metadata for K`) {
      return `canonical prespecialized type metadata for G<K>`
    }
    return swift_getGenericMetadata(request, {M, WT});
  }

Here, the WitnessTable argument is the witness table describing a
conformance of the type whose metadata is provided to the protocol P.

The incorrect behavior occurs when calling the metadata accessor with
these arguments:

    `some request`
    `type metadata for K`
    `protocol witness table for Base.K : Base.P in Conformance2`

The accessor would return the `canonical prespecialized type metadata
for G<K>`.  The problem is that the prespecialized metadata contains the
following generic arguments:

    `type metadata for K`
    `protocol witness table for Base.K : Base.P in Conformance1`

Specificallly, the witness table is for the conformance from
Conformance1, not the conformance from Conformance2.

Here, the problem is addressed by testing that the witness tables passed
into the accessor are for the same conformance as the witness table
referred to by the prespecialized record.  Now, the metadata accessor
for G will behave like

  MetadataResponse `metadata accessor for G`(
      MetadataRequest request,
      const Metadata *M,
      const WitnessTable *WT) {
    if (M == `type metadata for K`
        swift_compareProtocolConformanceDescriptors(
          WT->getDescription(),
          `protocol conformance descriptor for Base.K : Base.P in Conformance1`)
       ) {
      return `canonical prespecialized type metadata for G<K>`
    }
    return swift_getGenericMetadata(request, {M, WT});
  }

Consequently, when the accessor is called with the same arguments as
before, the call to swift_compareProtocolConformanceDescriptors will
return false and the non-matching prespecialized metadata will not be
returned.
Improvements for cross-module-optimization
[android] Set linux-androideabi (Android ARM 32 bits) as ABI stable during testing.
build: correct handling of argument generation
In order to access `stdin`, `stdout` as binary, you must use the
`buffer` member in Python 3.  The replacement of the binary data
requires that pattern and the replacement be byte objects.  Convert the
pattern and replacement to UTF-8 encoded bytes.
Make `remote-run` be compatible with python 2 and python 3.  The changes
are:
- replace `viewitems` with `items`
- replace `viewvalues` with `values`
- replace `viewkeys` with `keys`
- replace `haskey` with `in`
ExplicitModules: use key names conforming to Swift naming convention in explicit Swift module maps. NFC
Give OptionSet an initializer_list constructor
[ConstraintSystem] Rework handling of object literal expressions
Update master branch for Xcode 12 beta
davezarzycki and others added 11 commits June 30, 2020 08:31
…#32568)"

This reverts commit 621b3b4.

The driver is double faulting on my Linux box (Fedora 32 / x86-64). It
crashes due to heap corruption, then hangs trying to introspect and
print the stack. There also appears to be an unrelated(?) uninitialized
memory error that valgrind detects (as opposed to malloc's own self
diagnostics).
[Dependency Scanner] Use `pragma clang module import` in the hack file used to invoke the clang dependency scanner.
[NFC] Add a test for constraint generation failures in a pattern binding decl inside of a function builder
test: attempt to quote python interpreter path
…eq-rdar64782333

[SourceKit] Enable ASTContext caching in other completion-like requests
@texasmichelle
Copy link
Contributor Author

Please test with following PRs:
swiftlang/llvm-project#1399

@swift-ci Please clean test TensorFlow

@texasmichelle
Copy link
Contributor Author

@swift-ci please test Linux platform

@texasmichelle
Copy link
Contributor Author

@swift-ci Please clean test TensorFlow

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8cced04

@texasmichelle
Copy link
Contributor Author

@swift-ci Please clean test TensorFlow

…32671)

Add base type parameter to `TangentStoredPropertyRequest`.

Use `TypeBase::getTypeOfMember` instead of `VarDecl::getType` to correctly
compute the member type of original stored properties, using the base type.

Resolves SR-13134.
@dan-zheng
Copy link
Contributor

@swift-ci Please test tensorflow

Remove `LoadExpr` and `InjectIntoOptionalExpr`: creating instances of these
`ImplicitConversionExpr` subclasses causes an assertion failure in
`ConstraintGenerator::visitImplicitConversionExpr`.

This changes seem necessary after changes to `SanitizeExpr` in
0232cd0.
@dan-zheng dan-zheng added the tensorflow This is for "tensorflow" branch PRs. label Jul 3, 2020
@dan-zheng
Copy link
Contributor

@swift-ci Please test tensorflow

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.