1830 break; |
1830 break; |
1831 } |
1831 } |
1832 case Op_Binary: // These are introduced in the Post_Visit state. |
1832 case Op_Binary: // These are introduced in the Post_Visit state. |
1833 ShouldNotReachHere(); |
1833 ShouldNotReachHere(); |
1834 break; |
1834 break; |
1835 case Op_StoreB: // Do match these, despite no ideal reg |
|
1836 case Op_StoreC: |
|
1837 case Op_StoreCM: |
|
1838 case Op_StoreD: |
|
1839 case Op_StoreF: |
|
1840 case Op_StoreI: |
|
1841 case Op_StoreL: |
|
1842 case Op_StoreP: |
|
1843 case Op_StoreN: |
|
1844 case Op_Store16B: |
|
1845 case Op_Store8B: |
|
1846 case Op_Store4B: |
|
1847 case Op_Store8C: |
|
1848 case Op_Store4C: |
|
1849 case Op_Store2C: |
|
1850 case Op_Store4I: |
|
1851 case Op_Store2I: |
|
1852 case Op_Store2L: |
|
1853 case Op_Store4F: |
|
1854 case Op_Store2F: |
|
1855 case Op_Store2D: |
|
1856 case Op_ClearArray: |
1835 case Op_ClearArray: |
1857 case Op_SafePoint: |
1836 case Op_SafePoint: |
1858 mem_op = true; |
1837 mem_op = true; |
1859 break; |
1838 break; |
1860 case Op_LoadB: |
1839 default: |
1861 case Op_LoadUS: |
1840 if( n->is_Store() ) { |
1862 case Op_LoadD: |
1841 // Do match stores, despite no ideal reg |
1863 case Op_LoadF: |
1842 mem_op = true; |
1864 case Op_LoadI: |
1843 break; |
1865 case Op_LoadKlass: |
1844 } |
1866 case Op_LoadNKlass: |
1845 if( n->is_Mem() ) { // Loads and LoadStores |
1867 case Op_LoadL: |
1846 mem_op = true; |
1868 case Op_LoadS: |
1847 // Loads must be root of match tree due to prior load conflict |
1869 case Op_LoadP: |
1848 if( C->subsume_loads() == false ) |
1870 case Op_LoadN: |
1849 set_shared(n); |
1871 case Op_LoadRange: |
|
1872 case Op_LoadD_unaligned: |
|
1873 case Op_LoadL_unaligned: |
|
1874 case Op_Load16B: |
|
1875 case Op_Load8B: |
|
1876 case Op_Load4B: |
|
1877 case Op_Load4C: |
|
1878 case Op_Load2C: |
|
1879 case Op_Load8C: |
|
1880 case Op_Load8S: |
|
1881 case Op_Load4S: |
|
1882 case Op_Load2S: |
|
1883 case Op_Load4I: |
|
1884 case Op_Load2I: |
|
1885 case Op_Load2L: |
|
1886 case Op_Load4F: |
|
1887 case Op_Load2F: |
|
1888 case Op_Load2D: |
|
1889 mem_op = true; |
|
1890 // Must be root of match tree due to prior load conflict |
|
1891 if( C->subsume_loads() == false ) { |
|
1892 set_shared(n); |
|
1893 } |
1850 } |
1894 // Fall into default case |
1851 // Fall into default case |
1895 default: |
|
1896 if( !n->ideal_reg() ) |
1852 if( !n->ideal_reg() ) |
1897 set_dontcare(n); // Unmatchable Nodes |
1853 set_dontcare(n); // Unmatchable Nodes |
1898 } // end_switch |
1854 } // end_switch |
1899 |
1855 |
1900 for(int i = n->req() - 1; i >= 0; --i) { // For my children |
1856 for(int i = n->req() - 1; i >= 0; --i) { // For my children |
1911 if( _must_clone[mop] ) { |
1867 if( _must_clone[mop] ) { |
1912 mstack.push(m, Visit); |
1868 mstack.push(m, Visit); |
1913 continue; // for(int i = ...) |
1869 continue; // for(int i = ...) |
1914 } |
1870 } |
1915 |
1871 |
1916 // Clone addressing expressions as they are "free" in most instructions |
1872 if( mop == Op_AddP && m->in(AddPNode::Base)->Opcode() == Op_DecodeN ) { |
|
1873 // Bases used in addresses must be shared but since |
|
1874 // they are shared through a DecodeN they may appear |
|
1875 // to have a single use so force sharing here. |
|
1876 set_shared(m->in(AddPNode::Base)->in(1)); |
|
1877 } |
|
1878 |
|
1879 // Clone addressing expressions as they are "free" in memory access instructions |
1917 if( mem_op && i == MemNode::Address && mop == Op_AddP ) { |
1880 if( mem_op && i == MemNode::Address && mop == Op_AddP ) { |
1918 if (m->in(AddPNode::Base)->Opcode() == Op_DecodeN) { |
|
1919 // Bases used in addresses must be shared but since |
|
1920 // they are shared through a DecodeN they may appear |
|
1921 // to have a single use so force sharing here. |
|
1922 set_shared(m->in(AddPNode::Base)->in(1)); |
|
1923 } |
|
1924 |
|
1925 // Some inputs for address expression are not put on stack |
1881 // Some inputs for address expression are not put on stack |
1926 // to avoid marking them as shared and forcing them into register |
1882 // to avoid marking them as shared and forcing them into register |
1927 // if they are used only in address expressions. |
1883 // if they are used only in address expressions. |
1928 // But they should be marked as shared if there are other uses |
1884 // But they should be marked as shared if there are other uses |
1929 // besides address expressions. |
1885 // besides address expressions. |