Commit 1b23d6f
authored
Improve compare-and-branch sequences produced by Emitter (#111797)
* Improve compare-and-branch sequences produced by Emitter
Introduces an overload of `genJumpToThrowHlpBlk` that allows you to pass
a function that generates the branch code, before it creates an inline
throw block. This allows us to choose compare-and-branch sequences such
as `cbz` on ARM64 for checks added in the emitter, such as divide-by-zero.
* Optimize bounds checks for zero index on ARM64
Emit `cbz` instead of `cmp+b.ls` when checking bounds for an access to the
0 index of an array. It can only throw when `arrayLength == 0`.
Fixes #42514
* Move `genGetThrowHelper` to codegenarm64.cpp
* Use `GetRegNum` instead of `GetReg`1 parent f6c74b8 commit 1b23d6f
File tree
3 files changed
+129
-3
lines changed- src/coreclr/jit
3 files changed
+129
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
233 | 288 | | |
234 | 289 | | |
235 | 290 | | |
| |||
1285 | 1340 | | |
1286 | 1341 | | |
1287 | 1342 | | |
| 1343 | + | |
| 1344 | + | |
1288 | 1345 | | |
1289 | 1346 | | |
1290 | 1347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
3625 | | - | |
3626 | | - | |
3627 | | - | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
3628 | 3629 | | |
3629 | 3630 | | |
3630 | 3631 | | |
| |||
5071 | 5072 | | |
5072 | 5073 | | |
5073 | 5074 | | |
| 5075 | + | |
| 5076 | + | |
| 5077 | + | |
| 5078 | + | |
| 5079 | + | |
| 5080 | + | |
| 5081 | + | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
| 5085 | + | |
| 5086 | + | |
| 5087 | + | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
| 5091 | + | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
| 5096 | + | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
5074 | 5103 | | |
5075 | 5104 | | |
5076 | 5105 | | |
| |||
5939 | 5968 | | |
5940 | 5969 | | |
5941 | 5970 | | |
| 5971 | + | |
| 5972 | + | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
| 5980 | + | |
| 5981 | + | |
| 5982 | + | |
| 5983 | + | |
| 5984 | + | |
| 5985 | + | |
| 5986 | + | |
| 5987 | + | |
| 5988 | + | |
| 5989 | + | |
| 5990 | + | |
| 5991 | + | |
| 5992 | + | |
| 5993 | + | |
5942 | 5994 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
1477 | 1494 | | |
1478 | 1495 | | |
1479 | 1496 | | |
| |||
0 commit comments