Commit ffcb014
authored
JIT: Avoid reordering operands in fgMorphModToSubMulDiv (#71615)
* JIT: Avoid reordering operands in fgMorphModToSubMulDiv
fgMorphModToSubMulDiv tries to check if it is ok to "clone" locals
instead of spilling them by checking for address exposure. This was
necessary because GTF_GLOB_REF is not up-to-date in preorder during
morph, which is when this runs. However, address exposure is not valid
for implicit byrefs at this point, so the check is not enough.
The logic is trying to figure out which of the operands need to be
spilled and which of them can be cloned. However, the logic was also
wrong in the face of potential embedded assignments. Thus, rework it to
be a bit more conservative but correct.
As part of this, remove fgIsSafeToClone and make fgMakeMultiUse less
conservative by avoiding checking for address exposure. This was
probably an attempt at some limited interference checks, but from what I
could see other uses do not need this.
Fix #65118
* Add a test
* Revert unnecessary change
* Switch to gtCloneExpr1 parent a33b9d8 commit ffcb014
File tree
4 files changed
+99
-43
lines changed- src
- coreclr/jit
- tests/JIT/Regression/JitBlue/Runtime_71600
4 files changed
+99
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5574 | 5574 | | |
5575 | 5575 | | |
5576 | 5576 | | |
5577 | | - | |
5578 | 5577 | | |
5579 | 5578 | | |
5580 | 5579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
1788 | | - | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
1796 | | - | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
1800 | | - | |
1801 | | - | |
1802 | | - | |
1803 | | - | |
1804 | | - | |
1805 | | - | |
1806 | | - | |
1807 | | - | |
1808 | | - | |
1809 | | - | |
1810 | | - | |
1811 | | - | |
1812 | | - | |
1813 | | - | |
1814 | | - | |
1815 | | - | |
1816 | | - | |
1817 | | - | |
1818 | | - | |
1819 | | - | |
1820 | | - | |
1821 | 1788 | | |
1822 | 1789 | | |
1823 | 1790 | | |
| |||
1865 | 1832 | | |
1866 | 1833 | | |
1867 | 1834 | | |
1868 | | - | |
1869 | | - | |
1870 | | - | |
1871 | | - | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
1872 | 1839 | | |
1873 | 1840 | | |
1874 | 1841 | | |
1875 | 1842 | | |
1876 | 1843 | | |
1877 | | - | |
| 1844 | + | |
1878 | 1845 | | |
1879 | | - | |
| 1846 | + | |
1880 | 1847 | | |
1881 | 1848 | | |
1882 | 1849 | | |
| |||
13816 | 13783 | | |
13817 | 13784 | | |
13818 | 13785 | | |
| 13786 | + | |
| 13787 | + | |
13819 | 13788 | | |
13820 | 13789 | | |
13821 | 13790 | | |
13822 | | - | |
| 13791 | + | |
13823 | 13792 | | |
13824 | 13793 | | |
13825 | | - | |
| 13794 | + | |
| 13795 | + | |
| 13796 | + | |
| 13797 | + | |
| 13798 | + | |
| 13799 | + | |
| 13800 | + | |
| 13801 | + | |
| 13802 | + | |
| 13803 | + | |
| 13804 | + | |
| 13805 | + | |
| 13806 | + | |
| 13807 | + | |
| 13808 | + | |
| 13809 | + | |
| 13810 | + | |
| 13811 | + | |
| 13812 | + | |
| 13813 | + | |
| 13814 | + | |
| 13815 | + | |
13826 | 13816 | | |
13827 | 13817 | | |
13828 | 13818 | | |
13829 | 13819 | | |
13830 | 13820 | | |
13831 | 13821 | | |
13832 | | - | |
| 13822 | + | |
13833 | 13823 | | |
13834 | 13824 | | |
13835 | 13825 | | |
| |||
Lines changed: 58 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 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments