Skip to content

Commit 8b68622

Browse files
authored
Merge pull request #34066 from apple/tensorflow-merge
Merge 2020-09-24 into tensorflow
2 parents bab8500 + 89bfbd6 commit 8b68622

File tree

742 files changed

+7444
-14362
lines changed

Some content is hidden

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

742 files changed

+7444
-14362
lines changed

CHANGELOG.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ CHANGELOG
44
<details>
55
<summary>Note: This is in reverse chronological order, so newer entries are added to the top.</summary>
66

7-
| Version | Released | Toolchain |
8-
| :------------------------ | :--------- | :---------- |
9-
| [Swift Next](#swift-next) |
10-
| [Swift 5.3](#swift-53) | | |
11-
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
12-
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
13-
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
14-
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
15-
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
16-
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
17-
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
18-
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
19-
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
20-
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
21-
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
22-
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
23-
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
24-
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
7+
| Version | Released | Toolchain |
8+
| :--------------------- | :--------- | :---------- |
9+
| [Swift 5.3](#swift-53) | 2020-09-16 | Xcode 12.0 |
10+
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
11+
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
12+
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
13+
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
14+
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
15+
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
16+
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
17+
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
18+
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
19+
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
20+
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
21+
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
22+
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
23+
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
2524

2625
</details>
2726

@@ -80,9 +79,13 @@ Swift Next
8079
let _: Foo? = .bar.anotherFoo.getFoo().optionalFoo?.optionalFoo![]
8180
```
8281

82+
**Add new entries to the top of this section, not here!**
83+
8384
Swift 5.3
8485
---------
8586

87+
### 2020-09-16 (Xcode 12.0)
88+
8689
* [SE-0279][] & [SE-0286][]:
8790

8891
Trailing closure syntax has been extended to allow additional labeled closures to follow the initial unlabeled closure:

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,6 @@ set(SWIFT_NATIVE_CLANG_TOOLS_PATH "" CACHE STRING
248248
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "" CACHE STRING
249249
"Path to the directory that contains Swift tools that are executable on the build machine")
250250

251-
option(SWIFT_ENABLE_MODULE_INTERFACES
252-
"Generate .swiftinterface files alongside .swiftmodule files"
253-
TRUE)
254-
255251
option(SWIFT_STDLIB_ENABLE_SIB_TARGETS
256252
"Should we generate sib targets for the stdlib or not?"
257253
FALSE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| **macOS** | Google Kokoro | ![Build Status](https://storage.googleapis.com/tensorflow-kokoro-build-badges/macos-swift-tf-release.svg) | - |
66
| **Ubuntu 16.04** | Swift.org CI | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow) | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu) |
77

8-
| | **Architecture** | **Master** | **Package** |
8+
| | **Architecture** | **main** | **Package** |
99
|---|:---:|:---:|:---:|
1010
| **macOS** | x86_64 |[![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-osx)|[![Build Status](https://ci.swift.org/job/oss-swift-package-osx/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-osx)|
1111
| **Ubuntu 16.04** | x86_64 | [![Build Status](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-16_04)|[![Build Status](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04/lastCompletedBuild/badge/icon)](https://ci.swift.org/job/oss-swift-package-linux-ubuntu-16_04)|

benchmark/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ To run Swift benchmarks, pass the `--benchmark` flag to `build-script`. The
88
current benchmark results will be compared to the previous run's results if
99
available. Results for each benchmark run are logged for future comparison.
1010

11-
For branch based development, take a baseline benchmark on the Swift `master`
11+
For branch based development, take a baseline benchmark on the Swift `main`
1212
branch, switch to a development branch containing potentially performance
1313
impacting changes, and run the benchmarks again. Upon benchmark completion, the
1414
benchmark results for the development branch will be compared to the most
15-
recent benchmark results for `master`.
15+
recent benchmark results for `main`.
1616

1717
## Building the Swift Benchmarks
1818

@@ -181,7 +181,7 @@ benchmarks will be compiled with -Onone!**
181181
* `--list`
182182
* Print a list of available tests matching specified criteria
183183
* `--tags`
184-
* Run tests that are labeled with specified [tags](https://github.com/apple/swift/blob/master/benchmark/utils/TestsUtils.swift#L19)
184+
* Run tests that are labeled with specified [tags](https://github.com/apple/swift/blob/main/benchmark/utils/TestsUtils.swift#L19)
185185
(comma separated list); multiple tags are interpreted as logical AND, i.e.
186186
run only test that are labeled with all the supplied tags
187187
* `--skip-tags`

benchmark/scripts/Benchmark_Driver

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,9 +975,9 @@ def parse_args(args):
975975
)
976976
compare_parser.add_argument(
977977
"--baseline-branch",
978-
default="master",
978+
default="main",
979979
help="attempt to compare results to baseline results for specified "
980-
"branch (default: master)",
980+
"branch (default: main)",
981981
)
982982
compare_parser.set_defaults(func=compare)
983983

benchmark/scripts/Benchmark_RuntimeLeaksRunner.in

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ class LeaksRunnerResult(perf_test_driver.Result):
6262

6363

6464
class LeaksRunnerBenchmarkDriver(perf_test_driver.BenchmarkDriver):
65-
def __init__(self, binary, xfail_list, num_samples, num_iters):
65+
def __init__(self, binary, xfail_list, num_samples, num_iters, verbose):
6666
perf_test_driver.BenchmarkDriver.__init__(
6767
self, binary, xfail_list, enable_parallel=True
6868
)
6969
self.num_samples = num_samples
7070
self.num_iters = num_iters
71+
self.verbose = verbose
7172

7273
def print_data_header(self, max_test_len):
7374
fmt = "{:<%d}{:<10}{:}" % (max_test_len + 5)
@@ -120,6 +121,13 @@ class LeaksRunnerBenchmarkDriver(perf_test_driver.BenchmarkDriver):
120121
]
121122
d["objc_count"] = len(d["objc_objects"])
122123

124+
# If we are asked to emit verbose output, do so now.
125+
if self.verbose:
126+
tmp = (data["path"], data["test_name"], d)
127+
sys.stderr.write(
128+
"VERBOSE (%s,%s): %s" % tmp)
129+
sys.stderr.flush()
130+
123131
total_count = d["objc_count"] + d["swift_count"]
124132
return total_count
125133
except Exception:
@@ -156,13 +164,17 @@ def parse_args():
156164
)
157165
parser.add_argument("-num-samples", type=int, default=2)
158166
parser.add_argument("-num-iters", type=int, default=2)
167+
parser.add_argument("-v", "--verbose", action="store_true",
168+
help="Upon failure, dump out raw result",
169+
dest="verbose")
159170
return parser.parse_args()
160171

161172

162173
if __name__ == "__main__":
163174
args = parse_args()
164175
driver = LeaksRunnerBenchmarkDriver(
165-
SWIFT_BIN_DIR, XFAIL_LIST, args.num_samples, args.num_iters
176+
SWIFT_BIN_DIR, XFAIL_LIST, args.num_samples, args.num_iters,
177+
args.verbose
166178
)
167179
if driver.run(args.filter):
168180
sys.exit(0)

benchmark/single-source/ChaCha.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import TestsUtils
2222
enum ChaCha20 { }
2323

2424
extension ChaCha20 {
25+
@inline(never)
2526
public static func encrypt<Key: Collection, Nonce: Collection, Bytes: MutableCollection>(bytes: inout Bytes, key: Key, nonce: Nonce, initialCounter: UInt32 = 0) where Bytes.Element == UInt8, Key.Element == UInt8, Nonce.Element == UInt8 {
2627
var baseState = ChaChaState(key: key, nonce: nonce, counter: initialCounter)
2728
var index = bytes.startIndex
@@ -347,13 +348,28 @@ public let ChaCha = BenchmarkInfo(
347348
runFunction: run_ChaCha,
348349
tags: [.runtime, .cpubench])
349350

351+
@inline(never)
352+
func checkResult(_ plaintext: [UInt8]) {
353+
CheckResults(plaintext.first! == 6 && plaintext.last! == 254)
354+
var hash: UInt64 = 0
355+
for byte in plaintext {
356+
// rotate
357+
hash = (hash &<< 8) | (hash &>> (64 - 8))
358+
hash ^= UInt64(byte)
359+
}
360+
CheckResults(hash == 0xa1bcdb217d8d14e4)
361+
}
350362

351363
@inline(never)
352364
public func run_ChaCha(_ N: Int) {
353-
var plaintext = Array(repeating: UInt8(0), count: 30720) // Chosen for CI runtime
354365
let key = Array(repeating: UInt8(1), count: 32)
355366
let nonce = Array(repeating: UInt8(2), count: 12)
356367

368+
var checkedtext = Array(repeating: UInt8(0), count: 1024)
369+
ChaCha20.encrypt(bytes: &checkedtext, key: key, nonce: nonce)
370+
checkResult(checkedtext)
371+
372+
var plaintext = Array(repeating: UInt8(0), count: 30720) // Chosen for CI runtime
357373
for _ in 1...N {
358374
ChaCha20.encrypt(bytes: &plaintext, key: key, nonce: nonce)
359375
blackHole(plaintext.first!)

benchmark/single-source/FloatingPointConversion.swift

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ public let FloatingPointConversion = [
1818
runFunction: run_ConvertFloatingPoint_MockFloat64ToDouble,
1919
tags: [.validation, .api],
2020
setUpFunction: { blackHole(mockFloat64s) }),
21+
BenchmarkInfo(
22+
name: "ConvertFloatingPoint.MockFloat64Exactly",
23+
runFunction: run_ConvertFloatingPoint_MockFloat64Exactly,
24+
tags: [.validation, .api],
25+
setUpFunction: { blackHole(mockFloat64s) }),
26+
BenchmarkInfo(
27+
name: "ConvertFloatingPoint.MockFloat64Exactly2",
28+
runFunction: run_ConvertFloatingPoint_MockFloat64Exactly2,
29+
tags: [.validation, .api],
30+
setUpFunction: { blackHole(mockFloat64s) }),
31+
BenchmarkInfo(
32+
name: "ConvertFloatingPoint.MockFloat64ToInt64",
33+
runFunction: run_ConvertFloatingPoint_MockFloat64ToInt64,
34+
tags: [.validation, .api],
35+
setUpFunction: { blackHole(mockFloat64s) }),
2136
]
2237

2338
protocol MockBinaryFloatingPoint: BinaryFloatingPoint {
@@ -125,6 +140,11 @@ struct MockFloat64: MockBinaryFloatingPoint {
125140
init(_ _value: Double) { self._value = _value }
126141
}
127142

143+
struct MockFloat32: MockBinaryFloatingPoint {
144+
var _value: Float
145+
init(_ _value: Float) { self._value = _value }
146+
}
147+
128148
let doubles = [
129149
1.8547832857295, 26.321549267719135, 98.9544480962058, 73.70286973782363,
130150
82.04918555938816, 76.38902969312758, 46.35647857011161, 64.0821426030317,
@@ -142,21 +162,51 @@ let doubles = [
142162

143163
let mockFloat64s = doubles.map { MockFloat64($0) }
144164

165+
// See also: test/SILOptimizer/floating_point_conversion.swift
166+
167+
@inline(never)
168+
public func run_ConvertFloatingPoint_MockFloat64ToDouble(_ N: Int) {
169+
for _ in 0..<(N * 100) {
170+
for element in mockFloat64s {
171+
let f = Double(identity(element))
172+
blackHole(f)
173+
}
174+
}
175+
}
176+
145177
@inline(__always)
146178
func convert<
147179
T: BinaryFloatingPoint, U: BinaryFloatingPoint
148-
>(_ value: T, to: U.Type) -> U {
149-
U(value)
180+
>(exactly value: T, to: U.Type) -> U? {
181+
U(exactly: value)
150182
}
151183

152-
// See also: test/SILOptimizer/floating_point_conversion.swift
184+
@inline(never)
185+
public func run_ConvertFloatingPoint_MockFloat64Exactly(_ N: Int) {
186+
for _ in 0..<(N * 25) {
187+
for element in mockFloat64s {
188+
let f = convert(exactly: identity(element), to: Double.self)
189+
blackHole(f)
190+
}
191+
}
192+
}
153193

154194
@inline(never)
155-
public func run_ConvertFloatingPoint_MockFloat64ToDouble(_ N: Int) {
156-
for _ in 0..<(N * 100) {
195+
public func run_ConvertFloatingPoint_MockFloat64Exactly2(_ N: Int) {
196+
for _ in 0..<(N * 25) {
157197
for element in mockFloat64s {
158-
let f = Double(identity(element))
198+
let f = convert(exactly: identity(element), to: MockFloat32.self)
159199
blackHole(f)
160200
}
161201
}
162202
}
203+
204+
@inline(never)
205+
public func run_ConvertFloatingPoint_MockFloat64ToInt64(_ N: Int) {
206+
for _ in 0..<(N * 1000) {
207+
for element in mockFloat64s {
208+
let i = Int64(identity(element))
209+
blackHole(i)
210+
}
211+
}
212+
}

cmake/modules/DarwinSDKs.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ if(swift_build_freestanding)
3232
"Which SDK to use when building the FREESTANDING stdlib")
3333
set(SWIFT_FREESTANDING_TRIPLE_NAME "" CACHE STRING
3434
"Which triple name (e.g. 'none-macho') to use when building the FREESTANDING stdlib")
35+
set(SWIFT_FREESTANDING_MODULE_NAME "" CACHE STRING
36+
"Which .swiftmodule name (e.g. 'freestanding') to use when building the FREESTANDING stdlib")
3537
set(SWIFT_FREESTANDING_ARCHS "" CACHE STRING
3638
"Which architectures to build when building the FREESTANDING stdlib")
3739
configure_sdk_darwin(
3840
FREESTANDING "FREESTANDING" ""
39-
"${SWIFT_FREESTANDING_SDK}" freestanding "${SWIFT_FREESTANDING_TRIPLE_NAME}" freestanding "${SWIFT_FREESTANDING_ARCHS}")
41+
"${SWIFT_FREESTANDING_SDK}" freestanding
42+
"${SWIFT_FREESTANDING_TRIPLE_NAME}" "${SWIFT_FREESTANDING_MODULE_NAME}" "${SWIFT_FREESTANDING_ARCHS}")
4043
set(SWIFT_SDK_FREESTANDING_LIB_SUBDIR "freestanding")
4144
configure_target_variant(FREESTANDING-DA "FREESTANDING Debug+Asserts" FREESTANDING DA "Debug+Asserts")
4245
configure_target_variant(FREESTANDING-RA "FREESTANDING Release+Asserts" FREESTANDING RA "Release+Asserts")

docs/ABI/RegisterUsage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 64-Bit Architecture Register Usage
22

3-
From Swift 5, the calling convention register allocation for 64-bit architectures is largely based on [existing](https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html) [standards](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/LowLevelABI/140-x86-64_Function_Calling_Conventions/x86_64.html), with the addition of the context and error return registers discussed in the [ABI stability manifesto](https://github.com/apple/swift/blob/master/docs/ABIStabilityManifesto.md):
3+
From Swift 5, the calling convention register allocation for 64-bit architectures is largely based on [existing](https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html) [standards](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/LowLevelABI/140-x86-64_Function_Calling_Conventions/x86_64.html), with the addition of the context and error return registers discussed in the [ABI stability manifesto](https://github.com/apple/swift/blob/main/docs/ABIStabilityManifesto.md):
44

55
| Register Purpose | ARM64 | x86_64 |
66
| ------------- |:-------------:| ----- |

0 commit comments

Comments
 (0)