Commit e3440f6
committed
[6.1] SIL: builtin willThrow does not modify memory or release
This enables access enforcement analysis to classify a dynamic begin_access in
access patterns (such as the one below) involving a throwing function as not
having nested conflicts.
```
struct Stack {
var items : [UInt8]
mutating func pop() throws -> UInt8 {
guard let item = items.popLast() else { throw SomeErr.err }
return item
}
...
}
class Container {
private var ref : Stack
@inline(never)
internal func someMethod() throws {
try ref.pop()
}
...
}
```
Scope: Performance improvement
Risk: Medium, we are changing the side-effects of willThrow which should
not matter all that match. There is a second order effect: other wrongly
computed/assigned could now become visible.
Original PR: swiftlang#78091
Reviewed by: Erik Eckstein
rdar://141182074
(cherry picked from commit fa01d8d)1 parent 714ecbd commit e3440f6
File tree
3 files changed
+39
-0
lines changed- lib/SIL/IR
- test/SILOptimizer
3 files changed
+39
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
| 1000 | + | |
| 1001 | + | |
1000 | 1002 | | |
1001 | 1003 | | |
1002 | 1004 | | |
| |||
1188 | 1190 | | |
1189 | 1191 | | |
1190 | 1192 | | |
| 1193 | + | |
1191 | 1194 | | |
1192 | 1195 | | |
1193 | 1196 | | |
| |||
1497 | 1500 | | |
1498 | 1501 | | |
1499 | 1502 | | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
1500 | 1511 | | |
1501 | 1512 | | |
1502 | 1513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1697 | 1697 | | |
1698 | 1698 | | |
1699 | 1699 | | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
1243 | 1246 | | |
1244 | 1247 | | |
1245 | 1248 | | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
0 commit comments