Mercurial > hg > graal-compiler
comparison src/share/vm/opto/cfgnode.cpp @ 368:36ccc817fca4
6747051: Improve code and implicit null check generation for compressed oops
Summary: Push DecodeN node below the Null check to the non-null path to use the mach node without 0 test.
Reviewed-by: rasbold, never
author | kvn |
---|---|
date | Tue, 23 Sep 2008 12:29:06 -0700 |
parents | 194b8e3a2fc4 |
children | cc80376deb0c |
comparison
equal
deleted
inserted
replaced
367:194b8e3a2fc4 | 368:36ccc817fca4 |
---|---|
1767 progress = this; | 1767 progress = this; |
1768 } | 1768 } |
1769 } | 1769 } |
1770 } | 1770 } |
1771 | 1771 |
1772 #ifdef _LP64 | |
1773 // Push DecodeN down through phi. | |
1774 // The rest of phi graph will transform by split EncodeP node though phis up. | |
1775 if (UseCompressedOops && can_reshape && progress == NULL) { | |
1776 bool may_push = true; | |
1777 bool has_decodeN = false; | |
1778 Node* in_decodeN = NULL; | |
1779 for (uint i=1; i<req(); ++i) {// For all paths in | |
1780 Node *ii = in(i); | |
1781 if (ii->is_DecodeN() && ii->bottom_type() == bottom_type()) { | |
1782 has_decodeN = true; | |
1783 in_decodeN = ii->in(1); | |
1784 } else if (!ii->is_Phi()) { | |
1785 may_push = false; | |
1786 } | |
1787 } | |
1788 | |
1789 if (has_decodeN && may_push) { | |
1790 PhaseIterGVN *igvn = phase->is_IterGVN(); | |
1791 // Note: in_decodeN is used only to define the type of new phi here. | |
1792 PhiNode *new_phi = PhiNode::make_blank(in(0), in_decodeN); | |
1793 uint orig_cnt = req(); | |
1794 for (uint i=1; i<req(); ++i) {// For all paths in | |
1795 Node *ii = in(i); | |
1796 Node* new_ii = NULL; | |
1797 if (ii->is_DecodeN()) { | |
1798 assert(ii->bottom_type() == bottom_type(), "sanity"); | |
1799 new_ii = ii->in(1); | |
1800 } else { | |
1801 assert(ii->is_Phi(), "sanity"); | |
1802 if (ii->as_Phi() == this) { | |
1803 new_ii = new_phi; | |
1804 } else { | |
1805 new_ii = new (phase->C, 2) EncodePNode(ii, in_decodeN->bottom_type()); | |
1806 igvn->register_new_node_with_optimizer(new_ii); | |
1807 } | |
1808 } | |
1809 new_phi->set_req(i, new_ii); | |
1810 } | |
1811 igvn->register_new_node_with_optimizer(new_phi, this); | |
1812 progress = new (phase->C, 2) DecodeNNode(new_phi, bottom_type()); | |
1813 } | |
1814 } | |
1815 #endif | |
1816 | |
1772 return progress; // Return any progress | 1817 return progress; // Return any progress |
1773 } | 1818 } |
1774 | 1819 |
1775 //------------------------------out_RegMask------------------------------------ | 1820 //------------------------------out_RegMask------------------------------------ |
1776 const RegMask &PhiNode::in_RegMask(uint i) const { | 1821 const RegMask &PhiNode::in_RegMask(uint i) const { |