1 /*
2 * Copyright (c) 1997, 2013, 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 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "opto/callnode.hpp"
28 #include "opto/chaitin.hpp"
29 #include "opto/live.hpp"
30 #include "opto/machnode.hpp"
31
32
33 // Compute live-in/live-out. We use a totally incremental algorithm. The LIVE
34 // problem is monotonic. The steady-state solution looks like this: pull a
35 // block from the worklist. It has a set of delta's - values which are newly
36 // live-in from the block. Push these to the live-out sets of all predecessor
37 // blocks. At each predecessor, the new live-out values are ANDed with what is
38 // already live-out (extra stuff is added to the live-out sets). Then the
39 // remaining new live-out values are ANDed with what is locally defined.
40 // Leftover bits become the new live-in for the predecessor block, and the pred
41 // block is put on the worklist.
42 // The locally live-in stuff is computed once and added to predecessor
43 // live-out sets. This separate compilation is done in the outer loop below.
44 PhaseLive::PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena, bool keep_deltas)
45 : Phase(LIVE),
46 _cfg(cfg),
|
1 /*
2 * Copyright (c) 1997, 2016, 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 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "memory/resourceArea.hpp"
28 #include "opto/callnode.hpp"
29 #include "opto/chaitin.hpp"
30 #include "opto/live.hpp"
31 #include "opto/machnode.hpp"
32
33
34 // Compute live-in/live-out. We use a totally incremental algorithm. The LIVE
35 // problem is monotonic. The steady-state solution looks like this: pull a
36 // block from the worklist. It has a set of delta's - values which are newly
37 // live-in from the block. Push these to the live-out sets of all predecessor
38 // blocks. At each predecessor, the new live-out values are ANDed with what is
39 // already live-out (extra stuff is added to the live-out sets). Then the
40 // remaining new live-out values are ANDed with what is locally defined.
41 // Leftover bits become the new live-in for the predecessor block, and the pred
42 // block is put on the worklist.
43 // The locally live-in stuff is computed once and added to predecessor
44 // live-out sets. This separate compilation is done in the outer loop below.
45 PhaseLive::PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena, bool keep_deltas)
46 : Phase(LIVE),
47 _cfg(cfg),
|