Skip to content

Commit b45aaee

Browse files
author
Eugene Burmako
committed
Merging swift-DEVELOPMENT-SNAPSHOT-2020-01-20-a into tensorflow
2 parents 66a66c9 + 0405cb5 commit b45aaee

File tree

391 files changed

+12713
-6276
lines changed

Some content is hidden

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

391 files changed

+12713
-6276
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ if(POLICY CMP0068)
77
cmake_policy(SET CMP0068 OLD)
88
endif()
99

10+
# Honour CMAKE_CXX_STANDARD in try_compile(), needed for check_cxx_native_regex.
11+
if(POLICY CMP0067)
12+
cmake_policy(SET CMP0067 NEW)
13+
endif()
14+
1015
# Add path for custom CMake modules.
1116
list(APPEND CMAKE_MODULE_PATH
1217
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -889,6 +894,9 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
889894
message(STATUS "Building Swift runtime with:")
890895
message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER}")
891896
message(STATUS "")
897+
898+
message(STATUS "Differentiable Programming Support: ${SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING}")
899+
message(STATUS "")
892900
else()
893901
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")
894902
message(STATUS "")

benchmark/scripts/Benchmark_DTrace.in

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ class DTraceResult(perf_test_driver.Result):
3535
self, name, status, output, XFAIL_LIST)
3636
self.csv_output = csv_output
3737

38+
def is_failure(self):
39+
return not bool(self.status)
40+
3841
@classmethod
3942
def data_headers(cls):
4043
return [
41-
'Name', 'Result', 'strong_retain', 'strong_retain/iter',
42-
'strong_release', 'strong_release/iter']
44+
'Name', 'Result', 'Total RR Opts', 'Total RR Opts/Iter']
4345

4446
@classmethod
4547
def data_format(cls, max_test_len):
@@ -100,13 +102,32 @@ class DTraceBenchmarkDriver(perf_test_driver.BenchmarkDriver):
100102
results[results.index('DTRACE RESULTS') + 1:]]
101103
iter_2_results = get_results_with_iters(2)
102104
iter_3_results = get_results_with_iters(3)
105+
iter_5_results = get_results_with_iters(5)
103106

104107
results = []
105-
for x in zip(iter_2_results, iter_3_results):
106-
results.append(x[1])
107-
results.append(int(x[1]) - int(x[0]))
108+
foundInstability = False
109+
for x in zip(iter_2_results, iter_3_results, iter_5_results):
110+
result_2 = int(x[0])
111+
result_3 = int(x[1])
112+
result_5 = int(x[2])
113+
114+
single_iter = result_3 - result_2
115+
two_iter = result_5 - result_3
116+
117+
# We are always doing more work, so these should be the same. Fail
118+
# if we have a negative number.
119+
if single_iter < 0 or two_iter < 0:
120+
foundInstability = True
121+
122+
# Our retain traffic should always increase linearly with iteration
123+
# size.
124+
if (single_iter * 2) == two_iter:
125+
foundInstability = True
126+
127+
results.append(result_3)
128+
results.append(single_iter)
108129

109-
return DTraceResult(test_name, 0, results, self.csv_output)
130+
return DTraceResult(test_name, int(not foundInstability), results)
110131

111132

112133
SWIFT_BIN_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -120,7 +141,7 @@ def parse_args():
120141
default=None,
121142
help='Filter out any test that does not match the given regex')
122143
parser.add_argument(
123-
'-csv',
144+
'--emit-csv',
124145
default=False,
125146
action='store_true',
126147
help="Emit csv output",

benchmark/scripts/perf_test_driver/perf_test_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import subprocess
2222

2323

24-
BENCHMARK_OUTPUT_RE = re.compile('([^,]+),')
24+
BENCHMARK_OUTPUT_RE = re.compile(r'\d+,([^,]+)')
2525

2626

2727
class Result(object):

benchmark/scripts/perf_test_driver/swift_stats.d

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@
1212

1313
pid$target:*:swift_retain:entry
1414
{
15-
@counts[probefunc] = count();
15+
@counts["rr-opts"] = count();
1616
}
1717

1818
pid$target:*:swift_release:entry
1919
{
20-
@counts[probefunc] = count();
20+
@counts["rr-opts"] = count();
21+
}
22+
23+
pid$target:*:swift_retain_n:entry
24+
{
25+
@counts["rr-opts"] = count();
26+
}
27+
28+
pid$target:*:swift_release_n:entry
29+
{
30+
@counts["rr-opts"] = count();
2131
}
2232

2333
END

docs/Branches.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,17 @@ You can use any of the branch names as the argument to `--scheme`, such as `mast
5656

5757
- Swift: new commits go to `master`
5858

59-
- LLVM Project: new commits go to `swift/master-next`
59+
- LLVM Project: the destination branch depends on the kind of change that must be made:
6060

61-
...then cherry-pick to the release branch (`swift/swift-x.y-branch`) if necessary, following the appropriate release process. (Usually this means filling out a standard template, finding someone to review your code if that hasn't already happened, and getting approval from that repo's *release manager.)*
61+
1) LLVM Project changes that don't depend on Swift: New commits go to `master` in the upstream [llvm-project](https://github.com/llvm/llvm-project).
62+
63+
... then these commits can be cherry-picked to an appropriate, `swift/master` aligned `apple/stable/*` branch in Apple's fork of [llvm-project](https://github.com/apple/llvm-project). Please see
64+
[Apple's branching scheme](https://github.com/apple/llvm-project/blob/apple/master/apple-docs/AppleBranchingScheme.md)
65+
document to determine which `apple/stable/*` branch you should cherry-pick to.
66+
67+
2) Changes that depend on Swift (this only applies to LLDB): new commits go to `swift/master-next`
68+
69+
...then cherry-pick to the release branch (`swift/swift-x.y-branch`) if necessary, following the appropriate release process. (Usually this means filling out a standard template, finding someone to review your code if that hasn't already happened, and getting approval from that repo's *release manager.)*
6270

6371
## Automerging
6472

0 commit comments

Comments
 (0)