File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
SwiftCompilerSources/Sources/Optimizer/FunctionPasses Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1221,10 +1221,10 @@ private extension ScopedInstruction {
1221
1221
}
1222
1222
return true
1223
1223
1224
- case is BeginAccessInst :
1224
+ case let beginAccess as BeginAccessInst :
1225
1225
for fullApplyInst in analyzedInstructions. fullApplies {
1226
- guard mayWriteToMemory && fullApplyInst. mayReadOrWrite ( address: operands . first! . value , context. aliasAnalysis) ||
1227
- !mayWriteToMemory && fullApplyInst. mayWrite ( toAddress: operands . first! . value , context. aliasAnalysis) else {
1226
+ guard mayWriteToMemory && fullApplyInst. mayReadOrWrite ( address: beginAccess . address , context. aliasAnalysis) ||
1227
+ !mayWriteToMemory && fullApplyInst. mayWrite ( toAddress: beginAccess . address , context. aliasAnalysis) else {
1228
1228
continue
1229
1229
}
1230
1230
@@ -1234,7 +1234,7 @@ private extension ScopedInstruction {
1234
1234
}
1235
1235
}
1236
1236
1237
- switch operands . first! . value . accessPath. base {
1237
+ switch beginAccess . address . accessPath. base {
1238
1238
case . class, . global:
1239
1239
for sideEffect in analyzedInstructions. loopSideEffects where sideEffect. mayRelease {
1240
1240
// Since a class might have a deinitializer, hoisting begin/end_access pair could violate
You can’t perform that action at this time.
0 commit comments