Skip to content

Commit 8668be2

Browse files
Merge pull request #1557 from swiftwasm/katei/merge-master-2020-08-08
Merge master 2020-08-08
2 parents b922205 + 575710d commit 8668be2

File tree

933 files changed

+31553
-12959
lines changed

Some content is hidden

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

933 files changed

+31553
-12959
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ docs/_build
4141
.vs
4242

4343
# clangd
44+
.cache
4445
.clangd
4546

4647
#==============================================================================#

CMakeLists.txt

+24-7
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ include(CheckSymbolExists)
5454
# This is primarily to support building smaller or faster project files.
5555
#
5656

57+
option(SWIFT_APPEND_VC_REV
58+
"Embed the version control system revision in Swift"
59+
TRUE)
60+
5761
option(SWIFT_INCLUDE_TOOLS
5862
"Generate build targets for swift tools"
5963
TRUE)
@@ -365,6 +369,11 @@ option(SWIFT_REPORT_STATISTICS
365369
"Create json files which contain internal compilation statistics"
366370
FALSE)
367371

372+
# FIXME(wasm) Reflection tests are temporalily disabled due to lack of linker features
373+
option(SWIFTWASM_DISABLE_REFLECTION_TEST
374+
"Disable building swift-reflection-test for WebAssembly build"
375+
FALSE)
376+
368377
#
369378
# User-configurable experimental options. Do not use in production builds.
370379
#
@@ -398,6 +407,10 @@ option(SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING
398407
"Enable experimental Swift differentiable programming features"
399408
FALSE)
400409

410+
option(SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY
411+
"Enable experimental Swift concurrency model"
412+
FALSE)
413+
401414
#
402415
# End of user-configurable options.
403416
#
@@ -848,6 +861,7 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
848861
message(STATUS "")
849862

850863
message(STATUS "Differentiable Programming Support: ${SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING}")
864+
message(STATUS "Concurrency Support: ${SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY}")
851865
message(STATUS "")
852866
else()
853867
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")
@@ -920,13 +934,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
920934
endif()
921935

922936
find_package(Python2 COMPONENTS Interpreter REQUIRED)
923-
find_package(Python3 COMPONENTS Interpreter)
924-
if(NOT Python3_Interpreter_FOUND)
925-
message(WARNING "Python3 not found, using python2 as a fallback")
926-
add_executable(Python3::Interpreter IMPORTED)
927-
set_target_properties(Python3::Interpreter PROPERTIES
928-
IMPORTED_LOCATION ${Python2_EXECUTABLE})
929-
endif()
937+
find_package(Python3 COMPONENTS Interpreter REQUIRED)
930938

931939
#
932940
# Find optional dependencies.
@@ -1137,6 +1145,15 @@ if(SWIFT_INCLUDE_TOOLS)
11371145
# Refer to the large comment above the add_subdirectory(stdlib) call.
11381146
# https://bugs.swift.org/browse/SR-5975
11391147
add_subdirectory(tools)
1148+
1149+
# Localization targets are configured in a way that assume the swift
1150+
# frontend is being built, so trying to include them for other builds
1151+
# (like stdlib) fail!
1152+
#
1153+
# Diagnostics information is only useful for the frontend compiler
1154+
# anyway, so let's only include it if the compiler is being built,
1155+
# which at the moment seems like if SWIFT_INCLUDE_TOOLS is defined.
1156+
add_subdirectory(localization)
11401157
endif()
11411158

