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 {
12211221 }
12221222 return true
12231223
1224- case is BeginAccessInst :
1224+ case let beginAccess as BeginAccessInst :
12251225 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 {
12281228 continue
12291229 }
12301230
@@ -1234,7 +1234,7 @@ private extension ScopedInstruction {
12341234 }
12351235 }
12361236
1237- switch operands . first! . value . accessPath. base {
1237+ switch beginAccess . address . accessPath. base {
12381238 case . class, . global:
12391239 for sideEffect in analyzedInstructions. loopSideEffects where sideEffect. mayRelease {
12401240 // 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