1 /*
2 * Copyright (c) 1997, 2011, 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 *
1690 // Initialize IterGVN with types and values from parse-time GVN
1691 PhaseIterGVN igvn(initial_gvn());
1692 {
1693 NOT_PRODUCT( TracePhase t2("iterGVN", &_t_iterGVN, TimeCompiler); )
1694 igvn.optimize();
1695 }
1696
1697 print_method("Iter GVN 1", 2);
1698
1699 if (failing()) return;
1700
1701 // Perform escape analysis
1702 if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
1703 if (has_loops()) {
1704 // Cleanup graph (remove dead nodes).
1705 TracePhase t2("idealLoop", &_t_idealLoop, true);
1706 PhaseIdealLoop ideal_loop( igvn, false, true );
1707 if (major_progress()) print_method("PhaseIdealLoop before EA", 2);
1708 if (failing()) return;
1709 }
1710 TracePhase t2("escapeAnalysis", &_t_escapeAnalysis, true);
1711 ConnectionGraph::do_analysis(this, &igvn);
1712
1713 if (failing()) return;
1714
1715 // Optimize out fields loads from scalar replaceable allocations.
1716 igvn.optimize();
1717 print_method("Iter GVN after EA", 2);
1718
1719 if (failing()) return;
1720
1721 if (congraph() != NULL && macro_count() > 0) {
1722 PhaseMacroExpand mexp(igvn);
1723 mexp.eliminate_macro_nodes();
1724 igvn.set_delay_transform(false);
1725
1726 igvn.optimize();
1727 print_method("Iter GVN after eliminating allocations and locks", 2);
1728
1729 if (failing()) return;
1730 }
1731 }
1732
1733 // Loop transforms on the ideal graph. Range Check Elimination,
1734 // peeling, unrolling, etc.
1735
1736 // Set loop opts counter
1737 loop_opts_cnt = num_loop_opts();
1738 if((loop_opts_cnt > 0) && (has_loops() || has_split_ifs())) {
1739 {
1740 TracePhase t2("idealLoop", &_t_idealLoop, true);
1741 PhaseIdealLoop ideal_loop( igvn, true );
|
1 /*
2 * Copyright (c) 1997, 2012, 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 *
1690 // Initialize IterGVN with types and values from parse-time GVN
1691 PhaseIterGVN igvn(initial_gvn());
1692 {
1693 NOT_PRODUCT( TracePhase t2("iterGVN", &_t_iterGVN, TimeCompiler); )
1694 igvn.optimize();
1695 }
1696
1697 print_method("Iter GVN 1", 2);
1698
1699 if (failing()) return;
1700
1701 // Perform escape analysis
1702 if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) {
1703 if (has_loops()) {
1704 // Cleanup graph (remove dead nodes).
1705 TracePhase t2("idealLoop", &_t_idealLoop, true);
1706 PhaseIdealLoop ideal_loop( igvn, false, true );
1707 if (major_progress()) print_method("PhaseIdealLoop before EA", 2);
1708 if (failing()) return;
1709 }
1710 ConnectionGraph::do_analysis(this, &igvn);
1711
1712 if (failing()) return;
1713
1714 // Optimize out fields loads from scalar replaceable allocations.
1715 igvn.optimize();
1716 print_method("Iter GVN after EA", 2);
1717
1718 if (failing()) return;
1719
1720 if (congraph() != NULL && macro_count() > 0) {
1721 NOT_PRODUCT( TracePhase t2("macroEliminate", &_t_macroEliminate, TimeCompiler); )
1722 PhaseMacroExpand mexp(igvn);
1723 mexp.eliminate_macro_nodes();
1724 igvn.set_delay_transform(false);
1725
1726 igvn.optimize();
1727 print_method("Iter GVN after eliminating allocations and locks", 2);
1728
1729 if (failing()) return;
1730 }
1731 }
1732
1733 // Loop transforms on the ideal graph. Range Check Elimination,
1734 // peeling, unrolling, etc.
1735
1736 // Set loop opts counter
1737 loop_opts_cnt = num_loop_opts();
1738 if((loop_opts_cnt > 0) && (has_loops() || has_split_ifs())) {
1739 {
1740 TracePhase t2("idealLoop", &_t_idealLoop, true);
1741 PhaseIdealLoop ideal_loop( igvn, true );
|