Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9f53d4a
[Runtime] Have ConcurrentReadableHashMap store indices inline when th…
mikeash Oct 22, 2020
7178406
Add IndexPath benchmarks
micahbenn Nov 1, 2020
3d40513
Fix formatting
micahbenn Nov 1, 2020
e69b71f
Update per style guildelines
micahbenn Nov 1, 2020
13a6385
Fix indentation, move params to new line
micahbenn Nov 1, 2020
fe5d276
Apply swift-format
micahbenn Nov 2, 2020
55b3b34
Decrease load 16x, fix naming, fix mem usage
micahbenn Nov 2, 2020
6f103c6
Pre-construct indexPath, use setUpFunction
micahbenn Nov 2, 2020
fd5b87f
[Runtime] Don't write to rodata if values already match.
mikeash Nov 6, 2020
477bef7
Condense benchmarks
micahbenn Nov 7, 2020
dcdf668
[stdlib] Resolve relative address in consistent way
kateinoigakukun Nov 9, 2020
25bd5ea
Fix styling, optimize
micahbenn Nov 9, 2020
79e2060
Exempt Swift Interface Files From Whole-Module ObjC Errors
CodaFi Nov 10, 2020
00b35b7
[windows] Mark crash-in-user-code as UNSUPPORTED in VS2017
drodriguez Nov 9, 2020
eadefc0
AccessPath: Add init_enum_data_addr to "access projections" set.
atrick Nov 10, 2020
7c968c6
AST: support availability on Windows
compnerd Oct 26, 2020
6934857
Sema: Tweak associated conformance exportability diagnostics
slavapestov Nov 6, 2020
972cd5c
Sema: Check associated conformance availability
slavapestov Nov 9, 2020
db394c5
Sema: Don't emit 'add @available attribute' fixit on implicit declara…
slavapestov Nov 10, 2020
241559d
[Serialization] Add an option to output modules regardless of errors
bnbarham Oct 22, 2020
a723cf7
Merge pull request #34535 from micahbenn/main
eeckstein Nov 10, 2020
5a8b1ae
Merge pull request #34616 from mikeash/writers-block
mikeash Nov 10, 2020
f4b86c9
Build libdispatch with its own module cache (#34638)
edymtt Nov 10, 2020
fe3415f
Merge pull request #34654 from atrick/fix-loadborrow-initenum
atrick Nov 10, 2020
51a75b7
[test] Fix test/SourceKit/CursorInfo/invalid_offset
benlangmuir Nov 10, 2020
58f7ac6
Merge pull request #34652 from CodaFi/a-mirror-into-the-soul-of-the-c…
CodaFi Nov 10, 2020
10b6b9d
[Dependency Scanner] Share `ModuleDependenciesCache` as a part of the…
artemcm Nov 9, 2020
f16c4ba
[ownership] Convert ValueOwnershipKind to have an Invalid state inste…
gottesmm Nov 8, 2020
d765f23
Merge pull request #34653 from drodriguez/windows-unsupported-msvc-20…
drodriguez Nov 10, 2020
3b192b7
[NFC] Add back a higher polynomial threshold for rdar18360240.swift.gyb
hborla Nov 10, 2020
b402827
Merge pull request #34439 from compnerd/unavailable
compnerd Nov 10, 2020
1b376cd
Merge pull request #34463 from mikeash/concurrentreadablehashmap-inli…
mikeash Nov 10, 2020
5598a60
CMake: generate SupportedFeatures.json while building and install it …
nkcsgexi Nov 10, 2020
9d4341e
Merge pull request #34657 from benlangmuir/fix-cursor-test
benlangmuir Nov 10, 2020
1ff9147
Merge pull request #34659 from gottesmm/pr-5755ffcaf1433708dd6843521b…
gottesmm Nov 10, 2020
9a67f53
Merge pull request #34660 from hborla/array-scale-test-threshold
hborla Nov 10, 2020
3e3be76
Merge pull request #34646 from artemcm/BatchScanShouldShareCache
artemcm Nov 10, 2020
e201c73
Merge pull request #34631 from kateinoigakukun/use-_resolveRelativeAd…
CodaFi Nov 10, 2020
b0577b0
Merge pull request #34472 from bnbarham/benb/allow-errors-69815975
bnbarham Nov 10, 2020
86a8d57
Merge pull request #34655 from nkcsgexi/install-feature-json
nkcsgexi Nov 10, 2020
fe1c4a4
Merge pull request #34651 from slavapestov/assoc-conformance-availabi…
slavapestov Nov 10, 2020
9604e26
Merge remote-tracking branch 'apple/main' into katei/merge-main-2020-…
kateinoigakukun Nov 10, 2020
b1ea7d8
set SKIP_XCODE_VERSION_CHECK
kateinoigakukun Nov 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ jobs:
sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer/
xcodebuild -version
./utils/webassembly/ci.sh
env:
SKIP_XCODE_VERSION_CHECK: 1 # Skip upstream update the compatible Xcode version
- name: Upload macOS installable archive
uses: actions/upload-artifact@v1
with:
Expand Down
1 change: 1 addition & 0 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ set(SWIFT_BENCH_MODULES
single-source/Hash
single-source/Histogram
single-source/HTTP2StateMachine
single-source/IndexPathTest
single-source/InsertCharacter
single-source/IntegerParsing
single-source/Integrate
Expand Down
134 changes: 134 additions & 0 deletions benchmark/single-source/IndexPathTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
//===--- IndexPathTest.swift ----------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import Foundation
import TestsUtils

let size = 200
let increasingIndexPath = indexPath(size)
let decreasingIndexPath = indexPath(size, reversed: true)
let increasingMaxMiddleIndexPath = indexPath(size, middle: size + 1)
let increasingMinMiddleIndexPath = indexPath(size, middle: -1)
let tags: [BenchmarkCategory] = [.validation, .api, .IndexPath]

public let IndexPathTest = [
BenchmarkInfo(
name: "IndexPath.Subscript.Mutation",
runFunction: run_IndexPathSubscriptMutation,
tags: tags,
setUpFunction: { blackHole(increasingIndexPath) }),
BenchmarkInfo(
name: "IndexPath.Subscript.Range.Mutation",
runFunction: run_IndexPathSubscriptRangeMutation,
tags: tags,
setUpFunction: { blackHole(increasingIndexPath) }),
BenchmarkInfo(
name: "IndexPath.Max",
runFunction: run_IndexPathMax,
tags: tags,
setUpFunction: {
blackHole(decreasingIndexPath)
blackHole(increasingMaxMiddleIndexPath)
blackHole(increasingIndexPath)
}),
BenchmarkInfo(
name: "IndexPath.Min",
runFunction: run_IndexPathMin,
tags: tags,
setUpFunction: {
blackHole(increasingIndexPath)
blackHole(increasingMinMiddleIndexPath)
blackHole(decreasingIndexPath)
}),
]

func indexPath(_ size: Int, reversed: Bool = false) -> IndexPath {
let indexes = Array(0..<size)
return IndexPath(indexes: reversed ? indexes.reversed() : indexes)
}

func indexPath(_ size: Int, middle: Int) -> IndexPath {
var indexes = Array(0..<size)
indexes.insert(middle, at: (indexes.count - 1) / 2)
return IndexPath(indexes: indexes)
}

// Subscript Mutations

@inline(__always)
func subscriptMutation(
n: Int,
mutations: Int,
indexPath: IndexPath,
mutate: (inout IndexPath, Int) -> Void
) {
for _ in 0..<n {
for i in 0..<mutations {
var ip = indexPath
mutate(&ip, i)
}
}
}

@inline(never)
public func run_IndexPathSubscriptMutation(_ n: Int) {
subscriptMutation(
n: n * 10, mutations: size, indexPath: increasingIndexPath,
mutate: { ip, i in
ip[i % 4] += 1
})
}

@inline(never)
public func run_IndexPathSubscriptRangeMutation(_ n: Int) {
subscriptMutation(
n: n, mutations: size, indexPath: increasingIndexPath,
mutate: { ip, i in
ip[0..<i] += [i]
})
}

// Max

@inline(never)
public func run_IndexPathMax(_ n: Int) {
for _ in 0..<n * 10 {
var val: Int?
// Beginning max
val = decreasingIndexPath.max()
blackHole(val)
// Middle max
val = increasingMaxMiddleIndexPath.max()
blackHole(val)
// End max
val = increasingIndexPath.max()
blackHole(val)
}
}

// Min

@inline(never)
public func run_IndexPathMin(_ n: Int) {
for _ in 0..<n * 10 {
var val: Int?
// Beginning min
val = increasingIndexPath.min()
blackHole(val)
// Middle min
val = increasingMinMiddleIndexPath.min()
blackHole(val)
// End min
val = decreasingIndexPath.min()
blackHole(val)
}
}
2 changes: 1 addition & 1 deletion benchmark/utils/TestsUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum BenchmarkCategory : String {
// we know is important to measure.
case validation
// subsystems to validate and their subcategories.
case api, Array, String, Dictionary, Codable, Set, Data
case api, Array, String, Dictionary, Codable, Set, Data, IndexPath
case sdk
case runtime, refcount, metadata
// Other general areas of compiled code validation.
Expand Down
2 changes: 2 additions & 0 deletions benchmark/utils/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import Hanoi
import Hash
import Histogram
import HTTP2StateMachine
import IndexPathTest
import InsertCharacter
import IntegerParsing
import Integrate
Expand Down Expand Up @@ -274,6 +275,7 @@ registerBenchmark(Hanoi)
registerBenchmark(HashTest)
registerBenchmark(Histogram)
registerBenchmark(HTTP2StateMachine)
registerBenchmark(IndexPathTest)
registerBenchmark(InsertCharacter)
registerBenchmark(IntegerParsing)
registerBenchmark(IntegrateTest)
Expand Down
8 changes: 2 additions & 6 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -2758,12 +2758,8 @@ ERROR(conformance_from_implementation_only_module,none,
"the conformance is declared as SPI in %3|"
"the conformance is declared as SPI}4",
(Type, Identifier, unsigned, Identifier, unsigned))
ERROR(assoc_conformance_from_implementation_only_module,none,
"cannot use conformance of %0 to %1 in associated type %3 (inferred as "
"%4); %select{%2 has been imported as implementation-only|"
"the conformance is declared as SPI in %2|"
"the conformance is declared as SPI}5",
(Type, Identifier, Identifier, Type, Type, unsigned))
NOTE(assoc_conformance_from_implementation_only_module,none,
"in associated type %0 (inferred as %1)", (Type, Type))
ERROR(unexportable_clang_function_type,none,
"cannot export the underlying C type of the function type %0; "
"it may use anonymous types or types defined outside of a module",
Expand Down
1 change: 1 addition & 0 deletions include/swift/AST/PlatformKinds.def
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ AVAILABILITY_PLATFORM(macOSApplicationExtension, "application extensions for mac
AVAILABILITY_PLATFORM(macCatalyst, "Mac Catalyst")
AVAILABILITY_PLATFORM(macCatalystApplicationExtension, "application extensions for Mac Catalyst")
AVAILABILITY_PLATFORM(OpenBSD, "OpenBSD")
AVAILABILITY_PLATFORM(Windows, "Windows")

#undef AVAILABILITY_PLATFORM
4 changes: 4 additions & 0 deletions include/swift/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ namespace swift {
/// TODO: remove this when @_implementationOnly modules are robust enough.
bool AllowDeserializingImplementationOnly = false;

// Allow errors during module generation. See corresponding option in
// FrontendOptions.
bool AllowModuleWithCompilerErrors = false;

/// Sets the target we are building for and updates platform conditions
/// to match.
///
Expand Down
7 changes: 7 additions & 0 deletions include/swift/Frontend/Frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ class CompilerInstance {
std::unique_ptr<Lowering::TypeConverter> TheSILTypes;
std::unique_ptr<DiagnosticVerifier> DiagVerifier;

/// A cache describing the set of inter-module dependencies that have been queried.
/// Null if not present.
std::unique_ptr<ModuleDependenciesCache> ModDepCache;

/// Null if no tracker.
std::unique_ptr<DependencyTracker> DepTracker;
/// If there is no stats output directory by the time the
Expand Down Expand Up @@ -487,6 +491,8 @@ class CompilerInstance {
DependencyTracker *getDependencyTracker() { return DepTracker.get(); }
const DependencyTracker *getDependencyTracker() const { return DepTracker.get(); }

ModuleDependenciesCache *getModuleDependencyCache() { return ModDepCache.get(); }

UnifiedStatsReporter *getStatsReporter() const { return Stats.get(); }

/// Retrieve the main module containing the files being compiled.
Expand Down Expand Up @@ -552,6 +558,7 @@ class CompilerInstance {
bool setUpVirtualFileSystemOverlays();
void setUpLLVMArguments();
void setUpDiagnosticOptions();
void setUpModuleDependencyCacheIfNeeded();
bool setUpModuleLoaders();
bool setUpInputs();
bool setUpASTContextIfNeeded();
Expand Down
6 changes: 6 additions & 0 deletions include/swift/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ class FrontendOptions {
/// any merge-modules jobs.
bool EnableExperimentalCrossModuleIncrementalBuild = false;

/// Best effort to output a .swiftmodule regardless of any compilation
/// errors. SIL generation and serialization is skipped entirely when there
/// are errors. The resulting serialized AST may include errors types and
/// skip nodes entirely, depending on the errors involved.
bool AllowModuleWithCompilerErrors = false;

/// The different modes for validating TBD against the LLVM IR.
enum class TBDValidationMode {
Default, ///< Do the default validation for the current platform.
Expand Down
5 changes: 5 additions & 0 deletions include/swift/Option/FrontendOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -779,4 +779,9 @@ def experimental_skip_all_function_bodies:
Flag<["-"], "experimental-skip-all-function-bodies">,
HelpText<"Skip type-checking function bodies and all SIL generation">;

def experimental_allow_module_with_compiler_errors:
Flag<["-"], "experimental-allow-module-with-compiler-errors">,
Flags<[HelpHidden]>,
HelpText<"Attempt to output .swiftmodule, regardless of compilation errors">;

} // end let Flags = [FrontendOption, NoDriverOption, HelpHidden]
Loading