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 {
1100
1100
switch self {
1101
1101
case is BeginApplyInst :
1102
1102
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
+
1104
1112
for storeInst in analyzedInstructions. stores {
1105
- if storeInst. mayWrite ( toAddress: operands . first! . value , context. aliasAnalysis) {
1113
+ if storeInst. mayWrite ( toAddress: loadBorrowInst . address , context. aliasAnalysis) {
1106
1114
if !scope. contains ( storeInst) {
1107
1115
return false
1108
1116
}
You can’t perform that action at this time.
0 commit comments