Skip to content

Commit e90fc5f

Browse files
committed
libswift: add single-threaded pass docs, fix test
1 parent 42e6fac commit e90fc5f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AssumeSingleThreaded.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12+
//
13+
// Assume that user code is single-threaded.
14+
//
15+
// Convert all reference counting operations into non-atomic ones.
16+
//
17+
// To get rid of most atomic reference counting operations, the standard
18+
// library should be compiled in this mode as well .
19+
//
20+
// This pass affects only reference counting operations resulting from SIL
21+
// instructions. It wouldn't affect places in the runtime C++ code which
22+
// hard-code calls to retain/release. We could take advantage of the Instruments
23+
// instrumentation stubs to redirect calls from the runtime if it was
24+
// significant, or else just build a single-threaded variant of the runtime.
25+
//
26+
//===----------------------------------------------------------------------===//
1227

1328
import SIL
1429

test/sil-passpipeline-dump/basic.test-sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
// CHECK: passes: [ "serialize-sil", "ownership-model-eliminator" ]
99
// CHECK: ---
1010
// CHECK: name: Rest of Onone
11-
// CHECK: passes: [ "use-prespecialized", "sil-assume-single-threaded",
12-
// CHECK: "sil-debuginfo-gen" ]
11+
// CHECK: passes: [ "use-prespecialized", "onone-prespecializer", "sil-debuginfo-gen" ]
1312
// CHECK: ...

0 commit comments

Comments
 (0)