679 Block *current_block, Node_List& value, Node_List ®nd, |
679 Block *current_block, Node_List& value, Node_List ®nd, |
680 OptoReg::Name nreg, OptoReg::Name nreg2); |
680 OptoReg::Name nreg, OptoReg::Name nreg2); |
681 // Extend the node to LRG mapping |
681 // Extend the node to LRG mapping |
682 void add_reference( const Node *node, const Node *old_node); |
682 void add_reference( const Node *node, const Node *old_node); |
683 |
683 |
|
684 // Record the first use of a def in the block for a register. |
|
685 class RegDefUse { |
|
686 Node* _def; |
|
687 Node* _first_use; |
|
688 public: |
|
689 RegDefUse() : _def(NULL), _first_use(NULL) { } |
|
690 Node* def() const { return _def; } |
|
691 Node* first_use() const { return _first_use; } |
|
692 |
|
693 void update(Node* def, Node* use) { |
|
694 if (_def != def) { |
|
695 _def = def; |
|
696 _first_use = use; |
|
697 } |
|
698 } |
|
699 void clear() { |
|
700 _def = NULL; |
|
701 _first_use = NULL; |
|
702 } |
|
703 }; |
|
704 typedef GrowableArray<RegDefUse> RegToDefUseMap; |
|
705 int possibly_merge_multidef(Node *n, uint k, Block *block, RegToDefUseMap& reg2defuse); |
|
706 |
|
707 // Merge nodes that are a part of a multidef lrg and produce the same value within a block. |
|
708 void merge_multidefs(); |
|
709 |
684 private: |
710 private: |
685 |
711 |
686 static int _final_loads, _final_stores, _final_copies, _final_memoves; |
712 static int _final_loads, _final_stores, _final_copies, _final_memoves; |
687 static double _final_load_cost, _final_store_cost, _final_copy_cost, _final_memove_cost; |
713 static double _final_load_cost, _final_store_cost, _final_copy_cost, _final_memove_cost; |
688 static int _conserv_coalesce, _conserv_coalesce_pair; |
714 static int _conserv_coalesce, _conserv_coalesce_pair; |