File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
SwiftCompilerSources/Sources/Optimizer/FunctionPasses Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1100,9 +1100,17 @@ private extension ScopedInstruction {
11001100 switch self {
11011101 case is BeginApplyInst :
11021102 return true // Has already been checked with other full applies.
1103- case is LoadBorrowInst :
1103+ case let loadBorrowInst as LoadBorrowInst :
1104+ for case let destroyAddrInst as DestroyAddrInst in analyzedInstructions. loopSideEffects {
1105+ if context. aliasAnalysis. mayAlias ( loadBorrowInst. address, destroyAddrInst. destroyedAddress) {
1106+ if !scope. contains ( destroyAddrInst) {
1107+ return false
1108+ }
1109+ }
1110+ }
1111+
11041112 for storeInst in analyzedInstructions. stores {
1105- if storeInst. mayWrite ( toAddress: operands . first! . value , context. aliasAnalysis) {
1113+ if storeInst. mayWrite ( toAddress: loadBorrowInst . address , context. aliasAnalysis) {
11061114 if !scope. contains ( storeInst) {
11071115 return false
11081116 }
You can’t perform that action at this time.
0 commit comments