Skip to content

Commit 7d1bd3e

Browse files
committed
Merge branch 'main' into observable_nonmarker
2 parents 536df86 + b03d8df commit 7d1bd3e

File tree

836 files changed

+25441
-18149
lines changed

Some content is hidden

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

836 files changed

+25441
-18149
lines changed

.github/CODEOWNERS

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
/include/swift/DependencyScan @artemcm
6363
/include/swift/Driver @artemcm
6464
# TODO: /include/swift/IRGen/
65-
/include/swift/IDE/ @ahoppen @bnbarham @rintaro
65+
/include/swift/IDE/ @ahoppen @bnbarham @rintaro @hamishknight
6666
/include/swift/Index/ @bnbarham
6767
/include/swift/Refactoring @ahoppen @bnbarham
6868
/include/swift/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
@@ -100,8 +100,8 @@
100100
/lib/DriverTool/swift_symbolgraph_extract_main.cpp @QuietMisdreavus
101101
/lib/Frontend/*ModuleInterface* @artemcm @tshortli
102102
# TODO: /lib/IRGen/
103-
/lib/IDE/ @ahoppen @bnbarham @rintaro
104-
/lib/IDETool/ @ahoppen @bnbarham @rintaro
103+
/lib/IDE/ @ahoppen @bnbarham @rintaro @hamishknight
104+
/lib/IDETool/ @ahoppen @bnbarham @rintaro @hamishknight
105105
/lib/Index/ @bnbarham
106106
/lib/Refactoring/ @ahoppen @bnbarham
107107
/lib/IRGen/*Coverage* @hamishknight
@@ -139,24 +139,26 @@
139139
# stdlib
140140
# TODO: /stdlib/
141141
/stdlib/public/Backtracing/ @al45tair
142+
/stdlib/public/Concurrency/ @ktoso @kavon
142143
/stdlib/public/Cxx/ @zoecarver @hyp @egorzhdan
143144
/stdlib/public/Distributed/ @ktoso
144145
/stdlib/public/Windows/ @compnerd
145146
/stdlib/public/libexec/swift-backtrace/ @al45tair
146147

147148
# test
148149
/test/ASTGen/ @zoecarver @CodaFi
150+
/test/Concurrency/ @ktoso @kavon
149151
/test/Constraints/ @hborla @xedin
150152
/test/DebugInfo/ @adrian-prantl
151153
/test/Distributed/ @ktoso
152154
/test/Driver/ @artemcm
153155
/test/Driver/static* @MaxDesiatov @etcwilde
154156
/test/Generics/ @hborla @slavapestov
155157
# TODO: /test/IRGen/
156-
/test/IDE/ @ahoppen @bnbarham @rintaro
158+
/test/IDE/ @ahoppen @bnbarham @rintaro @hamishknight
157159
/test/Index/ @bnbarham
158160
/test/refactoring/ @ahoppen @bnbarham
159-
/test/SourceKit/ @ahoppen @bnbarham @rintaro
161+
/test/SourceKit/ @ahoppen @bnbarham @rintaro @hamishknight
160162
/test/Interop/ @zoecarver @hyp @egorzhdan
161163
/test/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
162164
/test/Profiler @hamishknight
@@ -177,9 +179,9 @@
177179

178180
# tools
179181
# TODO: /tools
180-
/tools/SourceKit @ahoppen @bnbarham @rintaro
182+
/tools/SourceKit @ahoppen @bnbarham @rintaro @hamishknight
181183
/tools/lldb-moduleimport-test/ @adrian-prantl
182-
/tools/swift-ide-test @ahoppen @bnbarham @rintaro
184+
/tools/swift-ide-test @ahoppen @bnbarham @rintaro @hamishknight
183185
/tools/swift-refactor @ahoppen @bnbarham
184186

185187
# unittests
@@ -188,7 +190,7 @@
188190
/unittests/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
189191
# TODO: /unittests/SIL/
190192
/unittests/Sema/ @hborla @xedin
191-
/unittests/SourceKit/ @ahoppen @bnbarham @rintaro
193+
/unittests/SourceKit/ @ahoppen @bnbarham @rintaro @hamishknight
192194
# TODO: /unittests/stdlib/
193195

194196
# userdocs
@@ -209,7 +211,7 @@
209211

210212
# validation-test
211213
# TODO: /validation-test/IRGen/
212-
/validation-test/IDE/ @ahoppen @bnbarham @rintaro
214+
/validation-test/IDE/ @ahoppen @bnbarham @rintaro @hamishknight
213215
/validation-test/Parse/ @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
214216
# TODO: /validation-test/SIL/
215217
# TODO: /validation-test/SILGen/

SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,6 @@ import SIL
1616
struct AliasAnalysis {
1717
let bridged: BridgedAliasAnalysis
1818

19-
func mayRead(_ inst: Instruction, fromAddress: Value) -> Bool {
20-
switch bridged.getMemBehavior(inst.bridged, fromAddress.bridged) {
21-
case .MayRead, .MayReadWrite, .MayHaveSideEffects:
22-
return true
23-
default:
24-
return false
25-
}
26-
}
27-
28-
func mayWrite(_ inst: Instruction, toAddress: Value) -> Bool {
29-
switch bridged.getMemBehavior(inst.bridged, toAddress.bridged) {
30-
case .MayWrite, .MayReadWrite, .MayHaveSideEffects:
31-
return true
32-
default:
33-
return false
34-
}
35-
}
36-
37-
func mayReadOrWrite(_ inst: Instruction, address: Value) -> Bool {
38-
switch bridged.getMemBehavior(inst.bridged, address.bridged) {
39-
case .MayRead, .MayWrite, .MayReadWrite, .MayHaveSideEffects:
40-
return true
41-
default:
42-
return false
43-
}
44-
}
45-
4619
/// Returns the correct path for address-alias functions.
4720
static func getPtrOrAddressPath(for value: Value) -> SmallProjectionPath {
4821
let ty = value.type
@@ -119,6 +92,35 @@ struct AliasAnalysis {
11992
}
12093
}
12194

95+
extension Instruction {
96+
func mayRead(fromAddress: Value, _ aliasAnalysis: AliasAnalysis) -> Bool {
97+
switch aliasAnalysis.bridged.getMemBehavior(bridged, fromAddress.bridged) {
98+
case .MayRead, .MayReadWrite, .MayHaveSideEffects:
99+
return true
100+
default:
101+
return false
102+
}
103+
}
104+
105+
func mayWrite(toAddress: Value, _ aliasAnalysis: AliasAnalysis) -> Bool {
106+
switch aliasAnalysis.bridged.getMemBehavior(bridged, toAddress.bridged) {
107+
case .MayWrite, .MayReadWrite, .MayHaveSideEffects:
108+
return true
109+
default:
110+
return false
111+
}
112+
}
113+
114+
func mayReadOrWrite(address: Value, _ aliasAnalysis: AliasAnalysis) -> Bool {
115+
switch aliasAnalysis.bridged.getMemBehavior(bridged, address.bridged) {
116+
case .MayRead, .MayWrite, .MayReadWrite, .MayHaveSideEffects:
117+
return true
118+
default:
119+
return false
120+
}
121+
}
122+
}
123+
122124
private func getMemoryEffect(ofApply apply: ApplySite, for address: Value, path: SmallProjectionPath, _ context: FunctionPassContext) -> SideEffects.Memory {
123125
let calleeAnalysis = context.calleeAnalysis
124126
let visitor = SideEffectsVisitor(apply: apply, calleeAnalysis: calleeAnalysis, isAddress: true)

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ swift_compiler_sources(Optimizer
1111
CleanupDebugSteps.swift
1212
ComputeEscapeEffects.swift
1313
ComputeSideEffects.swift
14+
DeadStoreElimination.swift
1415
InitializeStaticGlobals.swift
1516
ObjectOutliner.swift
1617
ObjCBridgingOptimization.swift
@@ -19,4 +20,5 @@ swift_compiler_sources(Optimizer
1920
ReleaseDevirtualizer.swift
2021
SimplificationPasses.swift
2122
StackPromotion.swift
23+
StripObjectHeaders.swift
2224
)

0 commit comments

Comments
 (0)