121 // Make the Union-Find mapping an identity function |
121 // Make the Union-Find mapping an identity function |
122 _uf_map.extend(lrg,lrg); |
122 _uf_map.extend(lrg,lrg); |
123 } |
123 } |
124 |
124 |
125 //------------------------------clone_projs------------------------------------ |
125 //------------------------------clone_projs------------------------------------ |
126 // After cloning some rematierialized instruction, clone any MachProj's that |
126 // After cloning some rematerialized instruction, clone any MachProj's that |
127 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants |
127 // follow it. Example: Intel zero is XOR, kills flags. Sparc FP constants |
128 // use G3 as an address temp. |
128 // use G3 as an address temp. |
129 int PhaseChaitin::clone_projs( Block *b, uint idx, Node *con, Node *copy, uint &maxlrg ) { |
129 int PhaseChaitin::clone_projs( Block *b, uint idx, Node *con, Node *copy, uint &maxlrg ) { |
130 Block *bcon = _cfg._bbs[con->_idx]; |
130 Block *bcon = _cfg._bbs[con->_idx]; |
131 uint cindex = bcon->find_node(con); |
131 uint cindex = bcon->find_node(con); |
692 if( ++reg_degree >= rm_size ) |
692 if( ++reg_degree >= rm_size ) |
693 return max_juint; |
693 return max_juint; |
694 } // End of if not infinite-stack neighbor |
694 } // End of if not infinite-stack neighbor |
695 } // End of if actually inserted |
695 } // End of if actually inserted |
696 } // End of if live range overlaps |
696 } // End of if live range overlaps |
697 } // End of else collect intereferences for 1 node |
697 } // End of else collect interferences for 1 node |
698 } // End of while forever, scan back for intereferences |
698 } // End of while forever, scan back for interferences |
699 return reg_degree; |
699 return reg_degree; |
700 } |
700 } |
701 |
701 |
702 //------------------------------update_ifg------------------------------------- |
702 //------------------------------update_ifg------------------------------------- |
703 void PhaseConservativeCoalesce::update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2) { |
703 void PhaseConservativeCoalesce::update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2) { |
784 if( rm.is_AllStack() ) rm_size += 1000000; |
784 if( rm.is_AllStack() ) rm_size += 1000000; |
785 // Incompatible masks, no way to coalesce |
785 // Incompatible masks, no way to coalesce |
786 if( rm_size == 0 ) return false; |
786 if( rm_size == 0 ) return false; |
787 |
787 |
788 // Another early bail-out test is when we are double-coalescing and the |
788 // Another early bail-out test is when we are double-coalescing and the |
789 // 2 copies are seperated by some control flow. |
789 // 2 copies are separated by some control flow. |
790 if( dst_copy != src_copy ) { |
790 if( dst_copy != src_copy ) { |
791 Block *src_b = _phc._cfg._bbs[src_copy->_idx]; |
791 Block *src_b = _phc._cfg._bbs[src_copy->_idx]; |
792 Block *b2 = b; |
792 Block *b2 = b; |
793 while( b2 != src_b ) { |
793 while( b2 != src_b ) { |
794 if( b2->num_preds() > 2 ){// Found merge-point |
794 if( b2->num_preds() > 2 ){// Found merge-point |