Commit 273874c
committed
ConstantCapturePropagation: don't propagate keypaths with multiple uses in non-OSSA
We cannot do this because we don't know where to insert the compensating release after the propagated `partial_apply`.
A required `strong_retain` may have been moved over the `partial_apply`.
Then we would release the keypath too early.
Fixes a mis-compile
rdar://1613216141 parent 1262647 commit 273874c
File tree
2 files changed
+38
-6
lines changed- SwiftCompilerSources/Sources/Optimizer/FunctionPasses
- test/SILOptimizer
2 files changed
+38
-6
lines changedLines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
360 | | - | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
| 365 | + | |
363 | 366 | | |
364 | 367 | | |
365 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
366 | 371 | | |
367 | | - | |
| 372 | + | |
368 | 373 | | |
369 | | - | |
| 374 | + | |
370 | 375 | | |
371 | 376 | | |
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
376 | 381 | | |
377 | | - | |
| 382 | + | |
378 | 383 | | |
379 | 384 | | |
380 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
381 | 390 | | |
382 | 391 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
561 | 584 | | |
562 | 585 | | |
563 | 586 | | |
| |||
0 commit comments