11421159
add_subdirectory(utils)

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ more links in the SwiftWasm ecosystem.
2828
| **OS** | **Architecture** | **Build** |
2929
|---|:---:|:---:|
3030
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le)|
31-
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
32-
|**[Ubuntu 18.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_18.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-18.04-aarch64)|
31+
|**[Ubuntu 18.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_18.04_docker.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-ubuntu-18.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-ubuntu-18.04-aarch64)|
32+
|**[Ubuntu 20.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_20.04_docker.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-ubuntu-20.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-ubuntu-20.04-aarch64)|
33+
|**[CentOS 8 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_centos_8_docker.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-centos8-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-centos8-aarch64)|
34+
|**[Amazon Linux 2](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_amazon_linux_2_docker.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-amazon-linux-2-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-amazon-linux-2-aarch64)|
3335
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
3436
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64)|
3537
|**[Windows 2019 (VS 2017)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_windows_2019.json)** | x86_64 | [![Build Status](https://ci-external.swift.org/job/oss-swift-windows-x86_64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-windows-x86_64)|
@@ -108,7 +110,7 @@ Please make sure you use Python 2.x. Python 3.x is not supported currently.
108110

109111
#### macOS
110112

111-
To build for macOS, you need [Xcode 12 beta](https://developer.apple.com/xcode/resources/).
113+
To build for macOS, you need [Xcode 12 beta 3](https://developer.apple.com/xcode/resources/).
112114
The required version of Xcode changes frequently, and is often a beta release.
113115
Check this document or the host information on <https://ci.swift.org> for the
114116
current required version.

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

+8-1
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,17 @@ function (swift_benchmark_compile_archopts)
367367
"-F" "${sdk}/../../../Developer/Library/Frameworks"
368368
"-sdk" "${sdk}"
369369
"-no-link-objc-runtime")
370+
371+
# If we are not compiling at -Onone and are performing WMO, always emit
372+
# optimization-records.
373+
if(NOT ${optflag} STREQUAL "Onone" AND "${bench_flags}" MATCHES "-whole-module.*")
374+
list(APPEND common_options "-save-optimization-record=bitstream")
375+
endif()
370376
endif()
371377

372378
set(opt_view_main_dir)
373379
if(SWIFT_BENCHMARK_GENERATE_OPT_VIEW AND LLVM_HAVE_OPT_VIEWER_MODULES)
374380
if(NOT ${optflag} STREQUAL "Onone" AND "${bench_flags}" MATCHES "-whole-module.*")
375-
list(APPEND common_options "-save-optimization-record")
376381
set(opt_view_main_dir "${objdir}/opt-view")
377382
endif()
378383
endif()
@@ -737,11 +742,13 @@ function(swift_benchmark_compile)
737742
add_custom_target("check-${executable_target}"
738743
COMMAND "${swift-bin-dir}/Benchmark_Driver" "run"
739744
"-o" "O" "--output-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"
745+
"--architecture" "${arch}"
740746
"--swift-repo" "${SWIFT_SOURCE_DIR}"
741747
"--independent-samples" "${SWIFT_BENCHMARK_NUM_O_ITERATIONS}"
742748
COMMAND "${swift-bin-dir}/Benchmark_Driver" "run"
743749
"-o" "Onone" "--output-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"
744750
"--swift-repo" "${SWIFT_SOURCE_DIR}"
751+
"--architecture" "${arch}"
745752
"--independent-samples" "${SWIFT_BENCHMARK_NUM_ONONE_ITERATIONS}"
746753
COMMAND "${swift-bin-dir}/Benchmark_Driver" "compare"
747754
"--log-dir" "${CMAKE_CURRENT_BINARY_DIR}/logs"

benchmark/scripts/Benchmark_Driver

+6
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,12 @@ def parse_args(args):
919919
help="optimization level to use: {O,Onone,Osize}, (default: O)",
920920
default="O",
921921
)
922+
shared_benchmarks_parser.add_argument(
923+
"--architecture",
924+
metavar="architecture",
925+
help="current architecture (e.g., x86_64, arm64, etc)",
926+
default=None,
927+
)
922928

923929
run_parser = subparsers.add_parser(
924930
"run",

benchmark/scripts/compare_perf_tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,9 @@ def compare(name):
551551

552552
comparisons = list(map(compare, comparable_tests))
553553

554-
def partition(l, p):
554+
def partition(items, p):
555555
return functools.reduce(
556-
lambda x, y: x[not p(y)].append(y) or x, l, ([], [])
556+
lambda x, y: x[not p(y)].append(y) or x, items, ([], [])
557557
)
558558

559559
decreased, not_decreased = partition(

benchmark/scripts/perf_test_driver/perf_test_driver.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
from __future__ import print_function
1616

1717
import functools
18+
import glob
1819
import multiprocessing
1920
import os
21+
import platform
2022
import re
2123
import subprocess
2224

@@ -80,6 +82,22 @@ def _unwrap_self(args):
8082
return type(args[0]).process_input(*args)
8183

8284

85+
def get_benchmark_executable(binary_dir, opt_level):
86+
suffix = opt_level + "-" + platform.machine() + "*"
87+
pattern = os.path.join(binary_dir, "Benchmark_" + suffix)
88+
executables = glob.glob(pattern)
89+
if len(executables) == 0:
90+
raise ValueError(
91+
"No benchmark executable for file name pattern " +
92+
pattern + " found")
93+
if len(executables) > 1:
94+
raise ValueError(
95+
"Multiple benchmark executables for file name pattern " +
96+
pattern + " found\n" +
97+
str(executables))
98+
return executables[0]
99+
100+
83101
BenchmarkDriver_OptLevels = ["Onone", "O", "Osize"]
84102

85103

@@ -92,7 +110,7 @@ def __init__(
92110
opt_levels=BenchmarkDriver_OptLevels,
93111
):
94112
self.targets = [
95-
(os.path.join(binary_dir, "Benchmark_%s" % o), o) for o in opt_levels
113+
(get_benchmark_executable(binary_dir, o), o) for o in opt_levels
96114
]
97115
self.xfail_list = xfail_list
98116
self.enable_parallel = enable_parallel
@@ -112,8 +130,8 @@ def run_for_opt_level(self, binary, opt_level, test_filter):
112130
print("testing driver at path: %s" % binary)
113131
names = []
114132
output = subprocess.check_output([binary, "--list"], universal_newlines=True)
115-
for l in output.split("\n")[1:]:
116-
m = BENCHMARK_OUTPUT_RE.match(l)
133+
for line in output.split("\n")[1:]:
134+
m = BENCHMARK_OUTPUT_RE.match(line)
117135
if m is None:
118136
continue
119137
names.append(m.group(1))

0 commit comments

Comments
 (0)