Commit db172b4
JIT: Extract all side effects of the index in optRemoveRangeCheck (#92210)
optRemoveRangeCheck extracts only GTF_ASG from the bounds check. If the
BOUNDS_CHECK is complex, that results in silently dropping side effects
on the floor (see the example case).
The ideal fix is that we should always extract all side effects from the
index and length operands, however this has large regressions because
the length typically has an ARR_LENGTH that we then extract. This PR
instead has a surgical fix for the problem case that can be backported
to .NET 8. It extracts all side effects from the index, but keeps
extracting only GTF_ASG from the length to get around the issue
mentioned above.
Fix #91862
Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>1 parent 6c9a743 commit db172b4
File tree
4 files changed
+63
-3
lines changed- src
- coreclr/jit
- tests/JIT/Regression/JitBlue
- Runtime_91576
- Runtime_91862
4 files changed
+63
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8875 | 8875 | | |
8876 | 8876 | | |
8877 | 8877 | | |
8878 | | - | |
| 8878 | + | |
| 8879 | + | |
| 8880 | + | |
| 8881 | + | |
| 8882 | + | |
| 8883 | + | |
8879 | 8884 | | |
8880 | | - | |
| 8885 | + | |
| 8886 | + | |
8881 | 8887 | | |
8882 | 8888 | | |
8883 | 8889 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments