Commit 1f8540e
Create copy if the operands of gather/scatter instructions overlap.
A gather has two operands, input and indices. If they point to the same instruction, create a copy for indices.
A scatter has n inputs, 1 indices, and n updates (2n+1 operands in total). We allow overlap between n inputs. We also allow overlap between n updates. We need to create a copy if
* indices overlap with any input or update
* update overlap with any input
The added copy will be removed if it is redundant in the following memory related passes (e.g., CopyInsertion).
PiperOrigin-RevId: 7151649591 parent b27c9d3 commit 1f8540e
File tree
2 files changed
+49
-1
lines changed- xla/service/spmd
2 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
960 | | - | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
961 | 966 | | |
962 | 967 | | |
963 | 968 | | |
| |||
1822 | 1827 | | |
1823 | 1828 | | |
1824 | 1829 | | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
1825 | 1837 | | |
1826 | 1838 | | |
1827 | 1839 | | |
| |||
1847 | 1859 | | |
1848 | 1860 | | |
1849 | 1861 | | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
1850 | 1871 | | |
1851 | 1872 | | |
1852 | 1873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14871 | 14871 | | |
14872 | 14872 | | |
14873 | 14873 | | |
| 14874 | + | |
| 14875 | + | |
| 14876 | + | |
| 14877 | + | |
| 14878 | + | |
| 14879 | + | |
| 14880 | + | |
| 14881 | + | |
| 14882 | + | |
| 14883 | + | |
| 14884 | + | |
| 14885 | + | |
| 14886 | + | |
| 14887 | + | |
| 14888 | + | |
| 14889 | + | |
| 14890 | + | |
| 14891 | + | |
| 14892 | + | |
| 14893 | + | |
| 14894 | + | |
| 14895 | + | |
| 14896 | + | |
| 14897 | + | |
| 14898 | + | |
| 14899 | + | |
| 14900 | + | |
14874 | 14901 | | |
14875 | 14902 | | |
14876 | 14903 | | |
| |||
0 commit comments