Commit b80a08e
committed
CodeMotion: check the ownership of arguments when sinking arguments
So far we only checked the ownership of incoming values.
But even if the incoming instruction has no ownership, the argument may have.
This can happen with enums which are constructed with a non-payload case:
%1 = enum $Optional<C>, #Optional.none!enumelt
br bb3(%1)
bb1(%3 : @owned $Optional<C>):
Fixes an ownership verification error:
rdar://1425063001 parent db96d63 commit b80a08e
File tree
2 files changed
+32
-0
lines changed- lib/SILOptimizer/Transforms
- test/SILOptimizer
2 files changed
+32
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
1187 | 1197 | | |
1188 | 1198 | | |
1189 | 1199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
555 | 577 | | |
556 | 578 | | |
557 | 579 | | |
| |||
0 commit comments