Skip to content

Commit ebf21f8

Browse files
authored
Merge pull request #24887 from apple/tensorflow-merge
Merge tag 'DEVELOPMENT-SNAPSHOT-2019-05-15-a' to 'tensorflow'
2 parents c5f2e09 + 0266c0d commit ebf21f8

File tree

659 files changed

+16212
-6750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

659 files changed

+16212
-6750
lines changed

.mailmap

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ Daniel Duan <[email protected]> <[email protected]>
2929
Dante Broggi <[email protected]>
3030
3131
32-
3332
3433
3534
36-
37-
David Rönnqvist <[email protected]>
35+
36+
David Rönnqvist <[email protected]>
3837
3938
4039
@@ -43,10 +42,8 @@ Davide Italiano <[email protected]> <[email protected]>
4342
4443
4544
46-
4745
4846
Erik Eckstein <[email protected]>
49-
5047
5148
Ewa Matejska <[email protected]>
5249
@@ -130,15 +127,13 @@ Ross Bayer <[email protected]>
130127
131128
132129
133-
134130
135131
Stephen Canon <[email protected]>
136132
137133
Sukolsak Sakshuwong <[email protected]>
138134
139135
140136
141-
142137
143138
144139

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ Swift 5.1
197197
}
198198
```
199199

200-
* `weak` and `unowned` stored properties no longer inhibit the
200+
* [SR-9827][]:
201+
202+
`weak` and `unowned` stored properties no longer inhibit the
201203
automatic synthesis of `Equatable` or `Hashable` conformance.
202204

203205
* [SR-2688][]:
@@ -7695,3 +7697,4 @@ Swift 1.0
76957697
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
76967698
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
76977699
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
7700+
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>

CMakeLists.txt

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ option(SWIFT_INCLUDE_DOCS
9797
"Create targets for building docs."
9898
TRUE)
9999

100+
set(_swift_include_apinotes_default FALSE)
101+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
102+
set(_swift_include_apinotes_default TRUE)
103+
endif()
104+
105+
option(SWIFT_INCLUDE_APINOTES
106+
"Create targets for installing the remaining apinotes in the built toolchain."
107+
${_swift_include_apinotes_default})
108+
100109
#
101110
# Miscellaneous User-configurable options.
102111
#
@@ -118,7 +127,7 @@ set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
118127
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
119128
# can be reused when a new version of Swift comes out (assuming the user hasn't
120129
# manually set it as part of their own CMake configuration).
121-
set(SWIFT_VERSION "5.0")
130+
set(SWIFT_VERSION "5.1")
122131

123132
set(SWIFT_VENDOR "" CACHE STRING
124133
"The vendor name of the Swift compiler")
@@ -257,9 +266,15 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
257266
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
258267
"The name of the toolchain to pass to 'xcrun'")
259268

260-
set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "@rpath" CACHE STRING
269+
set(SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR "/usr/lib/swift" CACHE STRING
261270
"The directory of the install_name for standard library dylibs")
262271

272+
# We don't want to use the same install_name_dir as the standard library which
273+
# will be installed in /usr/lib/swift. These private libraries should continue
274+
# to use @rpath for now.
275+
set(SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR "@rpath" CACHE STRING
276+
"The directory of the install_name for the private standard library dylibs")
277+
263278
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_OSX "10.9" CACHE STRING
264279
"Minimum deployment target version for OS X")
265280

@@ -1062,16 +1077,20 @@ endif()
10621077
# created. This then will cause SwiftSyntax to fail to build.
10631078
#
10641079
# https://bugs.swift.org/browse/SR-5975
1065-
add_subdirectory(stdlib)
1066-
1067-
if(SWIFT_BUILD_SDK_OVERLAY)
1068-
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}"
1069-
building_darwin_sdks)
1070-
if(building_darwin_sdks)
1071-
add_subdirectory(apinotes)
1080+
if(SWIFT_BUILD_STDLIB)
1081+
add_subdirectory(stdlib)
1082+
else()
1083+
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1084+
# ensure we build that when building tools.
1085+
if(SWIFT_INCLUDE_TOOLS)
1086+
add_subdirectory(stdlib/public/Reflection)
10721087
endif()
10731088
endif()
10741089

1090+
if(SWIFT_INCLUDE_APINOTES)
1091+
add_subdirectory(apinotes)
1092+
endif()
1093+
10751094
add_subdirectory(include)
10761095

10771096
if(SWIFT_INCLUDE_TOOLS)

apinotes/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@ add_custom_command(
2323
COMMAND
2424
"${CMAKE_COMMAND}" "-E" "copy_if_different" ${inputs} "${output_dir}/")
2525

26-
add_custom_target("copy_apinotes"
26+
add_custom_target("copy_apinotes" ALL
2727
DEPENDS "${outputs}" "${output_dir}"
2828
COMMENT "Copying API notes to ${output_dir}"
2929
SOURCES "${sources}")
3030

31-
# This is treated as an OPTIONAL target because if we don't build the SDK
32-
# overlay, the files will be missing anyway. It also allows us to build
33-
# single overlays without installing the API notes.
3431
swift_install_in_component(DIRECTORY "${output_dir}"
3532
DESTINATION "lib/swift/"
36-
COMPONENT sdk-overlay
37-
OPTIONAL)
33+
COMPONENT compiler)

benchmark/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ set(SWIFT_BENCH_MODULES
9292
single-source/Hash
9393
single-source/Histogram
9494
single-source/InsertCharacter
95+
single-source/IntegerParsing
9596
single-source/Integrate
9697
single-source/IterateData
9798
single-source/Join
@@ -107,6 +108,7 @@ set(SWIFT_BENCH_MODULES
107108
single-source/NSError
108109
single-source/NSStringConversion
109110
single-source/NibbleSort
111+
single-source/NIOChannelPipeline
110112
single-source/NopDeinit
111113
single-source/ObjectAllocation
112114
single-source/ObjectiveCBridging

benchmark/single-source/AngryPhonebook.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public let AngryPhonebook = BenchmarkInfo(
2121
tags: [.validation, .api, .String],
2222
legacyFactor: 7)
2323

24-
var words = [
24+
let words = [
2525
"James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph",
2626
"Charles", "Thomas", "Christopher", "Daniel", "Matthew", "Donald", "Anthony",
2727
"Paul", "Mark", "George", "Steven", "Kenneth", "Andrew", "Edward", "Brian",

benchmark/single-source/AnyHashableWithAClass.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import TestsUtils
2222
// 11% _swift_stdlib_makeAnyHashableUpcastingToHashableBaseType
2323
// 16% _swift_retain_[n]
2424
// 5% swift_conformsToProtocol
25-
public var AnyHashableWithAClass = BenchmarkInfo(
25+
public let AnyHashableWithAClass = BenchmarkInfo(
2626
name: "AnyHashableWithAClass",
2727
runFunction: run_AnyHashableWithAClass,
2828
tags: [.abstraction, .runtime, .cpubench],

benchmark/single-source/ArrayOfGenericPOD.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public func run_ArrayOfGenericPOD(_ N: Int) {
7676

7777
// --- ArrayInitFromSlice
7878

79-
var globalArray = Array<UInt8>(repeating: 0, count: 4096)
79+
let globalArray = Array<UInt8>(repeating: 0, count: 4096)
8080

8181
func createArrayOfPOD() {
8282
blackHole(globalArray)

benchmark/single-source/ArraySetElement.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import TestsUtils
1515
// 33% isUniquelyReferenced
1616
// 15% swift_rt_swift_isUniquelyReferencedOrPinned_nonNull_native
1717
// 18% swift_isUniquelyReferencedOrPinned_nonNull_native
18-
public var ArraySetElement = BenchmarkInfo(
18+
public let ArraySetElement = BenchmarkInfo(
1919
name: "ArraySetElement",
2020
runFunction: run_ArraySetElement,
2121
tags: [.runtime, .cpubench]

benchmark/single-source/ChainedFilterMap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import TestsUtils
22

3-
public var ChainedFilterMap = [
3+
public let ChainedFilterMap = [
44
BenchmarkInfo(name: "ChainedFilterMap", runFunction: run_ChainedFilterMap,
55
tags: [.algorithm], setUpFunction: { blackHole(first100k) },
66
legacyFactor: 9),

benchmark/single-source/Chars.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public let Chars = BenchmarkInfo(
2020
setUpFunction: { blackHole(alphabetInput) },
2121
legacyFactor: 50)
2222

23-
var alphabetInput: [Character] = [
23+
let alphabetInput: [Character] = [
2424
"A", "B", "C", "D", "E", "F", "G",
2525
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
2626
"S", "T", "U",

benchmark/single-source/ExistentialPerformance.swift

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,6 @@ func caRef1() { ca(Ref1.self) }
264264
func caRef2() { ca(Ref2.self) }
265265
func caRef3() { ca(Ref3.self) }
266266
func caRef4() { ca(Ref4.self) }
267-
@inline(never)
268-
func grabArray() -> [Existential] { // transfer array ownership to caller
269-
// FIXME: This is causing Illegal Instruction: 4 crash
270-
// defer { array = nil }
271-
// return array
272-
// This doesn't work either:
273-
// let a = array!
274-
// array = nil
275-
// return a
276-
return array!
277-
}
278267

279268
// `setUpFunctions` that determine which existential type will be tested
280269
var existentialType: Existential.Type!
@@ -540,7 +529,7 @@ func run_Array_init(_ N: Int) {
540529
}
541530

542531
func run_Array_method1x(_ N: Int) {
543-
let existentialArray = grabArray()
532+
let existentialArray = array!
544533
for _ in 0 ..< N * 100 {
545534
for elt in existentialArray {
546535
if !elt.doIt() {
@@ -551,7 +540,7 @@ func run_Array_method1x(_ N: Int) {
551540
}
552541

553542
func run_Array_method2x(_ N: Int) {
554-
let existentialArray = grabArray()
543+
let existentialArray = array!
555544
for _ in 0 ..< N * 100 {
556545
for elt in existentialArray {
557546
if !elt.doIt() || !elt.reallyDoIt() {
@@ -562,8 +551,8 @@ func run_Array_method2x(_ N: Int) {
562551
}
563552

564553
func run_ArrayMutating(_ N: Int) {
565-
var existentialArray = grabArray()
566-
for _ in 0 ..< N * 100 {
554+
var existentialArray = array!
555+
for _ in 0 ..< N * 500 {
567556
for i in 0 ..< existentialArray.count {
568557
if !existentialArray[i].mutateIt() {
569558
fatalError("expected true")
@@ -573,7 +562,7 @@ func run_ArrayMutating(_ N: Int) {
573562
}
574563

575564
func run_ArrayShift(_ N: Int) {
576-
var existentialArray = grabArray()
565+
var existentialArray = array!
577566
for _ in 0 ..< N * 25 {
578567
for i in 0 ..< existentialArray.count-1 {
579568
existentialArray.swapAt(i, i+1)
@@ -582,7 +571,7 @@ func run_ArrayShift(_ N: Int) {
582571
}
583572

584573
func run_ArrayConditionalShift(_ N: Int) {
585-
var existentialArray = grabArray()
574+
var existentialArray = array!
586575
for _ in 0 ..< N * 25 {
587576
for i in 0 ..< existentialArray.count-1 {
588577
let curr = existentialArray[i]

benchmark/single-source/ExistentialPerformance.swift.gyb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Setup = """
3636
let existential = existentialType.init()
3737
let existential2 = existentialType.init()
3838
var existential = existentialType.init()
39-
let existentialArray = grabArray()
40-
var existentialArray = grabArray()
39+
let existentialArray = array!
40+
var existentialArray = array!
4141
""".splitlines()
4242
Setup = [Setup[0], Setup[1], '\n'.join(Setup[1:3]), Setup[3], Setup[4], Setup[5]]
4343

@@ -90,7 +90,7 @@ Workloads = [
9090
}
9191
}
9292
"""),
93-
('Array.Mutating', Setup[5], '100', """
93+
('Array.Mutating', Setup[5], '500', """
9494
for i in 0 ..< existentialArray.count {
9595
if !existentialArray[i].mutateIt() {
9696
fatalError("expected true")
@@ -151,17 +151,6 @@ func ca<T: Existential>(_: T.Type) {
151151
% for Variant in Vals + Refs:
152152
func ca${Variant}() { ca(${Variant}.self) }
153153
% end
154-
@inline(never)
155-
func grabArray() -> [Existential] { // transfer array ownership to caller
156-
// FIXME: This is causing Illegal Instruction: 4 crash
157-
// defer { array = nil }
158-
// return array
159-
// This doesn't work either:
160-
// let a = array!
161-
// array = nil
162-
// return a
163-
return array!
164-
}
165154

166155
// `setUpFunctions` that determine which existential type will be tested
167156
var existentialType: Existential.Type!

benchmark/single-source/Hash.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Hash {
127127
final
128128
class MD5 : Hash {
129129
// Integer part of the sines of integers (in radians) * 2^32.
130-
var k : [UInt32] = [0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
130+
let k : [UInt32] = [0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ,
131131
0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ,
132132
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be ,
133133
0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821 ,
@@ -145,7 +145,7 @@ class MD5 : Hash {
145145
0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 ]
146146

147147
// Per-round shift amounts
148-
var r : [UInt32] = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
148+
let r : [UInt32] = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
149149
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
150150
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
151151
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]
@@ -433,7 +433,7 @@ class SHA256 : Hash {
433433
var h6: UInt32 = 0
434434
var h7: UInt32 = 0
435435

436-
var k : [UInt32] = [
436+
let k : [UInt32] = [
437437
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
438438
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
439439
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,

0 commit comments

Comments
 (0)