1 /*
2 * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 class LoopTree;
26 class LRG;
27 class LRG_List;
28 class Matcher;
29 class PhaseIFG;
30 class PhaseCFG;
31
32 //------------------------------PhaseCoalesce----------------------------------
33 class PhaseCoalesce : public Phase {
34 protected:
35 PhaseChaitin &_phc;
36
37 public:
38 // Coalesce copies
39 PhaseCoalesce( PhaseChaitin &chaitin ) : Phase(Coalesce), _phc(chaitin) { }
40
41 virtual void verify() = 0;
42
43 // Coalesce copies
44 void coalesce_driver( );
90 class PhaseConservativeCoalesce : public PhaseCoalesce {
91 IndexSet _ulr; // Union live range interferences
92 public:
93 // Coalesce copies
94 PhaseConservativeCoalesce( PhaseChaitin &chaitin );
95
96 virtual void verify();
97
98 // Conservatively coalesce copies in this block
99 virtual void coalesce( Block *b );
100
101 // Coalesce this chain of copies away
102 bool copy_copy( Node *dst_copy, Node *src_copy, Block *b, uint bindex );
103
104 void union_helper( Node *lr1_node, Node *lr2_node, uint lr1, uint lr2, Node *src_def, Node *dst_copy, Node *src_copy, Block *b, uint bindex );
105
106 uint compute_separating_interferences(Node *dst_copy, Node *src_copy, Block *b, uint bindex, RegMask &rm, uint rm_size, uint reg_degree, uint lr1, uint lr2);
107
108 void update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2);
109 };
|
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OPTO_COALESCE_HPP
26 #define SHARE_VM_OPTO_COALESCE_HPP
27
28 #include "opto/phase.hpp"
29
30 class LoopTree;
31 class LRG;
32 class LRG_List;
33 class Matcher;
34 class PhaseIFG;
35 class PhaseCFG;
36
37 //------------------------------PhaseCoalesce----------------------------------
38 class PhaseCoalesce : public Phase {
39 protected:
40 PhaseChaitin &_phc;
41
42 public:
43 // Coalesce copies
44 PhaseCoalesce( PhaseChaitin &chaitin ) : Phase(Coalesce), _phc(chaitin) { }
45
46 virtual void verify() = 0;
47
48 // Coalesce copies
49 void coalesce_driver( );
95 class PhaseConservativeCoalesce : public PhaseCoalesce {
96 IndexSet _ulr; // Union live range interferences
97 public:
98 // Coalesce copies
99 PhaseConservativeCoalesce( PhaseChaitin &chaitin );
100
101 virtual void verify();
102
103 // Conservatively coalesce copies in this block
104 virtual void coalesce( Block *b );
105
106 // Coalesce this chain of copies away
107 bool copy_copy( Node *dst_copy, Node *src_copy, Block *b, uint bindex );
108
109 void union_helper( Node *lr1_node, Node *lr2_node, uint lr1, uint lr2, Node *src_def, Node *dst_copy, Node *src_copy, Block *b, uint bindex );
110
111 uint compute_separating_interferences(Node *dst_copy, Node *src_copy, Block *b, uint bindex, RegMask &rm, uint rm_size, uint reg_degree, uint lr1, uint lr2);
112
113 void update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2);
114 };
115
116 #endif // SHARE_VM_OPTO_COALESCE_HPP
|