Commit 3d898f7
committed
SwiftCompilerSources/SIL: More robust
ac61901 backfired when building the
stdlib on rebranch. This time the problem is reversed: we should be
interpreting an integer as unsigned where we no longer do, here:
https://github.com/swiftlang/swift/blob/8f7af45115e373e05d3419ab272f02700bd8a48c/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift#L78.
Rather than treating integers as signed by default, make
`Builder.createIntegerLiteral` accept a generic `FixedWidthInteger`, and
manipulate the value based on the generic type argument's signedness.
This doesn't entirely define away unintentional sign extensions, but
makes this mistake of humouring the parameter type less likely.IntegerLiteralInst construction1 parent 8f7af45 commit 3d898f7
File tree
2 files changed
+28
-9
lines changed- SwiftCompilerSources/Sources
- Optimizer/InstructionSimplification
- SIL
2 files changed
+28
-9
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
197 | 214 | | |
198 | | - | |
199 | | - | |
| 215 | + | |
| 216 | + | |
200 | 217 | | |
201 | 218 | | |
202 | | - | |
| 219 | + | |
| 220 | + | |
203 | 221 | | |
204 | 222 | | |
205 | | - | |
| 223 | + | |
| 224 | + | |
206 | 225 | | |
207 | 226 | | |
208 | 227 | | |
| |||
0 commit comments